public string JsonDataForEasyUIdataGrid(int pageindex, int pagesize, string filterJson, string sort = "keyid", string order = "asc") { string sortorder = sort + " " + order; var pcp = new ProcCustomPage("sys_roles") { PageIndex = pageindex, PageSize = pagesize, OrderFields = sortorder, WhereString = FilterTranslator.ToSql(filterJson) }; int recordCount; DataTable dt = base.GetPageWithSp(pcp, out recordCount); dt.Columns.Add(new DataColumn("Departments")); //可以访问的部门数据 var rolelist = RoleDal.Instance.GetAll(); foreach (DataRow row in dt.Rows) { row["Departments"] = rolelist.First(n => n.KeyId == PublicMethod.GetInt(row["KeyId"])).Departments; } return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
public string Data(int page = 1, int rows = 15, string productname = null, string stockname = null, string productnumber = null, string wdr = null, string batchno = null, string brand = null, string mode = null, string colorno = null) { if (!string.IsNullOrEmpty(brand) && (!string.IsNullOrEmpty(productname) || !string.IsNullOrEmpty(mode) || !string.IsNullOrEmpty(stockname) || !string.IsNullOrEmpty(colorno))) { int pagecount = 0; APIService.APIServiceClient api = new APIService.APIServiceClient(); DataTable table = api.WmStock( out pagecount, productnumber, productname, stockname, brand, batchno, wdr, mode, colorno, rows, page, true, false); return(JSONhelper.FormatJSONForEasyuiDataGrid(pagecount, table)); } return(null); }
private string JsonDataForEasyUIdataGrid2(int pageindex, int pagesize, string filterJSON) { string where = string.Empty; if (filterJSON != "") { where = FilterTranslator.ToSql(filterJSON); } else { where = " "; } var pcp = new ProcCustomPage() { Sp_PagerName = "ProcCustomPageUnion", TableName = @"(select a.ID, a.BookName, a.BookSNCode, a.BookPrice, a.PressID, PressName, PressAddress, PressPhone from BookInfo a inner join PressInfo b on a.PressID= b.ID)", PageIndex = pageindex, PageSize = pagesize, ShowFields = "*", OrderFields = "ID desc", KeyFields = "ID", WhereString = where }; int recordCount; DataTable dt = DbUtils.GetPageWithSp(pcp, out recordCount); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
private void GetMessageListByFunctionCode(HttpContext ctx) { var pageParam = new PageParam(ctx); string searchValue = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("searchValue")); string functionCode = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("functionCode")); searchValue = !string.IsNullOrEmpty(searchValue) ? HttpUtility.UrlDecode(searchValue) + " AND " : ""; UserInfo curUser = Utils.UserInfo; if (!string.IsNullOrEmpty(functionCode)) { searchValue += CiMessageTable.FieldFunctionCode + " = '" + functionCode + "'"; } searchValue = !string.IsNullOrEmpty(searchValue) ? searchValue + " AND " : ""; /* * SELECT * FROM dbo.CIMESSAGE * WHERE FUNCTIONCODE = 'UserMessage' * AND ((RECEIVERID = '26F43BC9-AE6D-42D2-BAC9-F4237A949484' AND CATEGORYCODE = 'Receiver') * OR (CREATEUSERID = '26F43BC9-AE6D-42D2-BAC9-F4237A949484' AND CATEGORYCODE = 'Send')) * ORDER BY CREATEON DESC */ searchValue += "((" + CiMessageTable.FieldReceiverId + " = '" + curUser.Id + "' AND " + CiMessageTable.FieldCategoryCode + " ='Receiver') " + " OR (" + CiMessageTable.FieldCreateUserId + " = '" + curUser.Id + "' AND " + CiMessageTable.FieldCategoryCode + " ='Send'))"; //只显示自己发送的与自己授收的数据 int recordCount; var dtMessage = RDIFrameworkService.Instance.MessageService.GetMessagesByConditional(curUser, searchValue, out recordCount, pageParam.PageIndex, pageParam.PageSize); var json = JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dtMessage); ctx.Response.Write(json); }
private string JsonDataForEasyUIdataGrid(int pageindex, int pagesize, string filterJSON) { //数据权限条件 int userid = SysVisitor.Instance.UserId; string deps = SysVisitor.Instance.Departments; string where = "ownner=" + userid + " and depid in (" + deps + ")"; if (SysVisitor.Instance.IsAdmin) { where = ""; } else { if (filterJSON != "") { where = FilterTranslator.ToSql(filterJSON) + " and " + where; } } var pcp = new ProcCustomPage("demo_users") { PageIndex = pageindex, PageSize = pagesize, OrderFields = "keyid asc", WhereString = where }; int recordCount; DataTable dt = DbUtils.GetPageWithSp(pcp, out recordCount); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
public string GetJsonData(int pageindex, int pagesize, string filterJson, string sort, string order) { var pcp = new ProcCustomPage("base_Employee") { IDX_PAGE_IN = pageindex, CURR_PAGE_COUNT_IN = pagesize, SQL_ORDERBY_IN = sort + " " + order, SQL_WHERE_IN = FilterTranslator.ToSql(filterJson) }; var Employees = EmployeeDal.Instance.GetAll(); int recordCount; DataTable dt = EmployeeDal.Instance.GetPageWithSp(pcp, out recordCount); dt.Columns.Add(new DataColumn("DepartmentName")); var departments = DepartmentDal.Instance.GetAll().ToList(); foreach (DataRow row in dt.Rows) { var dep = departments.Where(n => row != null && n.FID == (string)row["FDepartmentID"]); var enumerable = dep as Department[] ?? dep.ToArray(); if (enumerable.Any()) { row["DepartmentName"] = enumerable.First().DepartmentName; } else { row["DepartmentName"] = ""; } } return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
public string JsonDataForEasyUIdataGrid(int pageindex, int pagesize, string filterJson, string sort = "FID", string order = "asc") { string sortorder = sort + " " + order; var pcp = new ProcCustomPage("sys_roles") { IDX_PAGE_IN = pageindex, CURR_PAGE_COUNT_IN = pagesize, SQL_ORDERBY_IN = sortorder.Trim(), SQL_WHERE_IN = FilterTranslator.ToSql(filterJson) }; int recordCount; DataTable dt = base.GetPageWithSp(pcp, out recordCount); dt.Columns.Add(new DataColumn("Departments")); //可以访问的部门数据 var rolelist = RoleDal.Instance.GetAll(); foreach (DataRow row in dt.Rows) { row["Departments"] = rolelist.First(n => n.FID == PublicMethod.GetString(row["FID"])).Departments; } return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
public virtual string JsonDataForEasyUIdataGrid(int pageindex, int pagesize) { IEnumerable <T> list = this.GetPage(pageindex, pagesize); int recordcount = this.Count(); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordcount, list)); }
public string GetListJson(int pageindex, int pagesize, string driverids, string filterJson, string sort, string order) { string where = FilterTranslator.ToSql(filterJson); DataTable table = MessageDal.Instance.GetList(pageindex, pagesize, driverids, where, sort, order); return(JSONhelper.FormatJSONForEasyuiDataGrid(MessageDal.Instance.GetCount(driverids, where), table)); }
/// <summary> /// 得到分页角色列表 /// </summary> /// <param name="ctx">http请求信息</param> private void GetParameterListByPage(HttpContext ctx) { var pageParam = new PageParam(ctx); var recordCount = 0; var dtRole = RDIFrameworkService.Instance.ParameterService.GetDTByPage(Utils.UserInfo, out recordCount, pageParam.PageIndex, pageParam.PageSize, pageParam.Filter, (pageParam.SortField + " " + pageParam.Order)); var json = JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dtRole); ctx.Response.Write(json); }
public string Account(FormCollection context) { UserBll.Instance.CheckUserOnlingState(); string brandid = context["FBRANDID"]; var list = TB_CLIENTACCOUNTDal.Instance.GetWhere(new { FBRANDID = brandid }).ToList(); return(JSONhelper.FormatJSONForEasyuiDataGrid(list.Count, list)); }
public string Unit(FormCollection context) { UserBll.Instance.CheckUserOnlingState(); string productid = context["FPRODUCTID"]; var list = V_UNITGROUPDal.Instance.GetWhere(new { FPRODUCTID = productid }).ToList(); return(JSONhelper.FormatJSONForEasyuiDataGrid(list.Count, list)); }
private void GridListJson(HttpContext ctx) { var returnJson = "[]"; var manager = new CASE_PRODUCTINFOManager(this.dbHelper, Utils.UserInfo); var dtTemp = manager.GetDT(20, CASE_PRODUCTINFOTable.FieldMODIFIEDON + " desc"); if (dtTemp != null && dtTemp.Rows.Count > 0) { returnJson = JSONhelper.FormatJSONForEasyuiDataGrid(20, dtTemp); } ctx.Response.Write(returnJson); }
public string Report3Data(string startdate, string enddate, string typename, string fbrandname) { if (string.IsNullOrEmpty(startdate) && string.IsNullOrEmpty(enddate)) { return(""); } else { DataTable table = ReportDAL.Instance.Report3(startdate, enddate, typename, fbrandname); return(JSONhelper.FormatJSONForEasyuiDataGrid(table.Rows.Count, table)); } }
public string Report1Data(string billno, string preM_name, string src_name, string startdate, string enddate) { if (string.IsNullOrEmpty(billno) && string.IsNullOrEmpty(src_name) && string.IsNullOrEmpty(preM_name) && string.IsNullOrEmpty(startdate) && string.IsNullOrEmpty(enddate)) { return(""); } else { DataTable table = ReportDAL.Instance.Report1(billno, preM_name, src_name, startdate, enddate); return(JSONhelper.FormatJSONForEasyuiDataGrid(table.Rows.Count, table)); } }
public string JsonDataForEasyUIdataGrid(int pageindex, int pagesize, string filterJSON) { var pcp = new ProcCustomPage("V_logs") { IDX_PAGE_IN = pageindex, CURR_PAGE_COUNT_IN = pagesize, SQL_ORDERBY_IN = "FID desc", SQL_WHERE_IN = FilterTranslator.ToSql(filterJSON) }; int recordCount; DataTable dt = base.GetPageWithSp(pcp, out recordCount); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
public string GetDetail(string groupno) { if (!string.IsNullOrEmpty(groupno)) { string sql = string.Format("select t1.* from V_ICSEOUTBILLENTRY t1 inner join ICSEOUTBILL t2 on t1.FICSEOUTID = t2.fid and t2.fgroup_no='{0}'", groupno); var table = DbUtils.Query(sql); return(JSONhelper.FormatJSONForEasyuiDataGrid(table.Rows.Count, table)); } else { return(JSONhelper.FormatJSONForEasyuiDataGrid(0, null)); } }
public string JsonDataForEasyUIdataGrid(int pageindex, int pagesize, string filterJSON) { var pcp = new ProcCustomPage("V_logs") { PageIndex = pageindex, PageSize = pagesize, OrderFields = "keyid desc", WhereString = FilterTranslator.ToSql(filterJSON) }; int recordCount; DataTable dt = base.GetPageWithSp(pcp, out recordCount); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
public string SRCData(string itemid = null, string ICPRBILLNO = null, string FICPRENTRYID = null, string FSTOCK = null) { List <object> list = new List <object>(); List <string> srcnumbers = new List <string>(); var srclist = SRCDal.Instance.GetWhere(new { FPRODUCTID = itemid }).ToList(); foreach (var model in srclist) { srcnumbers.Add(model.FSRCCODE); } int pagecount = 0; APIService.APIServiceClient api = new APIService.APIServiceClient(); DataTable table = api.WmStock(out pagecount, string.Join(",", srcnumbers.ToArray()), "", FSTOCK, "", "", "", "", "", 1000, 1, true, false); foreach (var model in srclist) { var query = table.AsEnumerable().Where <DataRow>(m => m["FNumber"].ToString() == model.FSRCCODE); foreach (var row in query) { list.Add(new { FID = model.FID, FPRODUCTID = model.FPRODUCTID, FSRCNAME = model.FSRCNAME, FSRCCODE = model.FSRCCODE, FSRCMODEL = model.FSRCMODEL, FSRCUNIT = model.FUNIT, FORDERUNIT = model.FORDERUNIT, FRATE = model.FRATE, FBATCHNO = row["FBatchNo"], FCOLORNO = row["FColorNo"], FSTOCK = row["FStockName"], FSTOCKPLACE = row["FSPName"], FQTY = row["FBasicQty"], FLEVEL = row["FGrade"], FWDR = row["FWDRID"], FCOMMITQTY = System.DBNull.Value, FHNAMOUNT = 0, ICPRBILLNO = ICPRBILLNO, FICPRENTRYID = FICPRENTRYID, FREMARK = "" }); } } return(JSONhelper.FormatJSONForEasyuiDataGrid(list.Count, list)); }
public string JsonDataForEasyUIdataGrid(int pageindex, int pagesize, string filterJson, string sort = "FID", string order = "asc") { string sortorder = sort + " " + order; var pcp = new ProcCustomPage("sys_buttons") { IDX_PAGE_IN = pageindex, CURR_PAGE_COUNT_IN = pagesize, SQL_ORDERBY_IN = sortorder, SQL_WHERE_IN = FilterTranslator.ToSql(filterJson) }; int recordCount; DataTable dt = base.GetPageWithSp(pcp, out recordCount); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
/// <summary> /// 得到主表单分页列表 /// </summary> /// <param name="ctx"></param> public void GetMainUserControlByPage(HttpContext ctx) { string where = ""; string filters = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("filter")); if (filters != "") { where = FilterTranslator.ToSql(filters); } var pageParam = new PageParam(ctx); int recordCount; var dt = RDIFrameworkService.Instance.WorkFlowUserControlService.GetMainUserControlByPage(Utils.UserInfo, where, out recordCount, pageParam.PageIndex, pageParam.PageSize); var json = JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt); ctx.Response.Write(json); }
public string JsonDataForEasyUIdataGrid(int pageindex, int pagesize, string filterJson, string sort = "keyid", string order = "asc") { string sortorder = sort + " " + order; var pcp = new ProcCustomPage("sys_roles") { PageIndex = pageindex, PageSize = pagesize, OrderFields = sortorder, WhereString = FilterTranslator.ToSql(filterJson) }; int recordCount; DataTable dt = base.GetPageWithSp(pcp, out recordCount); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
private void GetDataList(HttpContext context) { string json = "[]"; var pageParam = new PageParam(context); var recordCount = 0; var dtException = RDIFrameworkService.Instance.ExceptionService.GetDTByPage(Utils.UserInfo, out recordCount, pageParam.PageIndex, pageParam.PageSize, pageParam.Filter, (pageParam.SortField + " " + pageParam.Order)); if (dtException != null && dtException.Rows.Count > 0) { json = JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dtException); context.Response.Write(json); } else { context.Response.Write(json); } }
public string JsonDataForEasyUIdataGrid(int pageindex, int pagesize, string filterJson, string sort = "FID", string order = "asc") { string sortorder = sort + " " + order; var pcp = new ProcCustomPage(GetTableName()) { IDX_PAGE_IN = pageindex, CURR_PAGE_COUNT_IN = pagesize, SQL_ORDERBY_IN = sortorder.Trim(), SQL_WHERE_IN = string.Format("({0})", filterJson.IsNullOrEmpty() ? " 1=1 " : filterJson), }; // LogHelper.WriteLog("where: "+pcp.SQL_WHERE_IN); int recordCount; //DataTable dt = GetPageWithSp(pcp, out recordCount); IEnumerable <T> list = GetList <T>(GetPageWithSp(pcp, out recordCount)); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, list)); }
public string JsonDataForEasyUIdataGrid(string tablename, int pageindex, int pagesize, string filterJson, string sort = "FID", string order = "asc") { string sortorder = sort + " " + order; var pcp = new ProcCustomPage(tablename) { IDX_PAGE_IN = pageindex, CURR_PAGE_COUNT_IN = pagesize, SQL_ORDERBY_IN = sortorder.Trim(), SQL_WHERE_IN = FilterTranslator.ToSql(filterJson) }; // LogHelper.WriteLog("where: "+pcp.SQL_WHERE_IN); int recordCount; //DataTable dt = GetPageWithSp(pcp, out recordCount); IEnumerable <T> list = GetList <T>(GetPageWithSp(pcp, out recordCount)); return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, list)); }
/// <summary> /// 以组织机构主键得到用户分页数据 /// </summary> /// <param name="context">HTTP请求</param> private void GetUserPageDTByDepartmentId(HttpContext context) { var organizeId = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("organizeId")); var where = PublicMethod.GetString(WebCommon.StringHelper.GetRequestObject("searchValue")); if (where != "") { where = HttpUtility.UrlDecode(where); } var pageParam = new PageParam(context); var json = "[]"; if (!string.IsNullOrEmpty(organizeId)) { int recordCount; var dtUser = RDIFrameworkService.Instance.UserService.GetUserPageDTByDepartment(Utils.UserInfo, PermissionItemScopeCode, where, null, string.Empty, null, true, true, out recordCount, pageParam.PageIndex, pageParam.PageSize, PiUserTable.FieldSortCode, organizeId); json = JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dtUser); } context.Response.Write(json); }
public string GetJsonData(int pageindex, int pagesize, string filterJson, string sort, string order) { var pcp = new ProcCustomPage("v_user") { IDX_PAGE_IN = pageindex, CURR_PAGE_COUNT_IN = pagesize, SQL_ORDERBY_IN = (sort + " " + order).Trim(), SQL_WHERE_IN = FilterTranslator.ToSql(filterJson) }; //var users = UserDal.Instance.GetAll(); int recordCount; if (pcp.SQL_WHERE_IN == "()") { pcp.SQL_WHERE_IN = ""; } DataTable dt = UserDal.Instance.GetPageWithSp(pcp, out recordCount); dt.Columns.Add(new DataColumn("depname")); dt.Columns.Add(new DataColumn("Departments")); //可以访问的部门数据 //var departments = DepartmentDal.Instance.GetAll().ToList(); //foreach (DataRow row in dt.Rows) //{ // var row1 = row; // var dep = departments.Where(n => row1 != null && n.FID == PublicMethod.GetString(row1["departmentid"])); // var enumerable = dep as Department[] ?? dep.ToArray(); // if (enumerable.Any()) // row["depname"] = enumerable.First().DepartmentName; // else // { // row["depname"] = ""; // } // var userList = users as IList<User> ?? users.ToList(); // row["Departments"] = userList.First(n => n.FID == PublicMethod.GetString(row["FID"])).Departments; //} return(JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dt)); }
public string ImportData(string startdate, string enddate) { if (string.IsNullOrEmpty(startdate) && string.IsNullOrEmpty(enddate)) { return(""); } else { DataTable table = ReportDAL.Instance.GetSettlementData(startdate, enddate); table.Columns.Add(new DataColumn("FPOLICY_PRICE_NO", typeof(string))); table.Columns.Add(new DataColumn("FPOLICY_PRICE", typeof(decimal))); table.Columns.Add(new DataColumn("FCOST_RULES", typeof(string))); foreach (DataRow row in table.Rows) { if (!string.IsNullOrEmpty(row["FPRODUCTID"].ToStr())) { var policys = TB_PRICEPOLICYDal.Instance.GetWhere(new { FCLIENTACCOUNT = row["CUSTOMER_NO"], FPRODUCTNUMBER = row["FPRODUCTID"], FBATCHES_STATUS = "Y" }).ToList(); if (policys.Count() > 0) { row["FPOLICY_PRICE_NO"] = policys[0].FPRICENUMBER; row["FPOLICY_PRICE"] = policys[0].FAUDITPRICE; } } if (!string.IsNullOrEmpty(row["FCODE"].ToStr())) { var cost = TB_UNLOADING_COSTDal.Instance.GetWhere(new { FARRIVAL_ADDR_BP = row["FCODE"], FPRINTMSG = row["WAREHOUSE"], FTRANSPORTTPE = 1 }).ToList(); if (cost.Count() > 0) { row["FCOST_RULES"] = cost[0].FCOST_RULES; } } } return(JSONhelper.FormatJSONForEasyuiDataGrid(table.Rows.Count, table)); } }
private string GetProductMultiPage(HttpContext context) { var returnJson = "[]"; var managerMain = new CASE_PRODUCTIN_MAINManager(this.dbHelper, Utils.UserInfo); var pageParam = new PageParam(context); int recordCount; managerMain.CurrentTableName = @"(SELECT tab1.ID,tab1.CODE,tab1.INDATE,tab1.INTYPE,tab1.CUSTODIAN,tab1.CREATEON,tab2.FULLNAME,tab2.AMOUNT,tab2.UNITPRICE FROM CASE_PRODUCTIN_MAIN tab1 INNER JOIN CASE_PRODUCTIN_DETAIL tab2 ON tab1.ID = tab2.CASE_PRODUCTIN_MAIN_ID) pageData"; managerMain.SelectField = "*"; var dtProductIn = managerMain.GetDTByPage(out recordCount, pageParam.PageIndex, pageParam.PageSize, null, "CREATEON DESC"); if (dtProductIn != null && dtProductIn.Rows.Count > 0) { returnJson = JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dtProductIn); } return(returnJson); }
private string GetProductInMainJson(HttpContext context) { var returnJson = "[]"; var managerMain = new CASE_PRODUCTIN_MAINManager(this.dbHelper, Utils.UserInfo); var where = "DELETEMARK = 0"; var pageParam = new PageParam(context); if (!string.IsNullOrEmpty(pageParam.Filter)) { where = pageParam.Filter; } int recordCount; var dtProductIn = managerMain.GetDTByPage(out recordCount, pageParam.PageIndex, pageParam.PageSize, where, pageParam.SortField + " " + pageParam.Order); //RDIFrameworkService.Instance.RDIFrameworkDBProviderService.Fill(Utils.UserInfo, sql); if (dtProductIn != null && dtProductIn.Rows.Count > 0) { returnJson = JSONhelper.FormatJSONForEasyuiDataGrid(recordCount, dtProductIn); } return(returnJson); }