protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Company.MODEL company = Company.GetCache(companyId);//Company.GetModel("SELECT TOP 1 * FROM TE_Companys WHERE ID=" + companyId); if (company != null) { this.txtCompanyNO.Text = company.NO.ToString(); this.txtCompanyName.Text = company.Name.ToString(); this.li_Manage.Text = WX.CommonUtils.GetRealNameListByUserIdList(company.Manage.ToString()); this.txtCtype.Text = company.Ctype.ToString(); this.txtSetuptime.Text = company.Setuptime.f("{0:yyyy年MM月dd日}"); this.txtOperatetime.Text = company.Operatetime.f("{0:yyyy年MM月dd日}"); this.txtOperate.Text = company.Operate.ToString(); this.txtUptime.Text = company.Uptime.f("{0:yyyy年MM月dd日 HH:mm:ss}"); this.txtRoute.Text = company.Route.ToString().Replace("\n", "<br/>"); this.txtIntroduction.Text = company.Introduction.ToString(); this.txtTelephone.Text = company.Tel.ToString(); this.txtFax.Text = company.Fax.ToString();//Dept_CompanysPartnerEdit.aspx?companyID=11&id=14 DataTable frdt = ULCode.QDA.XSql.GetDataTable("select tcp.ID,te.RealName from TE_Companys_Partner tcp left join TU_Users te on tcp.EmployeeID=te.UserID where tcp.CompanyId=" + companyId + " and Legal=1 order by ID asc"); for (int i = 0; i < frdt.Rows.Count; i++) { this.txtFRManage.Text += "<a href='Dept_CompanysPartnerEdit.aspx?companyID=" + companyId + "&id=" + frdt.Rows[i]["ID"] + "'>" + frdt.Rows[i]["RealName"] + "</a> "; } frdt = ULCode.QDA.XSql.GetDataTable("select tcp.ID,te.RealName from TE_Companys_Partner tcp left join TU_Users te on tcp.EmployeeID=te.UserID where tcp.CompanyId=" + companyId + " and Directors=1 order by ID asc"); for (int i = 0; i < frdt.Rows.Count; i++) { this.txtDSHList.Text += "<a href='Dept_CompanysPartnerEdit.aspx?companyID=" + companyId + "&id=" + frdt.Rows[i]["ID"] + "'>" + frdt.Rows[i]["RealName"] + "</a> "; } frdt = ULCode.QDA.XSql.GetDataTable("Select ID,Title from [TE_Companys_license] where CompanyId=" + companyId + " and Type=4 order by ID asc"); for (int i = 0; i < frdt.Rows.Count; i++) { this.txtqzsp.Text += "<a href='Dept_CompanyslicenseEdit.aspx?companyID=" + companyId + "&id=" + frdt.Rows[i]["ID"] + "'>" + frdt.Rows[i]["Title"] + "</a> "; } frdt = ULCode.QDA.XSql.GetDataTable("Select top 8 ID,Type,content from [TE_Companys_Logs] where CompanyId=" + companyId + " and type=3 order by ID desc"); for (int i = 0; i < frdt.Rows.Count; i++) { this.txtgsbg.Text += frdt.Rows[i]["content"] + " "; } this.txtgsbg.Text += "<b><a href='Dept_Companyslog.aspx?companyID=" + companyId + "&type=3'>>>更多</a></b>"; frdt = ULCode.QDA.XSql.GetDataTable("Select ID,Name from [TE_Companys] where LinkID=" + companyId + " and ID!=" + companyId + " order by Linktype asc"); for (int i = 0; i < frdt.Rows.Count; i++) { this.txtglcmp.Text += "<a href='Dept_CompanyDetail.aspx?id=" + frdt.Rows[i]["ID"] + "'>" + frdt.Rows[i]["Name"] + "</a> "; } DataTable list = ULCode.QDA.XSql.GetDataTable("Select tcl.ID,tcl.Title,tcl.Valid,tcl.Validstop,tcl.CheckTime,tcl.CheckstopTime,tcl.IsCheck,tcl.CheckManage,tcl.CompanyId,te.RealName from [TE_Companys_license] tcl left join TU_Users te on tcl.Manage=te.UserID where tcl.CompanyId=" + companyId + " and tcl.Type in(1,4) order by ID asc"); DataList1.DataSource = list; DataList1.DataBind(); this.txtbankname.Text = company.BankName.ToString(); this.txtbankaccount.Text = company.BankAccount.ToString(); this.txtZip.Text = company.Zip.ToString(); this.txtSite.Text = company.Site.ToString(); this.txtEmail.Text = company.Email.ToString(); this.txtAddress.Text = company.Address.ToString(); //this.txtAccount.Text = company.BankAccount.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { if (!WX.Request.IsNumber("CompanyID", true)) { return; } int companyId = WX.Request.rCompanyId; Company.MODEL company = Company.GetRequestedModel();//Company.GetModel("SELECT TOP 1 * FROM TE_Companys WHERE ID=" + companyId); if (company != null) { // this.liTitle.Text = company.Name.ToString(); this.txtCompanyNO.Text = company.NO.ToString(); this.txtCompanyName.Text = company.Name.ToString(); this.li_Manage.Text = WX.CommonUtils.GetRealNameListByUserIdList(company.Manage.ToString()); this.txtCtype.Text = company.Ctype.ToString(); try { this.txtSetuptime.Text = Convert.ToDateTime(company.Setuptime.ToString()).ToString("yyyy-MM-dd"); } catch { } try { this.txtOperatetime.Text = Convert.ToDateTime(company.Operatetime.ToString()).ToString("yyyy-MM-dd"); } catch { } this.txtOperate.Text = company.Operate.ToString(); this.txtUptime.Text = Convert.ToDateTime(company.Uptime.ToString()).ToString("yyyy-MM-dd HH:mm:ss"); this.txtRoute.Text = company.Route.ToString().Replace("\n", "<br/>"); this.txtIntroduction.Text = company.Introduction.ToString(); this.txtTelephone.Text = company.Tel.ToString(); this.txtFax.Text = company.Fax.ToString();//Dept_CompanysPartnerEdit.aspx?companyID=11&id=14 DataTable frdt = ULCode.QDA.XSql.GetDataTable("select tcp.ID,te.RealName from TE_Companys_Partner tcp left join TU_Users te on tcp.EmployeeID=te.UserID where tcp.CompanyId=" + companyId + " and Legal=1 order by ID asc"); for (int i = 0; i < frdt.Rows.Count; i++) { this.txtFRManage.Text += "<a href='Dept_CompanysPartnerEdit.aspx?companyID=" + companyId + "&id=" + frdt.Rows[i]["ID"] + "'>" + frdt.Rows[i]["RealName"] + "</a> "; } frdt = ULCode.QDA.XSql.GetDataTable("select tcp.ID,te.RealName from TE_Companys_Partner tcp left join TU_Users te on tcp.EmployeeID=te.UserID where tcp.CompanyId=" + companyId + " and Directors=1 order by ID asc"); for (int i = 0; i < frdt.Rows.Count; i++) { this.txtDSHList.Text += "<a href='Dept_CompanysPartnerEdit.aspx?companyID=" + companyId + "&id=" + frdt.Rows[i]["ID"] + "'>" + frdt.Rows[i]["RealName"] + "</a> "; } DataTable list = ULCode.QDA.XSql.GetDataTable("Select tcl.ID,tcl.Title,tcl.Valid,tcl.Validstop,tcl.CheckTime,tcl.CheckstopTime,tcl.IsCheck,tcl.CheckManage,tcl.CompanyId,te.RealName from [TE_Companys_license] tcl left join TU_Users te on tcl.Manage=te.UserID where tcl.CompanyId=" + companyId + " and tcl.Type in(1,4) order by ID asc"); DataList1.DataSource = list; DataList1.DataBind(); this.txtbankname.Text = company.BankName.ToString(); this.txtbankaccount.Text = company.BankAccount.ToString(); this.txtZip.Text = company.Zip.ToString(); this.txtSite.Text = company.Site.ToString(); this.txtEmail.Text = company.Email.ToString(); this.txtAddress.Text = company.Address.ToString(); this.txtAccount.Text = company.BankAccount.ToString(); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Master.A_Edit) { Response.Write("你没有权限访问此功能!"); Response.End(); } if (!IsPostBack) { int id = WX.Request.rDepartmentId; int companyId = WX.Request.rCompanyId; if (id > 0) { //string cmdText = "SELECT * FROM TE_Departments WHERE ID=" + id + " AND CompanyId=" + companyId; Department.MODEL department = WX.Request.rDepartment; //Department.GetModel(cmdText); Company.MODEL company = WX.Request.rCompany; this.CompanyName.Text = company.Name.ToString(); //XSql.GetValue("SELECT Name FROM TE_Companys WHERE ID=" + companyId).ToString(); this.txtDepartmentNO.Text = department.NO.f("{0}"); WX.Data.Dict.BindListCtrl_DeptList(this.ddlParentId, null, "0#无上级部门", department.ParentID.ToString()); this.txtDepartmentName.Text = department.Name.ToString(); this.txtPhone.Text = department.Tel.ToString(); this.txtFax.Text = department.Fax.ToString(); this.txtAddress.Text = department.Address.ToString(); this.txtSort.Text = department.Sort.ToString(); this.txtContent.Text = department.Content.ToString(); this.chkIsSubOrgan.Checked = string.IsNullOrEmpty(department.IsSubOrgan.ToString()) ? false : true; this.hidden_txtHost.Value = department.Host.ToString(); this.txtHost.Text = CommonUtils.GetRealNameListByUserIdList(department.Host.ToString()); this.hidden_txtSubHosts.Value = department.SubHosts.ToString(); this.txtSubHosts.Text = CommonUtils.GetRealNameListByUserIdList(department.SubHosts.ToString()); this.hidden_txtAssistants.Value = department.Assistants.ToString(); this.txtAssistants.Text = CommonUtils.GetRealNameListByUserIdList(department.Assistants.ToString()); this.hidden_txtUpHost.Value = department.UpHost.ToString(); this.txtUpHost.Text = CommonUtils.GetRealNameListByUserIdList(department.UpHost.ToString()); this.hidden_txtUpSubHosts.Value = department.UpSubHosts.ToString(); this.txtUpSubHosts.Text = CommonUtils.GetRealNameListByUserIdList(department.UpSubHosts.ToString()); } else { Response.Write("部门编号格式不正确!"); Response.End(); return; } } }
protected void btnSave_Click(object sender, EventArgs e) { int companyId = WX.Request.rCompanyId; //1.验证用户权限 if (!this.Master.A_Edit) { Response.Write("你没有权限访问此功能!"); Response.End(); return; } //2.取得用户变量 string no = this.txtCompanyNO.Text.Trim(); string companyName = this.txtCompanyName.Text.Trim(); string introduction = this.txtIntroduction.Text.Trim(); string telephone = this.txtTelephone.Text.Trim(); string fax = this.txtFax.Text.Trim(); string zip = this.txtZip.Text.Trim(); string site = this.txtSite.Text.Trim(); string email = this.txtEmail.Text.Trim(); string address = this.txtAddress.Text.Trim(); string account = this.txtAccount.Text.Trim(); //3.验证用户变量 if (Request["CompanyID"] != null) { //4.处理业务 Company.MODEL company = Company.GetRequestedModel(); //Company.GetModel("select * from TE_Companys where ID=" + companyId);//Company.GetModel("SELECT * FROM TE_Companys WHERE ID=" + companyId); this.liTitle.Text = company.Name.ToString(); if (Request["del"] != null) { WX.Main.ExecuteDelete("TE_Companys", "ID", companyId.ToString()); string logstr = (company.Linktype.ToString() == "0" ? "母" : (company.Linktype.ToString() == "2" ? "子" : "")) + "公司删除!-" + "(id-" + company.ID.ToString() + ",no-" + company.NO.ToString() + ") " + company.Name.ToString(); WX.Model.Company.AddLogs(Convert.ToInt32(company.ID.value), 2, logstr + "[" + ui_logcontent.Text + "]", WX.Main.CurUser.UserID, ui_logmanage.Value, Request.UserHostAddress); //7.返回页面 ULCode.Debug.Alert(this, "删除成功!", "Dept_Company.aspx"); return; } company.NO.value = no; company.Name.value = companyName; company.Manage.value = txtManage.Value; company.Ctype.value = txtCtype.Text; company.Setuptime.value = txtSetuptime.Text; company.Operate.value = txtOperate.Text; company.Operatetime.value = txtOperatetime.Text; company.Route.value = txtRoute.Text; company.Introduction.value = introduction; company.Tel.value = telephone; company.Fax.value = fax; company.Zip.value = zip; company.Site.value = site; company.Email.value = email; company.Address.value = address; company.BankName.value = txtBankname.Text; company.BankAccount.value = account; company.Uptime.value = DateTime.Now; company.Ctype.value = txtCtype.Text; company.State.value = false; int row = company.Update(); if (row != 0) { //5.(用户及业务对象)统计与状态 //6.登记日志 string logstr = (company.Linktype.ToString() == "0" ? "母" : (company.Linktype.ToString() == "2" ? "子" : "")) + "公司信息修改成功!-" + "(id-" + company.ID.ToString() + ",no-" + company.NO.ToString() + ")" + company.Name.ToString(); WX.Model.Company.AddLogs(Convert.ToInt32(company.ID.value), 1, logstr + "[" + ui_logcontent.Text + "]", WX.Main.CurUser.UserID, ui_logmanage.Value, Request.UserHostAddress); //7.返回页面 ULCode.Debug.Alert(this, "公司信息修改成功!", "Dept_CompanyDetail.aspx?CompanyID=" + companyId); } else { company.RestoreInitial(); ULCode.Debug.Alert(this, "公司信息修改失败!"); } } else if (Request["ltype"] != null) { Company.MODEL company = Company.NewDataModel();//Company.GetModel("SELECT * FROM TE_Companys WHERE ID=" + companyId); company.NO.value = no; company.Name.value = companyName; company.Manage.value = txtManage.Value; company.Ctype.value = txtCtype.Text; company.Setuptime.value = txtSetuptime.Text; company.Operate.value = txtOperate.Text; company.Operatetime.value = txtOperatetime.Text; company.Route.value = txtRoute.Text; company.Introduction.value = introduction; company.Tel.value = telephone; company.Fax.value = fax; company.Zip.value = zip; company.Site.value = site; company.Email.value = email; company.Address.value = address; company.BankName.value = txtBankname.Text; company.BankAccount.value = account; company.Uptime.value = DateTime.Now; company.Ctype.value = txtCtype.Text; company.LinkID.value = Request["lid"]; company.Linktype.value = Request["ltype"]; company.State.value = false; int id = company.Insert(true); if (id > 0) { //5.(用户及业务对象)统计与状态 //6.登记日志 company.SaveIntoCaches(); string logstr = "添加一个" + (company.Linktype.ToString() == "0" ? "母" : "子") + "公司!-" + "(id-" + id.ToString() + ",no-" + company.NO.ToString() + ")" + company.Name.ToString(); WX.Model.Company.AddLogs(id, 0, logstr + "[" + ui_logcontent.Text + "]", WX.Main.CurUser.UserID, ui_logmanage.Value, Request.UserHostAddress); //7.返回页面 ULCode.Debug.Alert(this, "添加成功!", "Dept_Company.aspx"); } else { ULCode.Debug.Alert(this, "公司信息添加失败!"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!this.Master.A_Edit) { Response.Write("你没有权限访问此功能!"); Response.End(); return; } if (!IsPostBack) { //1.用户验证 //2.是否为删除按钮 if (Request["del"] != null) { Button1.Visible = true; } //3.装载 if (Request["CompanyID"] != null) { if (!WX.Request.IsNumber("CompanyID", true)) { return; } Company.MODEL company = Company.GetRequestedModel(); //Company.GetModel("select * from TE_Companys where ID=" + companyId);//Company.GetModel("SELECT TOP 1 * FROM TE_Companys WHERE ID=" + companyId); this.liTitle.Text = company.Name.ToString(); //if (WX.Main.CurUser.UserID != company.Manage.ToString()) //{ // Response.Write("你没有权限访问此功能!!"); // Response.End(); // return; //} //if (company.State.ToString() == "" || Convert.ToBoolean(company.State.ToString()) == false) //{ // Response.Write("须按流程审批后方可修改此信息!"); // Response.End(); // return; //} this.txtCompanyNO.Text = company.NO.ToString(); this.txtCompanyName.Text = company.Name.ToString(); this.txtManage.Value = company.Manage.ToString(); this.li_Manage.Text = WX.CommonUtils.GetRealNameListByUserIdList(company.Manage.ToString()); this.txtCtype.Text = company.Ctype.ToString(); try { this.txtSetuptime.Text = Convert.ToDateTime(company.Setuptime.ToString()).ToString("yyyy-MM-dd"); } catch { } try { this.txtOperatetime.Text = Convert.ToDateTime(company.Operatetime.ToString()).ToString("yyyy-MM-dd"); } catch { } this.txtOperate.Text = company.Operate.ToString(); this.txtRoute.Text = company.Route.ToString(); this.txtIntroduction.Text = company.Introduction.ToString(); this.txtTelephone.Text = company.Tel.ToString(); this.txtFax.Text = company.Fax.ToString(); this.txtZip.Text = company.Zip.ToString(); this.txtSite.Text = company.Site.ToString(); this.txtEmail.Text = company.Email.ToString(); this.txtAddress.Text = company.Address.ToString(); this.txtBankname.Text = company.BankName.ToString(); this.txtAccount.Text = company.BankAccount.ToString(); } else if (Request["ltype"] != null) { MenuBar1.Param1 = "{Q:lid}"; this.MenuBar1.Key = "com"; this.MenuBar1.CurIndex = 2; switch (Convert.ToInt32(Request["ltype"])) { case 2: this.liTitle.Text = "你正在添加母公司"; break; case 3: this.liTitle.Text = "你正在添加子公司"; break; case 4: this.liTitle.Text = "你正在添加控股公司"; break; } } } }
private void FillDataCtrl() { Employee.MODEL employee; WX.Model.User.MODEL usermodel; if (WX.Request.rUserId != null) { employee = WX.Request.rEmpolyee; usermodel = WX.Request.rUser; } else { WX.Main.CurUser.LoadUserModel(false); employee = Employee.GetModel("SELECT * FROM TU_Employees WHERE UserID='" + WX.Main.CurUser.UserID + "'"); usermodel = WX.Main.CurUser.UserModel; } if (employee.LoadSucceed || true) { Department.MODEL dept = Department.GetCache(usermodel.DepartmentID.ToInt32()); if (dept != null) { lblDeptName.Text = dept.Name.ToString(); } DutyDetail.MODEL duty = DutyDetail.GetCache(usermodel.DutyId.ToInt32()); if (duty != null) { lblDutyName.Text = duty.Name.ToString(); } Company.MODEL cmp = Company.GetCache(usermodel.CompanyID.ToInt32()); if (cmp != null) { lblCompanyName.Text = cmp.Name.ToString(); } //this.ddlCompany.SelectedItem.Value = employee.CompanyID.ToString(); deptId = usermodel.DepartmentID.ToString(); this.lblRealName.Text = usermodel.RealName.ToString(); this.lblIdCard.Text = employee.IDCard.ToString(); //this.ddlPosition.SelectedItem.Value = employee.DutyId.ToString(); this.lblBirthday.Text = employee.Birthday.f("{0:yyyy年MM月dd日}"); this.lblMoblie.Text = employee.Mobile.ToString(); this.lblSex.Text = employee.Sex.ToBoolean() ? "男" : "女"; this.lblQQ.Text = employee.QQ.ToString(); this.lblEmail.Text = employee.Email.ToString(); this.lblTelephone.Text = employee.Tel.ToString(); string[] addrarry = employee.Address.ToString().Split('|'); if (addrarry.Length > 1) { this.lblAddress.Text = addrarry[0].Split(':')[0] + " " + addrarry[0].Split(':')[1]; this.lblAddress2.Text = addrarry[1].Split(':')[0] + " " + addrarry[1].Split(':')[1]; } if (employee.UserFace.isEmpty) { this.liPreZoomImage.Text = "<img id=\"preZoomImage\" src=\"/Images/NoPhoto.gif\" alt=\"\" style=\"width: 100%; height: 100%;\" />"; } else { this.liPreZoomImage.Text = "<img id=\"preZoomImage\" src=\"" + (employee.UserFace.ToString()) + "\" alt=\"\" style=\"width: 100%; height: 100%; \" />"; } this.lblContent.Text = employee.Introduction.ToString(); WX.Model.EmployeeCredential.MODEL model = WX.Model.EmployeeCredential.GetModel("Select top 1 * from [TU_Employees_Credentials] where Name='身份证扫描件'"); if (model != null) { cardannex.Text = "<a href=\"javascript:PopupIFrame('Priv_CredentialsDetail.aspx?Id=" + model.Id.ToString() + "','查看详细','','',1000,800)\">查看扫描件</a>"; } } }