Exemple #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", "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();
         }
     }
 }
Exemple #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", "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();
         }
     }
 }
Exemple #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", "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();
         }
     }
 }
Exemple #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", "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();
         }
     }
 }
 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();
         }
     }
 }
Exemple #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();
         }
     }
 }
Exemple #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();
         }
     }
 }
Exemple #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, "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"));
            }
        }
        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"));
            }
        }
Exemple #11
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"));
            }
        }
Exemple #12
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"));
            }
        }
Exemple #13
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"));
            }
        }
        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"));
            }
        }
        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"));
            }
        }
Exemple #16
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"));
            }
        }
Exemple #17
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"));
            }
        }
        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();

            SerachCondition.TextBox(sbCondition, "appNumber", "a.appNumber", "");
            SerachCondition.Dropdown(sbCondition, "depAmtStatus", "a.depAmtStatus", "");
            SerachCondition.TextBox(sbCondition, "PManager", "a.PManager", "");

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

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <PM_ProjectInfoBidsListModel>(db.Database, "a.Code ,a.ProjName ,b.Contact CustID_RefText ,a.CustID ,a.appNumber ,a.Owner ,a.totalInvAmt ,a.depAmt ,c.Text depAmtStatus_RefText ,a.depAmtStatus ,a.advAmt ,a.bookAmt ,a.bidAmt ,a.agencyAmt ,a.PManager ,a.bidDate ,a.bidAddress ,a.bidPerson ,a.bidAgent ,a.Attention ,a.Winner ,a.Remark ,a.CreatePerson ,a.CreateDate ,a.UpdateDate ,a.UpdatePerson ", "PM_ProjectInfoBids a LEFT JOIN BD_Customers b ON a.CustID = b.FID LEFT JOIN [Bcp.Sysy].dbo.sys_code c ON a.depAmtStatus = c.Value AND (c.CodeType='depAmt') ", sbCondition.ToString(), "a.Code", "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"));
            }
        }
Exemple #21
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"));
            }
        }
Exemple #22
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();

            SerachCondition.TextBox(sbCondition, "CID", "a.CID", "");
            SerachCondition.TextBox(sbCondition, "Department", "a.Department", "");
            SerachCondition.Dropdown(sbCondition, "TRemark", "a.TRemark", "");
            SerachCondition.Dropdown(sbCondition, "DRemark", "a.DRemark", "");

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

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <HR_CertLoansListModel>(db.Database, "a.FID ,a.CID ,a.Department ,a.GAddress ,a.ProjName ,a.Amt ,a.loanDate ,a.EndTime ,a.KAmt ,b.Text TRemark_RefText ,a.TRemark ,c.Text DRemark_RefText ,a.DRemark ,a.Scan ", "HR_CertLoans a LEFT JOIN [Bcp.Sysy].dbo.sys_code b ON a.TRemark = b.Value AND (b.CodeType='Tui') LEFT JOIN [Bcp.Sysy].dbo.sys_code c ON a.DRemark = c.Value AND (c.CodeType='yes/no') ", sbCondition.ToString(), "a.FID", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "ProName", "a.ProName", "");
            SerachCondition.Dropdown(sbCondition, "memid", "a.memid", "");
            SerachCondition.Dropdown(sbCondition, "ispassed", "a.ispassed", "");
            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_auctionbuyinginfoListModel>(db.Database, "a.aucid ,a.ProName ,a.primePrice ,a.floorPrice ,a.addPrice ,a.cellingPrice ,a.counts ,b.realname memid_RefText ,a.memid ,a.starttime ,a.endtime ,a.minUserCount ,c.Text ispassed_RefText ,a.ispassed ,d.Text isactive_RefText ,a.isactive ", "fw_auctionbuyinginfo a LEFT JOIN fw_memberinfo b ON a.memid = b.memid LEFT JOIN [SYS_YLW].dbo.sys_code c ON a.ispassed = c.Value AND (c.CodeType='ShState') LEFT JOIN [SYS_YLW].dbo.sys_code d ON a.isactive = d.Value AND (d.CodeType='UpdownFrame') ", sbCondition.ToString(), "a.aucid", "desc"));
            }
        }
Exemple #25
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "directtitle", "a.directtitle", "");
            SerachCondition.TextBox(sbCondition, "catid0", "a.catid0", "");
            SerachCondition.Date(sbCondition, "directtime0", "a.directtime0", "");
            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_directpriceListModel>(db.Database, "a.directid ,a.directtitle ,a.catid0 ,a.directtime0 ,a.directprice0 ,b.Text isshow_RefText ,a.isshow ,a.floatprice0 ,a.floatrate0 ", "fw_directprice a LEFT JOIN [SYS_YLW].dbo.sys_code b ON a.isshow = b.Value AND (b.CodeType='YN') ", sbCondition.ToString(), "a.directid", "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, "PopName", "a.PopName", "varchar");
            SerachCondition.TextBox(sbCondition, "Contact1", "a.Contact1", "varchar");
            SerachCondition.TextBox(sbCondition, "Tel1", "a.Tel1", "varchar");

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

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <wq_termPopListModel>(db.Database, "a.PopCode ,a.PopName ,a.Address ,a.Contact1 ,a.Tel1 ,a.Mobile1 ,a.Contact2 ,a.Tel2 ,a.Mobile2 ", "wq_termPop a ", sbCondition.ToString(), "a.PopCode", "desc"));
            }
        }
Exemple #27
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "memid", "a.memid", "");
            SerachCondition.TextBox(sbCondition, "realname", "a.realname", "");
            SerachCondition.TextBox(sbCondition, "qq", "a.qq", "");
            SerachCondition.TextBox(sbCondition, "wechat", "a.wechat", "");
            SerachCondition.Dropdown(sbCondition, "ispassed", "a.ispassed", "");

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

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <fw_memberinfoListModel>(db.Database, "a.Fid ,a.memid ,a.realname ,b.Text gender_RefText ,a.gender ,a.email ,a.qq ,a.wechat ,a.regtime ,a.lasttime ,c.Text ispassed_RefText ,a.ispassed ,d.Text isenabled_RefText ,a.isenabled ,a.Cimg1 ,a.Cimg2 ,a.Cimg3 ,a.Cimgcode1 ,a.Cimgcode2 ,a.Xletterurl ,a.Cletterurl ", "fw_memberinfo a LEFT JOIN [SYS_YLW].dbo.sys_code b ON a.gender = b.Value AND (b.CodeType='Gender') LEFT JOIN [SYS_YLW].dbo.sys_code c ON a.ispassed = c.Value AND (c.CodeType='RZZT') LEFT JOIN [SYS_YLW].dbo.sys_code d ON a.isenabled = d.Value AND (d.CodeType='YN') ", sbCondition.ToString(), "a.regtime", "desc"));
            }
        }
Exemple #28
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "psncode", "a.psncode", "");
            SerachCondition.TextBox(sbCondition, "name", "a.name", "");
            SerachCondition.TextBox(sbCondition, "Mobile", "a.Mobile", "");
            SerachCondition.Dropdown(sbCondition, "position", "a.position", "");
            SerachCondition.PopupSelect(sbCondition, "RoleCode", "a.RoleCode", "");

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

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <PersonInfoListModel>(db.Database, "a.ID ,a.psncode ,a.name ,a.Mobile ,b.Text sex_RefText ,a.sex ,c.Text EmployeeStatus_RefText ,a.EmployeeStatus ,d.OrganizeName position_RefText ,a.position ,e.RoleName RoleCode_RefText ,a.RoleCode ,a.stuffdate ,a.is_status ,a.kq_status ", "PersonInfo a LEFT JOIN [Bcp.Sys].dbo.sys_code b ON a.sex = b.Value LEFT JOIN [Bcp.Sys].dbo.sys_code c ON a.EmployeeStatus = c.Value LEFT JOIN [Bcp.Sys].dbo.sys_organize d ON a.position = d.OrganizeCode LEFT JOIN [Bcp.Sys].dbo.sys_role e ON a.RoleCode = e.RoleCode ", sbCondition.ToString(), "a.ID", "desc"));
            }
        }
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

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

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

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <wq_goodsreportListModel>(db.Database, "b.name UserCode_RefText ,a.UserCode ,a.PrmDate ,c.PopName DealerCode_RefText ,a.DealerCode ,a.RPdtCode ,a.Remark ", "wq_goodsreport a LEFT JOIN PersonInfo b ON a.UserCode = b.psncode LEFT JOIN wq_termPop c ON a.DealerCode = c.PopCode ", sbCondition.ToString(), "RPdtCode", "desc"));
            }
        }
Exemple #30
0
        public object Get()
        {
            var sbCondition = new System.Text.StringBuilder();

            SerachCondition.TextBox(sbCondition, "name", "a.name", "");
            SerachCondition.TextBox(sbCondition, "CertNumber", "a.CertNumber", "");
            SerachCondition.Dropdown(sbCondition, "nativeplace", "a.nativeplace", "");
            SerachCondition.TextBox(sbCondition, "FileNumber", "a.FileNumber", "");
            SerachCondition.PopupSelect(sbCondition, "UserAccount", "a.UserAccount", "");

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

            using (var db = new LUOLAI1401Context())
            {
                return(pageReq.ToPageList <PersonInfoListModel>(db.Database, "a.ID ,a.name ,a.Password ,a.CertNumber ,b.Text nativeplace_RefText ,a.nativeplace ,a.FileNumber ,c.Text UserAccount_RefText ,a.UserAccount ,a.psncode ,a.RoleCode ,a.WageCard ,a.SocialSecurity ,a.Mobile ,a.usedname ,a.sex ,a.birthdate ,a.age ,a.stuffdate ,a.effectdate ,a.workaddr ,a.BirthPlace ,a.nationality ,a.position ,a.permanreside ,a.characterrpr ,a.marital ,a.EmployeeStatus ,a.country ,a.idtype ,a.polity ,a.health ,a.Height ,a.Weight ,a.Vision ,a.lasteducation ,a.HighestDegree ,a.major ,a.rank ,a.GraduationSchool ,a.joinworkdate ,a.FreeWorkYears ,a.is_status ,a.kq_status ,a.glbdef1 ,a.Photo ,a.CompCode ,a.soft ,a.phonetype ,a.os ,a.isline ,a.KQ ", "PersonInfo a LEFT JOIN [Bcp.Sys].dbo.sys_code b ON a.nativeplace = b.Value LEFT JOIN [Bcp.Sys].dbo.sys_code c ON a.UserAccount = c.Value ", sbCondition.ToString(), "a.ID", "desc"));
            }
        }