/// <summary> /// 删除一条数据 /// </summary> public string DelInfo(string id) { if (id.Length > 0) { Common_BLL pg = new Common_BLL(); Sys_MenuBLL bllMenu = new Sys_MenuBLL(); if (pg.Delete(TableName, TableKey, "'" + id + "'", "")) { //删除待办事项 new RoleConfig().DeleteMatterTasks(id.Replace("'", "")); string rtnUrl = Request.RawUrl; Sys_Menu MenuModel = bllMenu.FindByURL(rtnUrl); if (MenuModel != null) { if (!string.IsNullOrEmpty(MenuModel.Menu_Name)) { pg.AddLog(MenuModel.Menu_Name, id, "删除", "ID=" + id + "", bg.CurrUserInfo().UserID, bg.CurrUserInfo().DepartmentCode); } } return("1"); } else { return("0"); } } else { return("0"); } }
/// <summary> /// 业务统计 /// </summary> /// <param name="ApplyDateStart">申请开始时间</param> /// <param name="ApplyDateEnd">申请结束时间</param> /// <param name="Province">省</param> /// <param name="PageSize">每页输出的记录数</param> /// <param name="PageIndex">当前页数</param> /// <param name="TotalCount">记返回总记录</param> public static DataSet GetP_Business_Statistics(string ApplyDateStart, string ApplyDateEnd, string Province, int PageSize, int PageIndex, out int TotalCount) { TotalCount = int.MinValue; Common_BLL ComBLL = new Common_BLL(); List <ParameterModel> ParameterModel = new List <ParameterModel>(); List <ParameterModel> ParameterList = new List <ParameterModel>(); ParameterList.Add(new ParameterModel { ParamName = "ApplyDateStart", ParamValue = ApplyDateStart, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterList.Add(new ParameterModel { ParamName = "ApplyDateEnd", ParamValue = ApplyDateEnd, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterList.Add(new ParameterModel { ParamName = "Province", ParamValue = Province, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterList.Add(new ParameterModel { ParamName = "PageSize", ParamValue = PageSize, ParamMode = ParamEnumMode.InMode, ParamType = DbType.Int32 }); ParameterList.Add(new ParameterModel { ParamName = "PageIndex", ParamValue = PageIndex, ParamMode = ParamEnumMode.InMode, ParamType = DbType.Int32 }); ParameterList.Add(new ParameterModel { ParamName = "TotalCount", ParamValue = TotalCount, ParamMode = ParamEnumMode.OutMode, ParamType = DbType.Int32 }); ParameterModel.Add(new ParameterModel { ParamName = "TotalCount", ParamValue = TotalCount, ParamMode = ParamEnumMode.OutMode, ParamType = DbType.Int32 }); return(ComBLL.ExecStoredProcedures(new StoredProcModel { ProcName = "P_Business_Statistics", ParameterList = ParameterList }, out ParameterModel)); }
/// <summary> /// 发送短信 /// </summary> /// <param name="UserName">客户名称</param> /// <param name="Phone">手机号码</param> /// <param name="Content"> /// Content说明:放款提醒格式: /// 客户名称,业务申请显示编号还款提醒格式: /// 客户名称,还款日期(日)逾期提醒格式: /// 客户名称,还款期数,还款日期(月日),逾期天数 /// </param> /// <param name="Model">Model说明: /// LoanSMSTemplate:财务放款短信模板; /// RepaymentSMS:还款提醒短信模板; /// BeOverdueSMS:逾期短信提醒模板; /// </param> /// <param name="IsAuto">是否自动手动(flase:手动 true: 自动)</param> public static void GetP_Msg_SendSMS(string UserName, string Phone, string Content, string Model, bool IsAuto) { Common_BLL ComBLL = new Common_BLL(); List <ParameterModel> ParameterModel = null; List <ParameterModel> ParameterList = new List <ParameterModel>(); ParameterList.Add(new ParameterModel { ParamName = "UserName", ParamValue = UserName, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterList.Add(new ParameterModel { ParamName = "Phone", ParamValue = Phone, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterList.Add(new ParameterModel { ParamName = "Content", ParamValue = Content, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterList.Add(new ParameterModel { ParamName = "Model", ParamValue = Model, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterList.Add(new ParameterModel { ParamName = "IsAuto", ParamValue = IsAuto, ParamMode = ParamEnumMode.InMode, ParamType = DbType.Boolean }); ComBLL.ExecStoredProcedures(new StoredProcModel { ProcName = "P_Msg_SendSMS", ParameterList = ParameterList }, out ParameterModel); }
protected void ddlDealersInfo_Area1_TextChanged(object sender, EventArgs e) { Common_BLL bllComm = new Common_BLL(); //所属区域2 DataTable listDealersInfo_Area2 = bllComm.GetDataBySQL("SELECT CONVERT(varchar(50),B.AreaId) as AreaId,B.Area_Name FROM dbo.Business_AreaDistribution A LEFT JOIN dbo.Business_Area B ON A.AreaDistribution_AreaID=B.AreaId WHERE A.AreaDistribution_ID='" + ddlDealersInfo_Area1.SelectedValue + "' AND B.Area_Depth=1"); if (listDealersInfo_Area2.Rows.Count > 0) { DataRow newRow; newRow = listDealersInfo_Area2.NewRow(); newRow["AreaId"] = ""; newRow["Area_Name"] = Constant.DrpChoiceName; listDealersInfo_Area2.Rows.InsertAt(newRow, 0); } this.ddlDealersInfo_Area2.DataSource = listDealersInfo_Area2; this.ddlDealersInfo_Area2.DataTextField = "Area_Name"; this.ddlDealersInfo_Area2.DataValueField = "AreaId"; this.ddlDealersInfo_Area2.DataBind(); //所属区域3 DataTable listDealersInfo_Area3 = bllComm.GetDataBySQL("SELECT CONVERT(varchar(50),AreaId) as AreaId,Area_Name FROM dbo.Business_Area WHERE Area_ParentId=(SELECT Area_ID FROM dbo.Business_Area WHERE AreaId='" + ddlDealersInfo_Area2.SelectedValue + "')"); if (listDealersInfo_Area3.Rows.Count > 0) { DataRow newRow1; newRow1 = listDealersInfo_Area3.NewRow(); newRow1["AreaId"] = ""; newRow1["Area_Name"] = Constant.DrpChoiceName; listDealersInfo_Area3.Rows.InsertAt(newRow1, 0); } this.ddlDealersInfo_Area3.DataSource = listDealersInfo_Area3; this.ddlDealersInfo_Area3.DataTextField = "Area_Name"; this.ddlDealersInfo_Area3.DataValueField = "AreaId"; this.ddlDealersInfo_Area3.DataBind(); }
/// <summary> /// 绑定下拉框 /// </summary> private void BindDDL() { Sys_DataDictBLL bllDataDict = new Sys_DataDictBLL(); Common_BLL bllComm = new Common_BLL(); //类型 List <Sys_DataDict> listDealersInfo_Type = bllDataDict.FindWhere(p => p.DataDict_Code == "4504" || p.DataDict_Code == "4505").OrderBy(p => p.DataDict_Sequence).ToList(); listDealersInfo_Type.Insert(0, new Sys_DataDict { DataDict_Name = "==请选择==", DataDict_Code = "" }); this.ddlDealersInfo_Type.DataSource = listDealersInfo_Type; this.ddlDealersInfo_Type.DataTextField = "DataDict_Name"; this.ddlDealersInfo_Type.DataValueField = "DataDict_Code"; this.ddlDealersInfo_Type.DataBind(); //合作类型 List <Sys_DataDict> listDealersInfo_CooperativeType = bllDataDict.FindWhere(p => p.DataDict_ParentCode == "58").OrderBy(p => p.DataDict_Sequence).ToList(); listDealersInfo_CooperativeType.Insert(0, new Sys_DataDict { DataDict_Name = "==请选择==", DataDict_Code = "" }); this.ddlDealersInfo_CooperativeType.DataSource = listDealersInfo_CooperativeType; this.ddlDealersInfo_CooperativeType.DataTextField = "DataDict_Name"; this.ddlDealersInfo_CooperativeType.DataValueField = "DataDict_Code"; this.ddlDealersInfo_CooperativeType.DataBind(); //所属区域1 DataTable listDealersInfo_Area1 = bllComm.GetDataBySQL("SELECT AreaDistribution_ID,AreaDistribution_Name FROM dbo.Business_AreaDistribution GROUP BY AreaDistribution_ID,AreaDistribution_Name"); DataRow newRow; newRow = listDealersInfo_Area1.NewRow(); newRow["AreaDistribution_ID"] = ""; newRow["AreaDistribution_Name"] = Constant.DrpChoiceName; listDealersInfo_Area1.Rows.InsertAt(newRow, 0); this.ddlDealersInfo_Area1.DataSource = listDealersInfo_Area1; this.ddlDealersInfo_Area1.DataTextField = "AreaDistribution_Name"; this.ddlDealersInfo_Area1.DataValueField = "AreaDistribution_ID"; this.ddlDealersInfo_Area1.DataBind(); List <Sys_Hierarchy> HierarchyList = new List <Sys_Hierarchy>(); HierarchyList = new Sys_HierarchyBLL().FindWhere(p => p.Hierarchy_ParentCode == "01" && p.Hierarchy_IsDel == false).OrderBy(p => p.Hierarchy_Sequence).ToList(); HierarchyList.Insert(0, new Sys_Hierarchy { Hierarchy_Name = Constant.DrpChoiceName, Hierarchy_Code = "" }); ddlDealersInfo_HierarchyOne.DataSource = HierarchyList; ddlDealersInfo_HierarchyOne.DataTextField = "Hierarchy_Name"; ddlDealersInfo_HierarchyOne.DataValueField = "Hierarchy_Code"; ddlDealersInfo_HierarchyOne.DataBind(); HierarchyList = new Sys_HierarchyBLL().FindWhere(p => p.Hierarchy_ParentCode == "02" && p.Hierarchy_IsDel == false).OrderBy(p => p.Hierarchy_Sequence).ToList(); HierarchyList.Insert(0, new Sys_Hierarchy { Hierarchy_Name = Constant.DrpChoiceName, Hierarchy_Code = "" }); ddlDealersInfo_HierarchyTwo.DataSource = HierarchyList; ddlDealersInfo_HierarchyTwo.DataTextField = "Hierarchy_Name"; ddlDealersInfo_HierarchyTwo.DataValueField = "Hierarchy_Code"; ddlDealersInfo_HierarchyTwo.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { //this.UCGrid.ExportClick += new UserControls.UCGrid.ExportClickEventHandler(btn_Export_Click); if (!IsPostBack) { Common_BLL.SetDDLByDataDictCodeNULL(ddlDepType, "45"); //CommTools.SetDDLByDataDictCode(ddlDepClass, "09"); this.hid_dep.Value = "2"; } }
public static void GetP_Business_SystemEvaluate(string ApplyId) { Common_BLL ComBLL = new Common_BLL(); List <ParameterModel> ParameterModel = null; List <ParameterModel> ParameterList = new List <ParameterModel>(); ParameterList.Add(new ParameterModel { ParamName = "ApplyBasicID", ParamValue = ApplyId, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ComBLL.ExecStoredProcedures(new StoredProcModel { ProcName = "P_Business_SystemEvaluate", ParameterList = ParameterList }, out ParameterModel); }
protected void ddlDealersInfo_Area2_TextChanged(object sender, EventArgs e) { Common_BLL bllComm = new Common_BLL(); //所属区域3 DataTable listDealersInfo_Area3 = bllComm.GetDataBySQL("SELECT CONVERT(varchar(50),AreaId) as AreaId,Area_Name FROM dbo.Business_Area WHERE Area_ParentId=(SELECT Area_ID FROM dbo.Business_Area WHERE AreaId='" + ddlDealersInfo_Area2.SelectedValue + "')"); DataRow newRow; newRow = listDealersInfo_Area3.NewRow(); newRow["AreaId"] = ""; newRow["Area_Name"] = Constant.DrpChoiceName; listDealersInfo_Area3.Rows.InsertAt(newRow, 0); this.ddlDealersInfo_Area3.DataSource = listDealersInfo_Area3; this.ddlDealersInfo_Area3.DataTextField = "Area_Name"; this.ddlDealersInfo_Area3.DataValueField = "AreaId"; this.ddlDealersInfo_Area3.DataBind(); }
/// <summary> /// 导出所有相关的数据 /// </summary> public string ExportExcel(string fileName) { Common_BLL pg = new Common_BLL(); BasicVariable(); //基本变量赋值 Where(); //执行获取查看范围 if (TableView.IsNullOrEmpty()) { TableView = GetGridAttr("TableView"); } string ExcelField = string.Empty; foreach (XElement e in Node) { ExcelField += " " + e.Attribute("Key").Value + " AS [" + e.Attribute("Name").Value + "],"; } ExcelField = ExcelField.Substring(0, ExcelField.Length - 1); #region 读取数据 DataTable list_x = null; DataSet ds = pg.GetData(TableView.IsNullOrEmpty() ? TableName : TableView, ExcelField, SQLWhere, SQLOrder); if (ds.Tables.Count > 0) { list_x = ds.Tables[0]; //Sys_Menu MenuModel = new Sys_MenuBLL().FindByURL(Request.RawUrl); string ph = AsposeExcel.OutFileToDisk(list_x, fileName, false); if (ph != "0") { return("javascript:" + ph + "," + fileName); } else { return("javascript:'" + ph + "',''"); } } return("javascript:''0'',''"); #endregion }
/// <summary> /// 流水 /// </summary> /// <param name="ApplyBasisId">业务ID</param> /// <param name="Number">前缀名称编号</param> /// <param name="ContractNO">返回的流水编号</param> public static void GetP_ContractLS(string ApplyBasisId, string Number, out string ContractNO) { ContractNO = string.Empty; Common_BLL ComBLL = new Common_BLL(); List <ParameterModel> ParameterModel = new List <ParameterModel>(); List <ParameterModel> ParameterList = new List <ParameterModel>(); ParameterList.Add(new ParameterModel { ParamName = "ApplyBasisId", ParamValue = ApplyBasisId, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterList.Add(new ParameterModel { ParamName = "Number", ParamValue = Number, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ParameterModel.Add(new ParameterModel { ParamName = "ContractNO", ParamValue = ContractNO, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); ComBLL.ExecStoredProcedures(new StoredProcModel { ProcName = "P_ContractLS", ParameterList = ParameterList }, out ParameterModel); }
/// <summary> /// 批量删除数据 /// </summary> public string BatchDelInfo(string id) { if (id.Length > 0) { Common_BLL pg = new Common_BLL(); Sys_MenuBLL bllMenu = new Sys_MenuBLL(); StringBuilder sqlstr = new StringBuilder(); List <string> listId = new List <string>(); listId = id.Split(',').ToList(); foreach (var item in listId) { sqlstr.Append("'" + item + "',"); } string sql = sqlstr.ToString().Remove(sqlstr.Length - 1); if (pg.Delete(TableName, TableKey, sql, "")) { //删除待办事项 new RoleConfig().DeleteBatchMatterTasks(sql); string rtnUrl = Request.RawUrl; Sys_Menu MenuModel = bllMenu.FindByURL(rtnUrl); if (MenuModel != null) { if (!string.IsNullOrEmpty(MenuModel.Menu_Name)) { pg.AddLog(MenuModel.Menu_Name, "", "批量删除成功", "批量删除通过:" + listId, bg.CurrUserInfo().UserID, bg.CurrUserInfo().DepartmentCode); } } return("1"); } else { return("0"); } } else { return("0"); } }
/// <summary> /// 删除一条数据 /// </summary> protected string DelInfo(string id) { if (id.Length > 0) { Common_BLL pg = new Common_BLL(); Sys_MenuBLL bllMenu = new Sys_MenuBLL(); BasePage page = new BasePage(); SessionUserModel userInfo = page.CurrUserInfo(); if (pg.Delete(UCEasyUIDataGrid.TableName, UCEasyUIDataGrid.TableKey, "'" + id + "'", "")) { //删除日志 //DeleteLog(); //删除待办事项 new RoleConfig().DeleteMatterTasks(id.Replace("'", "")); string rtnUrl = Request.RawUrl; Sys_Menu MenuModel = bllMenu.FindByURL(rtnUrl); if (MenuModel != null) { if (!string.IsNullOrEmpty(MenuModel.Menu_Name)) { pg.AddLog(MenuModel.Menu_Name, id, "删除", "ID=" + id + "", userInfo.UserID, userInfo.DepartmentCode); } } return("1"); } else { return("0"); } } else { return("0"); } }
/// <summary> /// 主程序 /// </summary> /// <param name="page">第几页(从1开始)</param> /// <param name="rows">每页显示的条数</param> /// <param name="url">页面url地址</param> /// <param name="SQLWhere">条件</param> /// <returns></returns> public string jsonPerson() { Common_BLL pg = new Common_BLL(); int totalcount = int.MinValue; int totalpagecount = int.MinValue; if (Datas.IsNull()) { BasicVariable(); //基本变量赋值 Where(); //执行获取查看范围 } if (TableView.IsNullOrEmpty()) { TableView = GetGridAttr("TableView"); } #region 读取数据 DataTable list_x = null; DataSet ds; if (Datas.IsNull()) { if (TableView != "") { //判断是否需要分页 if (IsShowPagin) { ds = pg.PageData(TableView, SQLField, TableKey, SQLOrder, PageSize, PageIndex, SQLWhere, out totalcount, out totalpagecount); } else { ds = pg.GetData(TableView, SQLField, SQLWhere, SQLOrder); } } else { //判断是否需要分页 if (IsShowPagin) { ds = pg.PageData(TableName, SQLField, TableKey, SQLOrder, PageSize, PageIndex, SQLWhere, out totalcount, out totalpagecount); } else { ds = pg.GetData(TableName, SQLField, SQLWhere, SQLOrder); } } TotalCount = totalcount; } else { ds = Datas; } if (ds.Tables.Count > 0) { list_x = ds.Tables[0]; #region 处理字段长度 //处理字段长度 foreach (DataRow rews in list_x.Rows) { foreach (XElement e in Node) { if (e.Attribute("MaxLength") != null && rews[e.Attribute("Key").Value] != null) { rews[e.Attribute("Key").Value] = rews[e.Attribute("Key").Value].ToString().IfNullReturnEmpty().SubstringByByte(e.Attribute("MaxLength").Value.ToInt(10), "…"); } } } #endregion } #endregion #region 转换成josn //计算出总的数量为了给easyUI控件实现分页 int total = TotalCount; var list = list_x; //使用匿名类来实现前台要求的Json格式,序列化为此格式 var data = new { total = total, rows = list }; IsoDateTimeConverter timeConverter = new IsoDateTimeConverter();//这里使用自定义日期格式,默认是ISO8601格式 if (DateType == 0) { timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm";//设置时间格式 } else if (DateType == 1) { timeConverter.DateTimeFormat = "yyyy-MM-dd HH:mm";//设置时间格式 } else if (DateType == 2) { timeConverter.DateTimeFormat = "yyyy-MM-dd";//设置时间格式 } string jsonPerson = JsonConvert.SerializeObject(data, timeConverter); #endregion return(jsonPerson); }
/// <summary> /// 加载页面信息 /// </summary> private void BindShow() { // 附件信息 Session.Remove("ww"); this.File.FileSizeLimit = "3000"; this.File.FilesNname = "File"; this.File.FileSessionID = "ww"; this.File.FileType = "经销商资料"; string id = Request.QueryString["id"]; if (!string.IsNullOrEmpty(id)) { string products = string.Empty; Common_BLL bllComm = new Common_BLL(); Dealers_DealersInfoBLL bllDealers_DealersInfo = new Dealers_DealersInfoBLL(); Business_DealersProductBLL bllBusiness_DealersProduct = new Business_DealersProductBLL(); Business_DealersBrandBLL bllDealersBrand = new Business_DealersBrandBLL(); Product_ProductDefinitionBLL bllProduct = new Product_ProductDefinitionBLL(); List <Product_ProductDefinition> ProductDefinition = bllProduct.FindWhere(p => p.ProductDefinition_Deleted == false && p.ProductDefinition_ExpirationDate > DateTime.Now); //根据经销商编号获取经销商信息 Dealers_DealersInfo model = bllDealers_DealersInfo.Find(p => p.DealersInfoID == id); //获取经销商关联的产品 List <Business_DealersProduct> DealersProduct = bllBusiness_DealersProduct.FindWhere(p => p.DealersProduct_DealersID == id); if (DealersProduct.Count != 0) { foreach (Business_DealersProduct Product in DealersProduct) { for (int i = 0; i < ProductDefinition.Count; i++) { if (ProductDefinition[i].ProductDefinition_ID == Product.DealersProduct_ProductID) { products += Product.DealersProduct_ProductID + ","; } } } if (!products.IsNullOrEmpty()) { products = products.Substring(0, products.Length - 1); } } if (model == null) { MessageBox.ShowAndRedirect(this, "该数据不存在!", "DealersDealersInfoList.aspx"); } else { FormModel.SetForm <Dealers_DealersInfo>(this, model, "txt"); FormModel.SetForm <Dealers_DealersInfo>(this, model, "ddl"); txtDealersInfo_CLDate.Text = model.DealersInfo_CLDate == null ? "" : Convert.ToDateTime(model.DealersInfo_CLDate).ToString("yyyy年MM月dd日"); txtDealersInfo_ValidityPeriod.Text = model.DealersInfo_ValidityPeriod == null ? "" : Convert.ToDateTime(model.DealersInfo_ValidityPeriod).ToString("yyyy年MM月dd日"); txtDealersInfo_CooperativeValidity.Text = model.DealersInfo_CooperativeValidity == null ? "" : Convert.ToDateTime(model.DealersInfo_CooperativeValidity).ToString("yyyy年MM月dd日"); hidProductID_New.Value = products; hidProductID_Old.Value = products; string[] area = null; if (!string.IsNullOrEmpty(model.DealersInfo_Area)) { area = model.DealersInfo_Area.Split(','); //所属区域1 ddlDealersInfo_Area1.SelectedValue = area[0]; //所属区域2 DataTable listDealersInfo_Area2 = bllComm.GetDataBySQL("SELECT B.AreaId,B.Area_Name FROM dbo.Business_AreaDistribution A LEFT JOIN dbo.Business_Area B ON A.AreaDistribution_AreaID=B.AreaId WHERE A.AreaDistribution_ID='" + area[0] + "' AND B.Area_Depth=1"); this.ddlDealersInfo_Area2.DataSource = listDealersInfo_Area2; this.ddlDealersInfo_Area2.DataTextField = "Area_Name"; this.ddlDealersInfo_Area2.DataValueField = "AreaId"; this.ddlDealersInfo_Area2.DataBind(); ddlDealersInfo_Area2.SelectedValue = area[1]; //所属区域3 DataTable listDealersInfo_Area3 = bllComm.GetDataBySQL("SELECT CONVERT(varchar(50),AreaId) as AreaIds,Area_Name FROM dbo.Business_Area WHERE Area_ParentId=(SELECT Area_ID FROM dbo.Business_Area WHERE AreaId='" + area[1] + "')"); this.ddlDealersInfo_Area3.DataSource = listDealersInfo_Area3; this.ddlDealersInfo_Area3.DataTextField = "Area_Name"; this.ddlDealersInfo_Area3.DataValueField = "AreaIds"; this.ddlDealersInfo_Area3.DataBind(); ddlDealersInfo_Area3.SelectedValue = area[2]; } //获取经销商管理的车辆品牌 List <Business_DealersBrand> dtBrand = bllDealersBrand.FindWhere(p => p.DealersBrand_DealersID == id).OrderBy(p => p.DealersBrand_BrandCNName).ToList(); if (dtBrand.Count > 0) { string str = string.Empty; string brandID = string.Empty; string brandName = string.Empty; string brandNameLength = "0"; for (int i = 0; i < dtBrand.Count; i++) { brandID = dtBrand[i].DealersBrand_BrandID; brandName = dtBrand[i].DealersBrand_BrandCNName; brandNameLength = (brandName.Length * 12 + 10).ToString(); str = "<div id='" + brandID + "' class='div_Brand' style='width:" + brandNameLength + "px;'><span>" + brandName + "</span><img id='img_" + brandID + "' title='删除' onclick='RemoveBrand(\"" + brandID + "\",\"" + brandName + "\")' src='../../Images/buttons/btn_delete.gif'></img></div>"; hidBrandID.Value += brandID + ","; hidBrandName.Value += brandName + ","; hidBrandInfo.Value += str; } } } this.File.FileOperationID = id; } else { this.File.FileOperationID = Guid.NewGuid().ToString(); } }
/// <summary> /// 获取更新后产品编号 /// </summary> /// <returns></returns> private string GetProductID(string dealersInfoID) { //更新后产品编号 string[] productID_New = hidProductID_New.Value.Split(','); //更新前产品编号 string[] productID_Old = hidProductID_Old.Value.Split(','); string productID = string.Empty; bool flag = false; if (!hidProductID_New.Value.Equals(hidProductID_Old.Value)) { for (int i = 0; i < productID_Old.Length; i++) { for (int j = 0; j < productID_New.Length; j++) { if (productID_Old[i].Equals(productID_New[j])) { flag = true; break; } } if (!flag) { productID += productID_Old[i] + ","; } } //如果存在编辑后,有被取消的产品 if (!string.IsNullOrEmpty(productID)) { Common_BLL bll = new Common_BLL(); StringBuilder strSql = new StringBuilder(); strSql.AppendFormat(@"SELECT D.ApplyBasis_ProductDefinitionID , E.ProductDefinition_Name , COUNT(1) AS Number FROM dbo.Dealers_DealersInfo A JOIN dbo.Sys_Department B ON A.DealersInfo_DeptID = B.DepartmentID JOIN dbo.Sys_UserInfo C ON B.Department_Code = C.UserInfo_DepCode JOIN dbo.Business_ApplyBasis D ON C.UserInfoID = D.ApplyBasis_UpdateUserID LEFT JOIN dbo.Product_ProductDefinition E ON D.ApplyBasis_ProductDefinitionID = E.ProductDefinition_ID WHERE A.DealersInfoID = '{0}' AND D.WorkflowTasksSetp NOT IN ( 0, 7 ) AND D.ApplyBasis_IsDelete = 0 AND D.ApplyBasis_ProductDefinitionID IN ( SELECT string FROM dbo.Split('{1}', ',') ) GROUP BY D.ApplyBasis_ProductDefinitionID , E.ProductDefinition_Name ", dealersInfoID, productID); //查询被取消的产品中,该经销商下所有用户是否有未走完申请流程的申请单 DataTable dt = bll.GetDataBySQL(strSql.ToString()); if (dt != null) { if (dt.Rows.Count > 0) { MessageBox.Show(this, "该经销商所关联的产品有未完成申请流程的申请单,无法保存!"); productID = "0"; } else { productID = hidProductID_New.Value; } } } else { productID = hidProductID_New.Value; } } else { productID = hidProductID_Old.Value; } return(productID); }
protected void Show() { List <Sys_UploadDataType> typeList = updateTypeBll.FindWhere(" UploadDataType_IsDelete='0'").OrderBy(p => p.UploadDataType_SortNo).ToList(); //使用存储过程查看 Common_BLL ComBLL = new Common_BLL(); List <ParameterModel> ParameterModel = null; List <ParameterModel> ParameterList = new List <ParameterModel>(); ParameterList.Add(new ParameterModel { ParamName = "ProductType", ParamValue = "2801", ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); DataSet ds = ComBLL.ExecStoredProcedures(new StoredProcModel { ProcName = "P_GetUploadDataType", ParameterList = ParameterList }, out ParameterModel); List <ParameterModel> ParameterModel2 = null; List <ParameterModel> ParameterList2 = new List <ParameterModel>(); ParameterList2.Add(new ParameterModel { ParamName = "ProductType", ParamValue = "2802", ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); DataSet ds2 = ComBLL.ExecStoredProcedures(new StoredProcModel { ProcName = "P_GetUploadDataType", ParameterList = ParameterList2 }, out ParameterModel2); string str1 = ""; for (int j = 0; j < ds.Tables[0].Rows.Count; j++) { List <Sys_UploadDataType> typeList1 = typeList.FindAll(p => p.UploadDataType_ProductType == "2801" && p.UploadDataType_ProcessStage == ds.Tables[0].Rows[j][0].ToString()); for (int i = 0; i < typeList1.Count; i++) { str1 += "<tr>"; str1 += "<td style=\"text-align:center;\">" + typeList1[i].UploadDataType_ProcessStage + "</td>"; str1 += "<td><input type=\"text\" id=\"txtTypeName" + i + "\" maxlength=\"50\" class=\"required validate[required]\" style=\"text-align: center; width:100%;\" value=\"" + typeList1[i].UploadDataType_Name + "\" /></td>"; str1 += "<td><input type=\"text\" id=\"txtCode" + i + "\" maxlength=\"20\" class=\"required validate[required]\" value=\"" + typeList1[i].UploadDataType_TypeCode + "\" /></td>"; str1 += "<td><input type=\"text\" id=\"txtCode" + i + "\" maxlength=\"120\" style=\"width:100%;\" value=\"" + typeList1[i].UploadDataType_DataType + "\" /></td>"; str1 += "<td style=\"display:none;\"><input type=\"text\" id=\"txtID" + i + "\" value=\"" + typeList1[i].UploadDataType_ID + "\" /></td>"; str1 += "<td style=\"text-align:center;\"><a onclick=\"deleteRow(this)\" title=\"删除\"><img src=\"../../Images/buttons/cancel.png\" /></a></td>"; str1 += "</tr>"; } } this.LitContent1.Text = str1; string str2 = ""; for (int j = 0; j < ds.Tables[0].Rows.Count; j++) { List <Sys_UploadDataType> typeList2 = typeList.FindAll(p => p.UploadDataType_ProductType == "2802" && p.UploadDataType_ProcessStage == ds.Tables[0].Rows[j][0].ToString()); for (int i = 0; i < typeList2.Count; i++) { str2 += "<tr>"; str2 += "<td style=\"text-align:center;\">" + typeList2[i].UploadDataType_ProcessStage + "</td>"; str2 += "<td><input type=\"text\" id=\"txtTypeName" + i + "\" maxlength=\"50\" class=\"required validate[required]\" style=\"text-align: center; width:100%;\" value=\"" + typeList2[i].UploadDataType_Name + "\" /></td>"; str2 += "<td><input type=\"text\" id=\"txtCode" + i + "\" maxlength=\"20\" class=\"required validate[required]\" value=\"" + typeList2[i].UploadDataType_TypeCode + "\" /></td>"; str2 += "<td><input type=\"text\" id=\"txtDataType" + i + "\" maxlength=\"120\" style=\"width:100%;\" value=\"" + typeList2[i].UploadDataType_DataType + "\" /></td>"; str2 += "<td style=\"display:none;\"><input type=\"text\" id=\"txtID" + i + "\" value=\"" + typeList2[i].UploadDataType_ID + "\" /></td>"; str2 += "<td style=\"text-align:center;\"><a onclick=\"deleteRow(this)\" title=\"删除\"><img src=\"../../Images/buttons/cancel.png\" /></a></td>"; str2 += "</tr>"; } } this.LitContent2.Text = str2; }
/// <summary> /// 查询数据库中和Session中的附件 /// </summary> /// <param name="context"></param> public void DataFilseSelect(HttpContext context) { Regex r = new Regex(@"[\u4e00-\u9fa5]+"); string OperationID = context.Request.QueryString["OperationID"]; //业务ID string FileType = context.Request.QueryString["FileType"]; //附件的类型 string SessionID = context.Request.QueryString["SessionID"]; //SessionID string type = context.Request.QueryString["type"]; //类型1:未归类 string productType = context.Request.QueryString["ProductType"]; //业务类别(个人、企业) string str = ""; if (!string.IsNullOrEmpty(FileType)) { FileType = HttpUtility.UrlDecode(FileType); } if (!string.IsNullOrEmpty(OperationID) || SessionID != "") { List <Sys_ModelFile> ModelFilelist = null; if (context.Session[SessionID] == null) { ModelFilelist = new List <Sys_ModelFile>(); } else { ModelFilelist = context.Session[SessionID] as List <Sys_ModelFile>; } str += "["; List <Sys_ModelFile> filelist = null; Sys_ModelFileBLL modelfile = new Sys_ModelFileBLL(); if (string.IsNullOrEmpty(FileType)) { filelist = modelfile.GetList(p => p.File_OperationID == OperationID).OrderBy(a => a.File_AddTime).ToList(); } else { string filetypes = ""; Sys_UploadDataTypeBLL upBll = new Sys_UploadDataTypeBLL(); List <Sys_UploadDataType> chlist = upBll.GetList(p => p.UploadDataType_TypeCode == FileType || p.UploadDataType_ProcessStage == FileType).ToList(); if (chlist.Count > 0) { for (int i = 0; i < chlist.Count; i++) { filetypes += chlist[i].UploadDataType_TypeCode; } } if (FileType == Constant.fileType7) { filetypes = FileType; } else if (FileType == Constant.Classification) { filetypes = FileType; } if (FileType == "0") { ModelFilelist = ModelFilelist.FindAll(p => !filetypes.Contains(p.File_Type)); } else { if (FileType == Constant.Classification) { string lb = ""; Common_BLL ComBLL = new Common_BLL(); List <ParameterModel> ParameterModel = null; List <ParameterModel> ParameterList = new List <ParameterModel>(); ParameterList.Add(new ParameterModel { ParamName = "ProductType", ParamValue = productType, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); DataSet ds = ComBLL.ExecStoredProcedures(new StoredProcModel { ProcName = "P_GetUploadDataType", ParameterList = ParameterList }, out ParameterModel); int cout = ds.Tables[0].Rows.Count; for (int j = 0; j < cout; j++) { lb += ds.Tables[0].Rows[j][0].ToString(); } ModelFilelist = ModelFilelist.FindAll(p => filetypes.Contains(p.File_Type) || lb.Contains(p.File_Type)).OrderBy(a => a.File_AddTime).ToList(); } else { ModelFilelist = ModelFilelist.FindAll(p => filetypes.Contains(p.File_Type) || p.File_Type == FileType).OrderBy(a => a.File_AddTime).ToList(); } } if (FileType == Constant.Classification) { string lb = ""; Common_BLL ComBLL = new Common_BLL(); List <ParameterModel> ParameterModel = null; List <ParameterModel> ParameterList = new List <ParameterModel>(); ParameterList.Add(new ParameterModel { ParamName = "ProductType", ParamValue = productType, ParamMode = ParamEnumMode.InMode, ParamType = DbType.String }); DataSet ds = ComBLL.ExecStoredProcedures(new StoredProcModel { ProcName = "P_GetUploadDataType", ParameterList = ParameterList }, out ParameterModel); int cout = ds.Tables[0].Rows.Count; for (int j = 0; j < cout; j++) { lb += ds.Tables[0].Rows[j][0].ToString(); } filelist = modelfile.GetList(p => p.File_OperationID == OperationID && p.File_Type == FileType).OrderBy(a => a.File_AddTime).ToList(); } else { filelist = modelfile.GetList(p => p.File_OperationID == OperationID && (filetypes.Contains(p.File_Type) || p.File_Type == FileType)).OrderBy(a => a.File_AddTime).ToList();// || p.File_Type == FileType } } foreach (Sys_ModelFile file in ModelFilelist) { string filename2 = file.File_Name; if (filename2.Length > 9) { Match mc = r.Match(filename2); Match mt = r.Match(file.File_Type); if (mc.Length != 0) // { if (mt.Length != 0 && file.File_Type != Constant.fileType7) { filename2 = filename2.Substring(0, 7) + "..(未归类)"; } else { filename2 = filename2.Substring(0, 9) + ".."; } } else { if (mt.Length != 0 && file.File_Type != Constant.fileType7) { filename2 = filename2.Substring(0, 9) + "..(未归类)"; } else { filename2 = filename2.Substring(0, 9) + ".."; } } } else { Match mt = r.Match(file.File_Type); if (mt.Length != 0 && file.File_Type != Constant.fileType7) { filename2 = filename2 + "(未归类)"; } } str += "{\"id\":\"" + file.FileID + "\",\"filename\":\"" + file.File_Name + "\",\"filesize\":\"\",\"uploaddate\":\"" + Convert.ToDateTime(file.File_AddTime).ToString("yyyy年MM月dd日") + "\",\"fileUrl\":\"" + file.File_Path + "\",\"filetitle\":\"" + filename2 + "\"},"; } foreach (Sys_ModelFile file in filelist) { string fileContentLength = fileSizs(Convert.ToInt32(file.File_Size)); string filename2 = file.File_Name; if (filename2.Length > 9) { Match mc = r.Match(file.File_Type); if (mc.Length != 0 && file.File_Type != Constant.fileType7) //类别中含有汉字 { filename2 = filename2.Substring(0, 7) + "(未归类)"; } else { filename2 = filename2.Substring(0, 9) + ".."; } } else { Match mc = r.Match(file.File_Type); if (mc.Length != 0 && file.File_Type != Constant.fileType7) //类别中含有汉字 { filename2 = filename2 + "(未归类)"; } } str += "{\"id\":\"" + file.FileID + "\",\"filename\":\"" + file.File_Name + "\",\"filesize\":\"" + fileContentLength + "\",\"uploaddate\":\"" + Convert.ToDateTime(file.File_AddTime).ToString("yyyy年MM月dd日") + "\",\"fileUrl\":\"" + file.File_Path + "\",\"filetitle\":\"" + filename2 + "\"},"; } if (str.Length > 1) { str = str.Substring(0, str.Length - 1); } str += "]"; context.Response.Write(str); } }
/// <summary> /// 加载菜单树 /// </summary> /// <returns></returns> public string LoadMuenu() { List <Sys_Department> list = null; CurrUserInfo = new BasePage().CurrUserInfo(); list = bll.GetList(p => p.Department_IsDel == "0").OrderBy(p => p.Department_Sequence).ToList(); StringBuilder strMenu = new StringBuilder(); strMenu.Append("{\"total\":" + list.Count + ",\"rows\":["); int index = 0; foreach (Sys_Department menu in list) { index++; if (menu.Department_ParentCode == "0") { strMenu.Append("{\"id\":\"" + menu.Department_Code + "\",\"name\":\"" + menu.Department_Name + "\",\"sort\":\"" + menu.Department_Sequence + "\",\"type\":\"" + Common_BLL.GetDataDictNameByCode(menu.Department_Type) + "\",\"personCharge\":\"" + index + "\",\"teachers\":\"" + index + "\",\"students\":\"" + index + "\"},"); } else { strMenu.Append("{\"id\":\"" + menu.Department_Code + "\",\"name\":\"" + menu.Department_Name + "\",\"sort\":\"" + menu.Department_Sequence + "\",\"type\":\"" + Common_BLL.GetDataDictNameByCode(menu.Department_Type) + "\",\"personCharge\":\"" + index + "\",\"teachers\":\"" + index + "\",\"students\":\"" + index + "\",\"_parentId\":\"" + menu.Department_ParentCode + "\"}"); if (index != list.Count) { strMenu.Append(","); } } } strMenu.Append("]}"); return(strMenu.ToString()); }