using Entity.Sugar; using Newtonsoft.Json; using SqlSugar; using SqlSugar.Base; using System.Collections.Generic; namespace WebApp.Hubs { public class MsgHubService { /// /// /// todo: describe sOrgId parameter on GetBillsString /// todo: describe sId parameter on GetBillsString /// public static string GetBillsString(string sOrgId, string sId) { var sBills = ""; var db = SugarBase.DB; var saBills = db.Queryable() .Where(it => it.OrgID == sOrgId) .WhereIF(sId != "", it => it.BillNO == sId).ToList(); sBills = JsonConvert.SerializeObject(saBills, Formatting.Indented); return sBills; } /// /// /// todo: describe sOrgId parameter on GetCustomersString /// todo: describe sId parameter on GetCustomersString /// public static string GetCustomersString(string sOrgId, string sId) { var sCustomers = ""; var db = SugarBase.DB; var saCustomers = db.Queryable() .Where(it => it.OrgID == sOrgId) .WhereIF(sId != "", it => it.Feild01 == sId).ToList(); sCustomers = JsonConvert.SerializeObject(saCustomers, Formatting.Indented); return sCustomers; } /// todo: describe sOrgId parameter on /// GetExhibitionsString todo: describe sId parameter on /// GetExhibitionsString public static string GetExhibitionsString(string sOrgId, string sId) { var sExhibitions = ""; var db = SugarBase.DB; var saExhibitions = db.Queryable() .Where(it => it.OrgID == sOrgId) .WhereIF(sId != "", it => it.PrjNO == sId).ToList(); sExhibitions = JsonConvert.SerializeObject(saExhibitions, Formatting.Indented); return sExhibitions; } /// /// /// todo: describe data parameter on RemoveBills /// public static void RemoveBills(string data) { var listBills = JsonConvert.DeserializeObject>(data); var db = SugarBase.DB; var sdb = new SimpleClient(db); var iRel = db.Deleteable(listBills).ExecuteCommand(); } /// /// /// todo: describe data parameter on RemoveCustomers /// public static void RemoveCustomers(string data) { var listCustomers = JsonConvert.DeserializeObject>(data); var db = SugarBase.DB; var sdb = new SimpleClient(db); var iRel = db.Deleteable(listCustomers).ExecuteCommand(); } /// /// /// todo: describe data parameter on RemoveExhibitions /// public static void RemoveExhibitions(string data) { var listExhibitions = JsonConvert.DeserializeObject>(data); var db = SugarBase.DB; var sdb = new SimpleClient(db); var iRel = db.Deleteable(listExhibitions).ExecuteCommand(); } } }