Example #1
0
 public object Get(JObject req)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.Database.Connection.Open();
         try {
             var cmd = db.Database.Connection.CreateCommand();
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "proc_SearchList";
             cmd.Parameters.Add(new SqlParameter("@tableName", "KZ_cpfbmx"));
             cmd.Parameters.Add(new SqlParameter("@fieldNames", "KZ_cpfbmx.省份 AS 省份,KZ_cpfbmx.城市 AS 城市,KZ_cpfbmx.终端类型 AS 终端类型,KZ_cpfbmx.客户名称 AS 客户名称,KZ_cpfbmx.库存量 AS 库存量,KZ_cpfbmx.产品 AS 产品,KZ_cpfbmx.规格 AS 规格"));
             cmd.Parameters.Add(new SqlParameter("@fieldSort", "省份"));
             var sbCondition = new StringBuilder();
             sbCondition.Append(string.Format("{0}{1}{2}{3}{4}", "((CompCode='", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "') or ('", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).UserCode, "'='super'))"));
             sbCondition.Append(" AND ");
             SerachCondition.TextBox(sbCondition, "省份", "省份", "varchar");
             SerachCondition.TextBox(sbCondition, "城市", "城市", "varchar");
             SerachCondition.Dropdown(sbCondition, "终端类型", "终端类型", "varchar");
             SerachCondition.TextBox(sbCondition, "产品", "产品", "varchar");
             if (sbCondition.Length > 5)
             {
                 sbCondition.Length -= 5;
                 cmd.Parameters.Add(new SqlParameter("@condition", sbCondition.ToString()));
             }
             if (HttpContext.Current.Request.Get("_report_") == "1")
             {
                 // 报表请求条件合成
                 return(sbCondition.ToString());
             }
             SqlParameter rowTotalParameter = null;
             int          rowTotal          = 0;
             int.TryParse(HttpContext.Current.Request.Get("total"), out rowTotal);
             var rq = new PageRequest();
             if (rq.Page.HasValue)
             {
                 var pageSize = rq.Rows.HasValue ? rq.Rows.Value : 20;
                 var rowStart = (rq.Page.Value - 1) * pageSize + 1;
                 var rowEnd   = rq.Page.Value * pageSize;
                 cmd.Parameters.Add(new SqlParameter("@rowStart", rowStart));
                 cmd.Parameters.Add(new SqlParameter("@rowEnd", rowEnd));
                 if (rowStart == 1)
                 {
                     cmd.Parameters.Add(rowTotalParameter = new SqlParameter("@rowTotal", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, true, 0, 0, null, System.Data.DataRowVersion.Default, 0));
                 }
             }
             string jsonArrayString = null;
             using (var reader = cmd.ExecuteReader())
             {
                 jsonArrayString = reader.ToJsonArrayString();
             }
             if (rowTotalParameter != null)
             {
                 rowTotal = (int)rowTotalParameter.Value;
             }
             return(JObject.Parse("{rows:" + jsonArrayString + ", total:" + rowTotal + "}"));
         } finally {
             db.Database.Connection.Close();
         }
     }
 }
Example #2
0
 public object Get(JObject req)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.Database.Connection.Open();
         try {
             var cmd = db.Database.Connection.CreateCommand();
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "proc_SearchList";
             cmd.Parameters.Add(new SqlParameter("@tableName", "kz_kqjl"));
             cmd.Parameters.Add(new SqlParameter("@fieldNames", "kz_kqjl.月份 AS 月份,kz_kqjl.OrganizeName AS OrganizeName,kz_kqjl.用户编号 AS 用户编号,kz_kqjl.用户名 AS 用户名,kz_kqjl.Ktype AS Ktype,kz_kqjl.一号 AS 一号,kz_kqjl.二号 AS 二号,kz_kqjl.三号 AS 三号,kz_kqjl.四号 AS 四号,kz_kqjl.五号 AS 五号,kz_kqjl.六号 AS 六号,kz_kqjl.七号 AS 七号,kz_kqjl.八号 AS 八号,kz_kqjl.九号 AS 九号,kz_kqjl.十号 AS 十号,kz_kqjl.十一号 AS 十一号,kz_kqjl.十二号 AS 十二号,kz_kqjl.十三号 AS 十三号,kz_kqjl.十四号 AS 十四号,kz_kqjl.十五号 AS 十五号,kz_kqjl.十六号 AS 十六号,kz_kqjl.十七号 AS 十七号,kz_kqjl.十八号 AS 十八号,kz_kqjl.十九号 AS 十九号,kz_kqjl.二十号 AS 二十号,kz_kqjl.二十一号 AS 二十一号,kz_kqjl.二十二号 AS 二十二号,kz_kqjl.二十三号 AS 二十三号,kz_kqjl.二十四号 AS 二十四号,kz_kqjl.二十五号 AS 二十五号,kz_kqjl.二十六号 AS 二十六号,kz_kqjl.二十七号 AS 二十七号,kz_kqjl.二十八号 AS 二十八号,kz_kqjl.二十九号 AS 二十九号,kz_kqjl.三十号 AS 三十号,kz_kqjl.三十一号 AS 三十一号"));
             cmd.Parameters.Add(new SqlParameter("@fieldSort", "用户名,Ktype"));
             var sbCondition = new StringBuilder();
             sbCondition.Append(string.Format("{0}{1}{2}{3}{4}{5}{6}", "((用户编号 IN (SELECT UserCode FROM dbo.sys_user WHERE OrganizeName LIKE '", System.Web.HttpContext.Current.Session["OrganizeName"], "%')AND 所属公司='", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "') or ('", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).UserCode, "'='super'))"));
             sbCondition.Append(" AND ");
             SerachCondition.TextBox(sbCondition, "月份", "月份", "");
             SerachCondition.TextBox(sbCondition, "OrganizeName", "OrganizeName", "");
             SerachCondition.TextBox(sbCondition, "用户编号", "用户编号", "");
             SerachCondition.TextBox(sbCondition, "用户名", "用户名", "");
             if (sbCondition.Length > 5)
             {
                 sbCondition.Length -= 5;
                 cmd.Parameters.Add(new SqlParameter("@condition", sbCondition.ToString()));
             }
             if (HttpContext.Current.Request.Get("_report_") == "1")
             {
                 // 报表请求条件合成
                 return(sbCondition.ToString());
             }
             SqlParameter rowTotalParameter = null;
             int          rowTotal          = 0;
             int.TryParse(HttpContext.Current.Request.Get("total"), out rowTotal);
             var rq = new PageRequest();
             if (rq.Page.HasValue)
             {
                 var pageSize = rq.Rows.HasValue ? rq.Rows.Value : 20;
                 var rowStart = (rq.Page.Value - 1) * pageSize + 1;
                 var rowEnd   = rq.Page.Value * pageSize;
                 cmd.Parameters.Add(new SqlParameter("@rowStart", rowStart));
                 cmd.Parameters.Add(new SqlParameter("@rowEnd", rowEnd));
                 if (rowStart == 1)
                 {
                     cmd.Parameters.Add(rowTotalParameter = new SqlParameter("@rowTotal", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, true, 0, 0, null, System.Data.DataRowVersion.Default, 0));
                 }
             }
             string jsonArrayString = null;
             using (var reader = cmd.ExecuteReader())
             {
                 jsonArrayString = reader.ToJsonArrayString();
             }
             if (rowTotalParameter != null)
             {
                 rowTotal = (int)rowTotalParameter.Value;
             }
             return(JObject.Parse("{rows:" + jsonArrayString + ", total:" + rowTotal + "}"));
         } finally {
             db.Database.Connection.Close();
         }
     }
 }
Example #3
0
 public object Get(JObject req)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.Database.Connection.Open();
         try {
             var cmd = db.Database.Connection.CreateCommand();
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "proc_SearchList";
             cmd.Parameters.Add(new SqlParameter("@tableName", "zdwdxl"));
             cmd.Parameters.Add(new SqlParameter("@fieldNames", "zdwdxl.终端编号 AS 终端编号,zdwdxl.终端名称 AS 终端名称,zdwdxl.联系人 AS 联系人,zdwdxl.联系电话 AS 联系电话,zdwdxl.联系手机 AS 联系手机,zdwdxl.地址 AS 地址,zdwdxl.老板名 AS 老板名,zdwdxl.老板电话 AS 老板电话,zdwdxl.老板手机 AS 老板手机,zdwdxl.终端类型 AS 终端类型,zdwdxl.结算方式 AS 结算方式,zdwdxl.商超营业面积 AS 商超营业面积,zdwdxl.采购方式 AS 采购方式,zdwdxl.上座率 AS 上座率,zdwdxl.平均消费 AS 平均消费,zdwdxl.进店类型 AS 进店类型,zdwdxl.包间数 AS 包间数,zdwdxl.流通营业面积 AS 流通营业面积,zdwdxl.门面数 AS 门面数,zdwdxl.酒水容量 AS 酒水容量,zdwdxl.团购金额 AS 团购金额,zdwdxl.业务员编号 AS 业务员编号,zdwdxl.业务员名称 AS 业务员名称"));
             cmd.Parameters.Add(new SqlParameter("@fieldSort", "zdwdxl.终端编号"));
             var sbCondition = new StringBuilder();
             sbCondition.Append(string.Format("{0}{1}{2}{3}{4}{5}{6}", "((业务员编号 IN (SELECT UserCode FROM dbo.sys_user WHERE OrganizeName LIKE '", System.Web.HttpContext.Current.Session["OrganizeName"], "%')AND 所属公司='", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "') or ('", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).UserCode, "'='super'))"));
             sbCondition.Append(" AND ");
             SerachCondition.TextBox(sbCondition, "终端名称", "终端名称", "");
             SerachCondition.TextBox(sbCondition, "联系人", "联系人", "");
             SerachCondition.TextBox(sbCondition, "联系手机", "联系手机", "");
             SerachCondition.Dropdown(sbCondition, "终端类型", "终端类型", "");
             if (sbCondition.Length > 5)
             {
                 sbCondition.Length -= 5;
                 cmd.Parameters.Add(new SqlParameter("@condition", sbCondition.ToString()));
             }
             if (HttpContext.Current.Request.Get("_report_") == "1")
             {
                 // 报表请求条件合成
                 return(sbCondition.ToString());
             }
             SqlParameter rowTotalParameter = null;
             int          rowTotal          = 0;
             int.TryParse(HttpContext.Current.Request.Get("total"), out rowTotal);
             var rq = new PageRequest();
             if (rq.Page.HasValue)
             {
                 var pageSize = rq.Rows.HasValue ? rq.Rows.Value : 20;
                 var rowStart = (rq.Page.Value - 1) * pageSize + 1;
                 var rowEnd   = rq.Page.Value * pageSize;
                 cmd.Parameters.Add(new SqlParameter("@rowStart", rowStart));
                 cmd.Parameters.Add(new SqlParameter("@rowEnd", rowEnd));
                 if (rowStart == 1)
                 {
                     cmd.Parameters.Add(rowTotalParameter = new SqlParameter("@rowTotal", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, true, 0, 0, null, System.Data.DataRowVersion.Default, 0));
                 }
             }
             string jsonArrayString = null;
             using (var reader = cmd.ExecuteReader())
             {
                 jsonArrayString = reader.ToJsonArrayString();
             }
             if (rowTotalParameter != null)
             {
                 rowTotal = (int)rowTotalParameter.Value;
             }
             return(JObject.Parse("{rows:" + jsonArrayString + ", total:" + rowTotal + "}"));
         } finally {
             db.Database.Connection.Close();
         }
     }
 }
Example #4
0
 public object Get(JObject req)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.Database.Connection.Open();
         try {
             var cmd = db.Database.Connection.CreateCommand();
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "proc_SearchList";
             cmd.Parameters.Add(new SqlParameter("@tableName", "wq_goodsreport GD LEFT JOIN  wq_termPop PO ON  GD.DealerCode=PO.PopCode"));
             cmd.Parameters.Add(new SqlParameter("@fieldNames", "PO.PopName AS PopName,PO.Address AS Address,GD.RPdtCode AS RPdtCode,GD.PrmDate AS PrmDate,GD.Remark AS Remark,GD.No AS No"));
             cmd.Parameters.Add(new SqlParameter("@fieldSort", "GD.PrmDate"));
             var sbCondition = new StringBuilder();
             sbCondition.Append(string.Format("{0}{1}{2}{3}{4}{5}{6}", "((GD.UserCode IN (SELECT UserCode FROM dbo.sys_user WHERE OrganizeName LIKE '", System.Web.HttpContext.Current.Session["OrganizeName"], "%') AND GD.CompCode='", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "') or ('", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).UserCode, "'='super ' ))"));
             sbCondition.Append(" AND ");
             SerachCondition.TextBox(sbCondition, "PopName", "PopName", "varchar");
             SerachCondition.TextBox(sbCondition, "Address", "Address", "varchar");
             SerachCondition.TextBox(sbCondition, "RPdtCode", "RPdtCode", "varchar");
             SerachCondition.Date(sbCondition, "PrmDate", "PrmDate", "varchar");
             if (sbCondition.Length > 5)
             {
                 sbCondition.Length -= 5;
                 cmd.Parameters.Add(new SqlParameter("@condition", sbCondition.ToString()));
             }
             if (HttpContext.Current.Request.Get("_report_") == "1")
             {
                 // 报表请求条件合成
                 return(sbCondition.ToString());
             }
             SqlParameter rowTotalParameter = null;
             int          rowTotal          = 0;
             int.TryParse(HttpContext.Current.Request.Get("total"), out rowTotal);
             var rq = new PageRequest();
             if (rq.Page.HasValue)
             {
                 var pageSize = rq.Rows.HasValue ? rq.Rows.Value : 20;
                 var rowStart = (rq.Page.Value - 1) * pageSize + 1;
                 var rowEnd   = rq.Page.Value * pageSize;
                 cmd.Parameters.Add(new SqlParameter("@rowStart", rowStart));
                 cmd.Parameters.Add(new SqlParameter("@rowEnd", rowEnd));
                 if (rowStart == 1)
                 {
                     cmd.Parameters.Add(rowTotalParameter = new SqlParameter("@rowTotal", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, true, 0, 0, null, System.Data.DataRowVersion.Default, 0));
                 }
             }
             string jsonArrayString = null;
             using (var reader = cmd.ExecuteReader())
             {
                 jsonArrayString = reader.ToJsonArrayString();
             }
             if (rowTotalParameter != null)
             {
                 rowTotal = (int)rowTotalParameter.Value;
             }
             return(JObject.Parse("{rows:" + jsonArrayString + ", total:" + rowTotal + "}"));
         } finally {
             db.Database.Connection.Close();
         }
     }
 }
 public object Get(JObject req)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.Database.Connection.Open();
         try {
             var cmd = db.Database.Connection.CreateCommand();
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "proc_SearchList";
             cmd.Parameters.Add(new SqlParameter("@tableName", "HR_SocialSecRecords"));
             cmd.Parameters.Add(new SqlParameter("@fieldNames", "HR_SocialSecRecords.FYear AS FYear,HR_SocialSecRecords.FMonth AS FMonth,HR_SocialSecRecords.empCode AS empCode,HR_SocialSecRecords.SSType AS SSType,HR_SocialSecRecords.SSAmt AS SSAmt,HR_SocialSecRecords.indvPension AS indvPension,HR_SocialSecRecords.indvMedical AS indvMedical,HR_SocialSecRecords.indvUnemploy AS indvUnemploy,HR_SocialSecRecords.corpPension AS corpPension,HR_SocialSecRecords.corpBaseMedical AS corpBaseMedical,HR_SocialSecRecords.corpLocalMedical AS corpLocalMedical,HR_SocialSecRecords.corpUnemploy AS corpUnemploy,HR_SocialSecRecords.corpInjury AS corpInjury,HR_SocialSecRecords.corpBirth AS corpBirth,HR_SocialSecRecords.indvTotal AS indvTotal,HR_SocialSecRecords.corpTotal AS corpTotal,HR_SocialSecRecords.Total AS Total,HR_SocialSecRecords.Remark AS Remark"));
             cmd.Parameters.Add(new SqlParameter("@fieldSort", "FMonth,FYear desc"));
             var sbCondition = new StringBuilder();
             SerachCondition.TextBox(sbCondition, "FYear", "FYear", "");
             SerachCondition.TextBox(sbCondition, "FMonth", "FMonth", "");
             SerachCondition.PopupSelect(sbCondition, "empCode", "empCode", "");
             SerachCondition.Dropdown(sbCondition, "SSType", "SSType", "");
             if (sbCondition.Length > 5)
             {
                 sbCondition.Length -= 5;
                 cmd.Parameters.Add(new SqlParameter("@condition", sbCondition.ToString()));
             }
             if (HttpContext.Current.Request.Get("_report_") == "1")
             {
                 // 报表请求条件合成
                 return(sbCondition.ToString());
             }
             SqlParameter rowTotalParameter = null;
             int          rowTotal          = 0;
             int.TryParse(HttpContext.Current.Request.Get("total"), out rowTotal);
             var rq = new PageRequest();
             if (rq.Page.HasValue)
             {
                 var pageSize = rq.Rows.HasValue ? rq.Rows.Value : 20;
                 var rowStart = (rq.Page.Value - 1) * pageSize + 1;
                 var rowEnd   = rq.Page.Value * pageSize;
                 cmd.Parameters.Add(new SqlParameter("@rowStart", rowStart));
                 cmd.Parameters.Add(new SqlParameter("@rowEnd", rowEnd));
                 if (rowStart == 1)
                 {
                     cmd.Parameters.Add(rowTotalParameter = new SqlParameter("@rowTotal", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, true, 0, 0, null, System.Data.DataRowVersion.Default, 0));
                 }
             }
             string jsonArrayString = null;
             using (var reader = cmd.ExecuteReader())
             {
                 jsonArrayString = reader.ToJsonArrayString();
             }
             if (rowTotalParameter != null)
             {
                 rowTotal = (int)rowTotalParameter.Value;
             }
             return(JObject.Parse("{rows:" + jsonArrayString + ", total:" + rowTotal + "}"));
         } finally {
             db.Database.Connection.Close();
         }
     }
 }
Example #6
0
 public object Get(JObject req)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.Database.Connection.Open();
         try {
             var cmd = db.Database.Connection.CreateCommand();
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "proc_SearchList";
             cmd.Parameters.Add(new SqlParameter("@tableName", "Rinout_hist"));
             cmd.Parameters.Add(new SqlParameter("@fieldNames", "Rinout_hist.会员手机 AS 会员手机,Rinout_hist.公司名 AS 公司名,Rinout_hist.订单号 AS 订单号,Rinout_hist.操作名称 AS 操作名称,Rinout_hist.冻结变化 AS 冻结变化,Rinout_hist.余额变化 AS 余额变化,Rinout_hist.最后冻结 AS 最后冻结,Rinout_hist.最后余额 AS 最后余额,Rinout_hist.日期 AS 日期"));
             cmd.Parameters.Add(new SqlParameter("@fieldSort", "日期"));
             var sbCondition = new StringBuilder();
             SerachCondition.TextBox(sbCondition, "会员手机", "会员手机", "");
             SerachCondition.TextBox(sbCondition, "公司名", "公司名", "");
             SerachCondition.TextBox(sbCondition, "订单号", "订单号", "");
             if (sbCondition.Length > 5)
             {
                 sbCondition.Length -= 5;
                 cmd.Parameters.Add(new SqlParameter("@condition", sbCondition.ToString()));
             }
             if (HttpContext.Current.Request.Get("_report_") == "1")
             {
                 // 报表请求条件合成
                 return(sbCondition.ToString());
             }
             SqlParameter rowTotalParameter = null;
             int          rowTotal          = 0;
             int.TryParse(HttpContext.Current.Request.Get("total"), out rowTotal);
             var rq = new PageRequest();
             if (rq.Page.HasValue)
             {
                 var pageSize = rq.Rows.HasValue ? rq.Rows.Value : 20;
                 var rowStart = (rq.Page.Value - 1) * pageSize + 1;
                 var rowEnd   = rq.Page.Value * pageSize;
                 cmd.Parameters.Add(new SqlParameter("@rowStart", rowStart));
                 cmd.Parameters.Add(new SqlParameter("@rowEnd", rowEnd));
                 if (rowStart == 1)
                 {
                     cmd.Parameters.Add(rowTotalParameter = new SqlParameter("@rowTotal", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, true, 0, 0, null, System.Data.DataRowVersion.Default, 0));
                 }
             }
             string jsonArrayString = null;
             using (var reader = cmd.ExecuteReader())
             {
                 jsonArrayString = reader.ToJsonArrayString();
             }
             if (rowTotalParameter != null)
             {
                 rowTotal = (int)rowTotalParameter.Value;
             }
             return(JObject.Parse("{rows:" + jsonArrayString + ", total:" + rowTotal + "}"));
         } finally {
             db.Database.Connection.Close();
         }
     }
 }
Example #7
0
 public object Get(JObject req)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.Database.Connection.Open();
         try {
             var cmd = db.Database.Connection.CreateCommand();
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "proc_SearchList";
             cmd.Parameters.Add(new SqlParameter("@tableName", "Settlement_Report"));
             cmd.Parameters.Add(new SqlParameter("@fieldNames", "Settlement_Report.no AS no,Settlement_Report.开票日期 AS 开票日期,Settlement_Report.开票摘要 AS 开票摘要,Settlement_Report.号码 AS 号码,Settlement_Report.价税合计 AS 价税合计,Settlement_Report.金额3 AS 金额3,Settlement_Report.金额11 AS 金额11,Settlement_Report.应收税管费 AS 应收税管费,Settlement_Report.日期 AS 日期,Settlement_Report.收付款摘要 AS 收付款摘要,Settlement_Report.收款 AS 收款,Settlement_Report.支付 AS 支付,Settlement_Report.上期结余 AS 上期结余,Settlement_Report.负责人编号 AS CustID,Settlement_Report.年 AS Dates"));
             cmd.Parameters.Add(new SqlParameter("@fieldSort", "no"));
             var sbCondition = new StringBuilder();
             SerachCondition.PopupSelect(sbCondition, "CustID", "CustID", "");
             SerachCondition.TextBox(sbCondition, "Dates", "Dates", "");
             if (sbCondition.Length > 5)
             {
                 sbCondition.Length -= 5;
                 cmd.Parameters.Add(new SqlParameter("@condition", sbCondition.ToString()));
             }
             if (HttpContext.Current.Request.Get("_report_") == "1")
             {
                 // 报表请求条件合成
                 return(sbCondition.ToString());
             }
             SqlParameter rowTotalParameter = null;
             int          rowTotal          = 0;
             int.TryParse(HttpContext.Current.Request.Get("total"), out rowTotal);
             var rq = new PageRequest();
             if (rq.Page.HasValue)
             {
                 var pageSize = rq.Rows.HasValue ? rq.Rows.Value : 20;
                 var rowStart = (rq.Page.Value - 1) * pageSize + 1;
                 var rowEnd   = rq.Page.Value * pageSize;
                 cmd.Parameters.Add(new SqlParameter("@rowStart", rowStart));
                 cmd.Parameters.Add(new SqlParameter("@rowEnd", rowEnd));
                 if (rowStart == 1)
                 {
                     cmd.Parameters.Add(rowTotalParameter = new SqlParameter("@rowTotal", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, true, 0, 0, null, System.Data.DataRowVersion.Default, 0));
                 }
             }
             string jsonArrayString = null;
             using (var reader = cmd.ExecuteReader())
             {
                 jsonArrayString = reader.ToJsonArrayString();
             }
             if (rowTotalParameter != null)
             {
                 rowTotal = (int)rowTotalParameter.Value;
             }
             return(JObject.Parse("{rows:" + jsonArrayString + ", total:" + rowTotal + "}"));
         } finally {
             db.Database.Connection.Close();
         }
     }
 }
Example #8
0
 public object Get(JObject req)
 {
     using (var db = new LUOLAI1401Context())
     {
         db.Database.Connection.Open();
         try {
             var cmd = db.Database.Connection.CreateCommand();
             cmd.CommandType = System.Data.CommandType.StoredProcedure;
             cmd.CommandText = "proc_SearchList";
             cmd.Parameters.Add(new SqlParameter("@tableName", "Distribution INNER JOIN attendTrack_v"));
             cmd.Parameters.Add(new SqlParameter("@fieldNames", "Distribution.UserCode AS UserCode,Distribution.UserName AS UserName,Distribution.CreateDate AS CreateDate,attendTrack_v.TckLong AS TckLong,attendTrack_v.TckLat AS TckLat,attendTrack_v.Address AS Address"));
             cmd.Parameters.Add(new SqlParameter("@fieldSort", "Distribution.UserCode"));
             var sbCondition = new StringBuilder();
             SerachCondition.TextBox(sbCondition, "UserCode", "UserCode", "");
             SerachCondition.TextBox(sbCondition, "UserName", "UserName", "");
             SerachCondition.Date(sbCondition, "CreateDate", "CreateDate", "");
             if (sbCondition.Length > 5)
             {
                 sbCondition.Length -= 5;
                 cmd.Parameters.Add(new SqlParameter("@condition", sbCondition.ToString()));
             }
             SqlParameter rowTotalParameter = null;
             int          rowTotal          = 0;
             int.TryParse(HttpContext.Current.Request.Get("total"), out rowTotal);
             var rq = new PageRequest();
             if (rq.Page.HasValue)
             {
                 var pageSize = rq.Rows.HasValue ? rq.Rows.Value : 20;
                 var rowStart = (rq.Page.Value - 1) * pageSize + 1;
                 var rowEnd   = rq.Page.Value * pageSize;
                 cmd.Parameters.Add(new SqlParameter("@rowStart", rowStart));
                 cmd.Parameters.Add(new SqlParameter("@rowEnd", rowEnd));
                 if (rowStart == 1)
                 {
                     cmd.Parameters.Add(rowTotalParameter = new SqlParameter("@rowTotal", System.Data.SqlDbType.Int, 8, System.Data.ParameterDirection.Output, true, 0, 0, null, System.Data.DataRowVersion.Default, 0));
                 }
             }
             string jsonArrayString = null;
             using (var reader = cmd.ExecuteReader())
             {
                 jsonArrayString = reader.ToJsonArrayString();
             }
             if (rowTotalParameter != null)
             {
                 rowTotal = (int)rowTotalParameter.Value;
             }
             return(JObject.Parse("{rows:" + jsonArrayString + ", total:" + rowTotal + "}"));
         } finally {
             db.Database.Connection.Close();
         }
     }
 }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "helptitle", "a.helptitle", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_helpinfoListModel>(db.Database, "a.helpid ,a.helptitle ,b.Text isenabled_RefText ,a.isenabled ,a.CreateDate ,a.CreatePerson ,a.UpdateDate ,a.UpdatePerson ", "fw_helpinfo a LEFT JOIN [SYS_YLW].dbo.sys_code b ON a.isenabled = b.Value AND (b.CodeType='YN') ", sbCondition.ToString(), "a.helpid", "desc"));
            }
        }
Example #10
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.Dropdown(sbCondition, "Corp", "a.Corp", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <FA_InvoicesListModel>(db.Database, "a.InvoicesID ,a.invoiceCode ,b.Text Corp_RefText ,a.Corp ,c.Contact CustID_RefText ,a.CustID ,d.Code PID_RefText ,a.PID ,a.FDate ,a.Amt ,a.invoiceTitle ,a.taxNumber ,e.Text taxType_RefText ,a.taxType ,f.Remarks invoiceType_RefText ,a.invoiceType ,a.invoiceContent ,a.Remark ", "FA_Invoices a LEFT JOIN [Bcp.Sysy].dbo.sys_code b ON a.Corp = b.Value AND (b.CodeType='HtCorp') LEFT JOIN BD_Customers c ON a.CustID = c.FID LEFT JOIN PM_Contracts d ON a.PID = d.Code LEFT JOIN [Bcp.Sysy].dbo.sys_code e ON a.taxType = e.Value AND (e.CodeType='taxType') LEFT JOIN HR_NewInvoices f ON a.invoiceType = f.FID ", sbCondition.ToString(), "a.InvoicesID", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.Date(sbCondition, "caldate", "a.caldate", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_calendarinfoListModel>(db.Database, "a.calcode ,a.caldate ,a.starttime ,a.endtime ", "fw_calendarinfo a ", sbCondition.ToString(), "a.calcode", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.Dropdown(sbCondition, "Corp", "a.Corp", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <FA_InvAcceptsListModel>(db.Database, "a.FID ,b.Text Corp_RefText ,a.Corp ,c.Contact CustID_RefText ,a.CustID ,a.PID ,a.Fdate ,a.Amt ,a.invoiceTitle ,d.Remarks invoiceType_RefText ,a.invoiceType ,a.Remark ,a.CreatePerson ,a.CreateDate ,a.UpdateDate ", "FA_InvAccepts a LEFT JOIN [Bcp.Sysy].dbo.sys_code b ON a.Corp = b.Value AND (b.CodeType='HtCorp') LEFT JOIN BD_Customers c ON a.CustID = c.FID LEFT JOIN HR_NewInvoices d ON a.invoiceType = d.FID ", sbCondition.ToString(), "a.FID", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "title", "a.title", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_slideinfoListModel>(db.Database, "a.id ,a.title ,a.clickcounts ", "fw_slideinfo a ", sbCondition.ToString(), "a.id", "desc"));
            }
        }
Example #14
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.PopupSelect(sbCondition, "empID", "a.empID", "");
            SerachCondition.Dropdown(sbCondition, "HFType", "a.HFType", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <HR_WageSetsListModel>(db.Database, "a.FID ,b.empID empID_RefText ,a.empID ,c.Text HFType_RefText ,a.HFType ,a.SSBaseAmt ,a.HFBaseAmt ,d.Contact CustID_RefText ,a.CustID ,a.START_TIME ,a.END_TIME ,a.Remark ,a.CreatePerson ,a.CreateDate ,a.UpdateDate ", "HR_WageSets a LEFT JOIN HR_PractiseCerts b ON a.empID = b.FID LEFT JOIN [Bcp.Sysy].dbo.sys_code c ON a.HFType = c.Value AND (c.CodeType='FType') LEFT JOIN BD_Customers d ON a.CustID = d.FID ", sbCondition.ToString(), "a.FID", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.Dropdown(sbCondition, "frommodule", "a.frommodule", "");
            SerachCondition.Dropdown(sbCondition, "memid", "a.memid", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_recordinfoListModel>(db.Database, "a.Id ,a.fromid ,b.Text frommodule_RefText ,a.frommodule ,a.price ,a.counts ,c.realname memid_RefText ,a.memid ", "fw_recordinfo a LEFT JOIN [SYS_YLW].dbo.sys_code b ON a.frommodule = b.Value AND (b.CodeType='SourceModule') LEFT JOIN fw_memberinfo c ON a.memid = c.memid ", sbCondition.ToString(), "a.Id", "desc"));
            }
        }
Example #16
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            sbCondition.AppendFormat("({0}) AND ", string.Format("{0}{1}{2}{3}{4}", "((a.id='", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "') or ('", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).UserCode, "'='super'))"));
            SerachCondition.TextBox(sbCondition, "RoleName", "a.RoleName", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <sys_roletListModel>(db.Database, "a.RoleCode ,a.RoleName ,a.Description ", "sys_rolet a ", sbCondition.ToString(), "RoleCode", "desc"));
            }
        }
Example #17
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.Dropdown(sbCondition, "MemId", "a.MemId", "");
            SerachCondition.TextBox(sbCondition, "orderid", "a.orderid", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_ObjectionResultListModel>(db.Database, "a.objectionid ,b.corpname MemId_RefText ,a.MemId ,a.orderid ,c.Text IsContinue_RefText ,a.IsContinue ,d.corpname paymemId_RefText ,a.paymemId ,a.payment ,e.Text paymentmode_RefText ,a.paymentmode ,a.paymentendtime ,f.Text resultstatus_RefText ,a.resultstatus ,a.explain ,a.resultperson ,a.resultphone ,a.finalresult ", "fw_ObjectionResult a LEFT JOIN v_MemberAll b ON a.MemId = b.memid LEFT JOIN [SYS_YLW].dbo.sys_code c ON a.IsContinue = c.Value AND (c.CodeType='YN') LEFT JOIN v_MemberAll d ON a.paymemId = d.memid LEFT JOIN [SYS_YLW].dbo.sys_code e ON a.paymentmode = e.Value AND (e.CodeType='PayKind') LEFT JOIN [SYS_YLW].dbo.sys_code f ON a.resultstatus = f.Value AND (f.CodeType='ObjState') ", sbCondition.ToString(), "a.objectionid", "desc"));
            }
        }
Example #18
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "newstitle", "a.newstitle", "");
            SerachCondition.Dropdown(sbCondition, "userid", "a.userid", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_newsinfoListModel>(db.Database, "a.newsid ,a.newstitle ,a.category ,a.clicks ,b.Text isslide_RefText ,a.isslide ,c.UserName userid_RefText ,a.userid ,a.pubtime ", "fw_newsinfo a LEFT JOIN [SYS_YLW].dbo.sys_code b ON a.isslide = b.Value AND (b.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_user c ON a.userid = c.UserCode ", sbCondition.ToString(), "a.newsid", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.Date(sbCondition, "BeginDate", "a.BeginDate", "");
            SerachCondition.Date(sbCondition, "EndDate", "a.EndDate", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <PM_ContractFilesListModel>(db.Database, "a.FID ,a.PManager ,a.type ,a.PID ,a.Amt ,a.Owner ,a.ProjName ,a.BeginDate ,a.EndDate ,a.projAddress ", "PM_ContractFiles a ", sbCondition.ToString(), "a.FID", "desc"));
            }
        }
Example #20
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.Dropdown(sbCondition, "Corp", "a.Corp", "");
            SerachCondition.Dropdown(sbCondition, "CustID", "a.CustID", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <PrepaidTaxListModel>(db.Database, "a.FID ,a.Code ,b.Text Corp_RefText ,a.Corp ,c.Contact CustID_RefText ,a.CustID ,d.invoiceTitle Invoice_RefText ,a.Invoice ,a.Amt ,a.DeductibleAmt ,a.ReceiptDate ,a.InvoicesRise ", "PrepaidTax a LEFT JOIN [Bcp.Sysy].dbo.sys_code b ON a.Corp = b.Value AND (b.CodeType='HtCorp') LEFT JOIN BD_Customers c ON a.CustID = c.FID LEFT JOIN FA_Invoices d ON a.Invoice = d.invoiceCode ", sbCondition.ToString(), "a.FID", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "RPdtName", "a.RPdtName", "varchar");
            SerachCondition.Date(sbCondition, "CreateDate", "a.CreateDate", "datetime");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <wq_baseRptProductListModel>(db.Database, "a.RPdtCode ,a.RPdtName ,a.Description ,a.CreatePerson ,a.CreateDate ,a.UpdatePerson ,a.UpdateDate ", "wq_baseRptProduct a ", sbCondition.ToString(), "RPdtCode", "desc"));
            }
        }
Example #22
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "Contact", "a.Contact", "");
            SerachCondition.TextBox(sbCondition, "CName", "a.CName", "");
            SerachCondition.TextBox(sbCondition, "BankAcc", "a.BankAcc", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <BD_CustomersListModel>(db.Database, "a.FID ,a.Contact ,a.CName ,a.BankAcc ,a.Phone ,a.Address ,a.Remark ", "BD_Customers a ", sbCondition.ToString(), "a.FID", "desc"));
            }
        }
Example #23
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "FName", "a.FName", "");
            SerachCondition.TextBox(sbCondition, "Mobile", "a.Mobile", "");
            SerachCondition.TextBox(sbCondition, "IDCardNo", "a.IDCardNo", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <HR_EmployeesListModel>(db.Database, "a.FID ,a.Code ,a.FName ,b.Text Sex_RefText ,a.Sex ,a.Nation ,a.Mobile ,a.IDCardNo ,c.FName Department_RefText ,a.Department ,d.Text FStatus_RefText ,a.FStatus ,e.Text Type_RefText ,a.Type ,f.Contact CustID_RefText ,a.CustID ,a.Remark ,a.CreatePerson ,a.CreateDate ", "HR_Employees a LEFT JOIN [Bcp.Sysy].dbo.sys_code b ON a.Sex = b.Value AND (b.CodeType='Sex') LEFT JOIN BD_Department c ON a.Department = c.FCode LEFT JOIN [Bcp.Sysy].dbo.sys_code d ON a.FStatus = d.Value AND (d.CodeType='forstatus') LEFT JOIN [Bcp.Sysy].dbo.sys_code e ON a.Type = e.Value AND (e.CodeType='PersonType') LEFT JOIN BD_Customers f ON a.CustID = f.FID ", sbCondition.ToString(), "a.FID", "desc"));
            }
        }
Example #24
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "orderid", "a.orderid", "");
            SerachCondition.TextBox(sbCondition, "MemId", "a.MemId", "");
            SerachCondition.Dropdown(sbCondition, "isShow", "a.isShow", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_ObjectionListModel>(db.Database, "a.objectionid ,a.orderid ,a.orderprice ,b.Text Objectionstatus_RefText ,a.Objectionstatus ,c.Text otherstatus_RefText ,a.otherstatus ,a.otherprice ,d.Text IsContinue_RefText ,a.IsContinue ,a.MemId ,a.MemIdSeller ,e.Text objState_RefText ,a.objState ,f.Text isShow_RefText ,a.isShow ,a.Cimg1 ,a.Cimg2 ,a.Cimg3 ,g.Text IsAgreed_RefText ,a.IsAgreed ,h.Text IsOnJudge_RefText ,a.IsOnJudge ", "fw_Objection a LEFT JOIN [SYS_YLW].dbo.sys_code b ON a.Objectionstatus = b.Value AND (b.CodeType='HandleState') LEFT JOIN [SYS_YLW].dbo.sys_code c ON a.otherstatus = c.Value AND (c.CodeType='OtherState') LEFT JOIN [SYS_YLW].dbo.sys_code d ON a.IsContinue = d.Value AND (d.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_code e ON a.objState = e.Value AND (e.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_code f ON a.isShow = f.Value AND (f.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_code g ON a.IsAgreed = g.Value AND (g.CodeType='JJResult') LEFT JOIN [SYS_YLW].dbo.sys_code h ON a.IsOnJudge = h.Value AND (h.CodeType='YN') ", sbCondition.ToString(), "a.objectionid", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            sbCondition.AppendFormat("({0}) AND ", string.Format("{0}{1}{2}", "a.CompCode= '", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "'"));
            SerachCondition.TextBox(sbCondition, "CateName", "a.CateName", "varchar");
            SerachCondition.Date(sbCondition, "CreateDate", "a.CreateDate", "datetime");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <base_productCateListModel>(db.Database, "a.CateCode ,a.CateName ,a.DelFlag ,a.CreatePerson ,a.CreateDate ,a.UpdatePerson ,a.UpdateDate ", "base_productCate a ", sbCondition.ToString(), "CateCode", "desc"));
            }
        }
Example #26
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "proname", "a.proname", "");
            SerachCondition.Dropdown(sbCondition, "memid", "a.memid", "");
            SerachCondition.Dropdown(sbCondition, "isactive", "a.isactive", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_teambuyingListModel>(db.Database, "a.procode ,a.catid ,a.proname ,a.spec ,b.realname memid_RefText ,a.memid ,a.sellmode ,a.price ,a.GroupPrice ,a.grade ,a.minprodcount ,a.stock ,c.Text isactive_RefText ,a.isactive ,a.depositbuyer ,a.cautionAmt ,a.endtime ,a.starttime ,d.Text ispassed_RefText ,a.ispassed ,e.Text cautionFlay_RefText ,a.cautionFlay ,f.Text ispayback_RefText ,a.ispayback ,g.Text dealFlag_RefText ,a.dealFlag ,a.dealTimes ,h.Text isSuccess_RefText ,a.isSuccess ", "fw_teambuying a LEFT JOIN fw_memberinfo b ON a.memid = b.memid LEFT JOIN [SYS_YLW].dbo.sys_code c ON a.isactive = c.Value AND (c.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_code d ON a.ispassed = d.Value AND (d.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_code e ON a.cautionFlay = e.Value AND (e.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_code f ON a.ispayback = f.Value AND (f.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_code g ON a.dealFlag = g.Value AND (g.CodeType='YN') LEFT JOIN [SYS_YLW].dbo.sys_code h ON a.isSuccess = h.Value AND (h.CodeType='YN') ", sbCondition.ToString(), "a.procode", "desc"));
            }
        }
Example #27
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            sbCondition.AppendFormat("({0}) AND ", string.Format("{0}{1}{2}", "a.CompCode= '", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "'"));
            SerachCondition.TextBox(sbCondition, "StepCode", "a.StepCode", "varchar");
            SerachCondition.CheckBox(sbCondition, "StepStatus", "a.StepStatus", "varchar");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <wq_patrolStepListModel>(db.Database, "a.id ,a.StepCode ,a.StepStatus ", "wq_patrolStep a ", sbCondition.ToString(), "id", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            sbCondition.AppendFormat("({0}) AND ", string.Format("{0}{1}{2}{3}{4}", "((a.CompCode='", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "') or ('", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).UserCode, "'='super'))"));
            SerachCondition.TextBox(sbCondition, "DealerCode", "a.DealerCode", "");
            SerachCondition.TextBox(sbCondition, "Procurementmode", "a.Procurementmode", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <wq_businesscustomersListModel>(db.Database, "a.id ,a.DealerCode ,a.DealerType ,a.Businessarea ,a.Procurementmode ,a.Remark ", "wq_businesscustomers a ", sbCondition.ToString(), "id", "desc"));
            }
        }
Example #29
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.Date(sbCondition, "BorrowDate", "a.BorrowDate", "");
            SerachCondition.Dropdown(sbCondition, "CustID", "a.CustID", "");
            SerachCondition.Dropdown(sbCondition, "BorrowName", "a.BorrowName", "");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <HR_BorrowsListModel>(db.Database, "a.FID ,a.BorrowDate ,b.Text CustID_RefText ,a.CustID ,c.Name BorrowName_RefText ,a.BorrowName ,a.Used ,a.BorrowPerson ,a.BorrowPhone ,a.ReturePerson ", "HR_Borrows a LEFT JOIN [Bcp.Sysy].dbo.sys_code b ON a.CustID = b.Value AND (b.CodeType='FType') LEFT JOIN v_Certificate c ON a.BorrowName = c.FID ", sbCondition.ToString(), "a.FID", "desc"));
            }
        }
Example #30
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            sbCondition.AppendFormat("({0}) AND ", string.Format("{0}{1}{2}{3}{4}{5}{6}", "((a.UserCode IN (SELECT UserCode FROM dbo.sys_user WHERE OrganizeName LIKE '", System.Web.HttpContext.Current.Session["OrganizeName"], "%') AND a.CompCode='", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).CompCode, "') or ('", (System.Web.HttpContext.Current.Session["sys_user"] as sys_user).UserCode, "'='super ' ))"));
            SerachCondition.Date(sbCondition, "Month", "a.Month", "datetime");
            SerachCondition.PopupSelect(sbCondition, "UserCode", "a.UserCode", "varchar");

            if (sbCondition.Length > 4)
            {
                sbCondition.Length -= 4;
            }
            var pageReq = new PageRequest();

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <wq_incomeListModel>(db.Database, "a.id ,b.PopName PopCode_RefText ,a.PopCode ,a.Month ,a.IncomeAmt ,c.name UserCode_RefText ,a.UserCode ,a.Remark ", "wq_income a LEFT JOIN wq_termPop b ON a.PopCode = b.PopCode LEFT JOIN PersonInfo c ON a.UserCode = c.psncode ", sbCondition.ToString(), "id", "desc"));
            }
        }