/// <summary> /// 绑定数据源 /// </summary> private void BindSource() { EyouSoft.BLL.CrmStructure.BCrm bCrm = new EyouSoft.BLL.CrmStructure.BCrm(); EyouSoft.Model.CrmStructure.MCrm mCrm = bCrm.GetInfo(SiteUserInfo.TourCompanyInfo.CompanyId); //查询国家、省市区域的 EyouSoft.BLL.ComStructure.BComCity bComCity = new EyouSoft.BLL.ComStructure.BComCity(); EyouSoft.Model.ComStructure.MCPCC m = bComCity.GetCPCD(CurrentUserCompanyID, mCrm.CountryId, mCrm.ProvinceId, mCrm.CityId, mCrm.CountyId); if (m != null) { this.lblCountry.Text = m.CountryName; this.lblProvice.Text = m.ProvinceName; this.lblCity.Text = m.CityName; this.lblCounty.Text = m.CountyName; } this.lblName.Text = mCrm.Name; this.lblAddress.Text = mCrm.Address; this.lblOrganizationCode.Text = mCrm.OrganizationCode; this.lblLegalRepresentative.Text = mCrm.LegalRepresentative; this.lblLegalRepresentativeMobile.Text = mCrm.LegalRepresentativeMobile; this.lblLegalRepresentativePhone.Text = mCrm.LegalRepresentativePhone; this.lblLicense.Text = mCrm.License; this.lblFinancialName.Text = mCrm.FinancialName; this.lblFinancialPhone.Text = mCrm.FinancialPhone; this.lblFinancialMobile.Text = mCrm.FinancialMobile; //查询销售员 EyouSoft.BLL.ComStructure.BComUser bUser = new EyouSoft.BLL.ComStructure.BComUser(); EyouSoft.Model.ComStructure.MComUser user = bUser.GetModel(mCrm.SellerId, SiteUserInfo.CompanyId); if (null != user) { this.lblSeller.Text = user.UserName; } this.lblBrevityCode.Text = mCrm.BrevityCode; this.lblRebatePolicy.Text = mCrm.RebatePolicy; }
/// <summary> /// 获取当前用户的明文密码 /// </summary> /// <returns></returns> private string GetPassword() { EyouSoft.BLL.ComStructure.BComUser BUser = new EyouSoft.BLL.ComStructure.BComUser(); EyouSoft.Model.ComStructure.MComUser User = BUser.GetModel(SiteUserInfo.UserId, SiteUserInfo.CompanyId); return(User.Password); }
private void Bind() { if (!string.IsNullOrEmpty(EyouSoft.Common.Utils.GetQueryStringValue("crmId"))) { EyouSoft.Model.CrmStructure.MCrm crmModel = crmBll.GetInfo(EyouSoft.Common.Utils.GetQueryStringValue("crmId")); if (crmBll != null) { lblAddress.Text = crmModel.Address; lblBrevityCode.Text = crmModel.BrevityCode; lblAmountOwed.Text = crmModel.AmountOwed.ToString("C"); EyouSoft.Model.ComStructure.MCPCC cpccModel = cityBll.GetCPCD(crmModel.CompanyId, crmModel.CountryId, crmModel.ProvinceId, crmModel.CityId, crmModel.CountyId); lblCity.Text = cpccModel.CityName; lblCountry.Text = cpccModel.CountryName; lblCounty.Text = cpccModel.CountyName; lblProvince.Text = cpccModel.ProvinceName; lblDeadline.Text = crmModel.Deadline.ToString(); lblFinancialMobile.Text = crmModel.FinancialMobile; lblFinancialName.Text = crmModel.FinancialName; lblFinancialPhone.Text = crmModel.FinancialPhone; lblIsSignContract.Text = (!crmModel.IsSignContract) ? "否" : "是"; lblLegalRepresentative.Text = crmModel.LegalRepresentative; lblLegalRepresentativeMobile.Text = crmModel.LegalRepresentativeMobile; lblLegalRepresentativePhone.Text = crmModel.LegalRepresentativePhone; lblLicense.Text = crmModel.License; lblName.Text = crmModel.Name; lblOrganizationCode.Text = crmModel.OrganizationCode; //lblRebatePolicy.Text = crmModel.RebatePolicy; lblSellerId.Text = crmModel.SellerName; if (crmModel.BankList != null && crmModel.BankList.Count > 0) { rptBank.DataSource = crmModel.BankList; rptBank.DataBind(); } else { phYinHangZhangHuEmpty.Visible = true; } if (crmModel.LinkManList != null && crmModel.LinkManList.Count > 0) { for (int i = 0; i < crmModel.LinkManList.Count; i++) { EyouSoft.Model.ComStructure.MComUser userModel = userBll.GetModel(crmModel.LinkManList[i].UserId, base.SiteUserInfo.CompanyId); string html = string.Empty; if (userModel != null) { html = string.Format("<table cellspacing='0' cellpadding='0' border='0' width='100%' class='pp-tableclass'><tr class='pp-table-title'><th height='23' align='center'>帐号</th><th align='center'>密码</th><th height='23' align='center'>状态</th></tr><tr ><td align='center'>{0}</td><td align='center'>{1}</td><td align='center'>{2}</td></tr></table>", userModel.UserName, userModel.Password, userModel.UserStatus.ToString()); userListString.Add(crmModel.LinkManList[i].UserId, html); } } rptLinkMan.DataSource = crmModel.LinkManList; rptLinkMan.DataBind(); } if (crmModel.AttachModel != null) { filename = crmModel.AttachModel.Name; filepath = crmModel.AttachModel.FilePath; } } } }
protected void Save() { EyouSoft.Model.ComStructure.MComUser model = new EyouSoft.Model.ComStructure.MComUser(); //内部用户为string.Empty,客户单位或供应商就是相就的公司编号 model.TourCompanyId = string.Empty; model.CompanyId = SiteUserInfo.CompanyId; model.UserName = txtUserName.Text; model.Password = Utils.GetFormValue("txtPwd"); model.ContactName = Utils.GetFormValue(HrSelect1.HrSelectNameClient); model.GovFileId = Utils.GetFormValue(HrSelect1.HrSelectIDClient); model.ContactSex = Convert.ToChar(ddlSex.SelectedValue); model.DeptId = Utils.GetInt(Utils.GetFormValue(BelongDepart.SelectIDClient)); model.DeptIdJG = Utils.GetInt(Utils.GetFormValue(ManageDepart.SelectIDClient)); model.Arrears = Utils.GetDecimal(txtDebt.Value); model.ContactTel = txtPhone.Value; model.ContactFax = txtFax.Value; model.ContactMobile = txtMobile.Value; model.QQ = txtQQ.Value; model.MSN = txtMSN.Value; model.ContactEmail = txtEmail.Value; model.PeopProfile = txtIntroduction.Text; model.Remark = txtRemark.Text; model.RoleId = Utils.GetInt(Utils.GetFormValue(ddlRoleList.ClientID)); model.Operator = SiteUserInfo.Name; model.OperatorId = SiteUserInfo.UserId; model.OperDeptId = SiteUserInfo.DeptId; //model.UserStatus = chkState.Checked; Response.Clear(); if (string.IsNullOrEmpty(UserID)) { model.UserType = EyouSoft.Model.EnumType.ComStructure.UserType.内部员工; if (!new EyouSoft.BLL.ComStructure.BComUser().IsExistsUserName(model.UserName, SiteUserInfo.CompanyId, string.Empty)) { if (new EyouSoft.BLL.ComStructure.BComUser().Add(model)) { Response.Write(UtilsCommons.AjaxReturnJson("1", "添加成功!")); } else { Response.Write(UtilsCommons.AjaxReturnJson("0", "添加失败!")); } } else { Response.Write(UtilsCommons.AjaxReturnJson("0", "用户名已存在!")); } } else { model.UserId = UserID; if (new EyouSoft.BLL.ComStructure.BComUser().Update(model)) { Response.Write(UtilsCommons.AjaxReturnJson("1", "修改成功!")); } else { Response.Write(UtilsCommons.AjaxReturnJson("0", "修改失败!")); } } Response.End(); }