⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 clientui.cs

📁 动易SiteFactory&#8482 网上商店系统1.0源代码
💻 CS
📖 第 1 页 / 共 2 页
字号:
                            {
                                flag2 = Company.Update(companyInfo);
                                flag3 = true;
                            }
                            else
                            {
                                flag3 = Contacter.Update(contacterInfo);
                                flag2 = true;
                            }
                        }
                        else if (num2 == 0)
                        {
                            Contacter.Delete(this.HdnContacterId.Value);
                            flag2 = Company.Add(companyInfo);
                            flag3 = true;
                        }
                        else
                        {
                            Company.Delete(DataConverter.CLng(this.HdnCompanyId.Value));
                            flag3 = Contacter.Add(contacterInfo);
                            flag2 = true;
                        }
                    }
                }
                else
                {
                    flag = Client.Add(clientInfo);
                    if (flag)
                    {
                        if (num2 == 0)
                        {
                            flag2 = Company.Add(companyInfo);
                            flag3 = true;
                        }
                        else
                        {
                            flag3 = Contacter.Add(contacterInfo);
                            flag2 = true;
                        }
                    }
                }
                if ((flag && flag2) && flag3)
                {
                    AdminPage.WriteSuccessMsg("保存客户资料成功!", "ClientManage.aspx");
                }
                else
                {
                    AdminPage.WriteErrMsg("保存客户资料失败!", "");
                }
            }
        }

        protected string IsShow(int condition)
        {
            string str = "";
            if (DataConverter.CLng(this.RadlClientType.SelectedValue) != condition)
            {
                str = "display:none";
            }
            return str;
        }

        protected void ModifyInitialize()
        {
            ClientInfo clientById = new ClientInfo();
            int clientId = DataConverter.CLng(this.HdnClientId.Value);
            clientById = Client.GetClientById(clientId);
            if (!clientById.IsNull)
            {
                Choiceset.DropDownListDataBind("PE_Client", "Area", this.DropArea, clientById.Area);
                Choiceset.DropDownListDataBind("PE_Client", "ClientField", this.DropClientField, clientById.ClientField);
                Choiceset.DropDownListDataBind("PE_Client", "ValueLevel", this.DropValueLevel, clientById.ValueLevel);
                Choiceset.DropDownListDataBind("PE_Client", "CreditLevel", this.DropCreditLevel, clientById.CreditLevel);
                Choiceset.DropDownListDataBind("PE_Client", "Importance", this.DropImportance, clientById.Importance);
                Choiceset.DropDownListDataBind("PE_Client", "ConnectionLevel", this.DropConnectionLevel, clientById.ConnectionLevel);
                Choiceset.DropDownListDataBind("PE_Client", "SourceType", this.DropSourceType, clientById.SourceType);
                Choiceset.DropDownListDataBind("PE_Client", "PhaseType", this.DropPhaseType, clientById.PhaseType);
                Choiceset.DropDownListDataBind("PE_Client", "GroupID", this.DropGroupID, clientById.GroupId);
                this.TxtClientName.Text = clientById.ClientName;
                this.TxtClientNum.Text = clientById.ClientNum;
                this.TxtShortedForm.Text = clientById.ShortedForm;
                this.ClientSelect.Text = Client.GetClientNameById(clientById.ParentId);
                this.ClientSelect.DataKey = clientById.ParentId.ToString();
                this.RadlClientType.SelectedValue = clientById.ClientType.ToString();
                this.TxtRemark.Text = clientById.Remark;
                this.HdnClientType.Value = clientById.ClientType.ToString();
                if (DataConverter.CLng(this.RadlClientType.SelectedValue) == 1)
                {
                    ContacterInfo contacterByClientId = Contacter.GetContacterByClientId(clientId);
                    if (!contacterByClientId.IsNull)
                    {
                        this.HdnContacterId.Value = contacterByClientId.ContacterId.ToString();
                        this.PersonalInformation1.SetContacter(contacterByClientId);
                        this.LiaisonInformation1.SetContacter(contacterByClientId);
                        this.TxtCompany.Text = contacterByClientId.Company;
                        this.TxtDepartment.Text = contacterByClientId.Department;
                        this.TxtPosition.Text = contacterByClientId.Position;
                        this.TxtOperation.Text = contacterByClientId.Operation;
                        this.TxtTitle.Text = contacterByClientId.Title;
                        this.TxtCompanyAddress.Text = contacterByClientId.CompanyAddress;
                    }
                    else
                    {
                        AdminPage.WriteErrMsg("找不到对应的个人客户信息!", "ClientManage.aspx");
                    }
                }
                else
                {
                    CompanyInfo companyByClientId = new CompanyInfo();
                    companyByClientId = Company.GetCompanyByClientId(clientId);
                    if (!companyByClientId.IsNull)
                    {
                        this.HdnCompanyId.Value = companyByClientId.CompanyId.ToString();
                        Choiceset.DropDownListDataBind("PE_Company", "StatusInField", this.DropStatusInField, companyByClientId.StatusInField);
                        Choiceset.DropDownListDataBind("PE_Company", "CompanySize", this.DropCompanySize, companyByClientId.CompanySize);
                        Choiceset.DropDownListDataBind("PE_Company", "ManagementForms", this.DropManagementForms, companyByClientId.ManagementForms);
                        this.Region.Action = "Modify";
                        this.Region.Country = companyByClientId.Country;
                        this.Region.Province = companyByClientId.Province;
                        this.Region.City = companyByClientId.City;
                        this.TxtAddress.Text = companyByClientId.Address;
                        this.TxtZipCode.Text = companyByClientId.ZipCode;
                        this.TxtPhone.Text = companyByClientId.Phone;
                        this.TxtFax1.Text = companyByClientId.Fax;
                        this.TxtBankOfDeposit.Text = companyByClientId.BankOfDeposit;
                        this.TxtBankAccount.Text = companyByClientId.BankAccount;
                        this.TxtTaxNum.Text = companyByClientId.TaxNum;
                        this.TxtHomepage1.Text = companyByClientId.Homepage;
                        this.TxtBusinessScope.Text = companyByClientId.BusinessScope;
                        this.TxtAnnualSales.Text = companyByClientId.AnnualSales;
                        this.TxtRegisteredCapital.Text = companyByClientId.RegisteredCapital;
                    }
                    else
                    {
                        AdminPage.WriteErrMsg("找不到对应的企业信息!", "ClientManage.aspx");
                    }
                }
                this.BtnSave.Text = "保存修改结果";
            }
            else
            {
                AdminPage.WriteErrMsg("找不到指定的客户!", "ClientManage.aspx");
            }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.Page.IsPostBack)
            {
                this.HdnAdminName.Value = PEContext.Current.Admin.AdminName;
                this.m_Action = BasePage.RequestString("Action", "Add");
                this.HdnAction.Value = this.m_Action;
                this.RadlClientType.SelectedValue = BasePage.RequestInt32("ClientType").ToString();
                if (this.m_Action == "Modify")
                {
                    this.HdnClientId.Value = BasePage.RequestInt32("ClientID").ToString();
                    this.ModifyInitialize();
                }
                else
                {
                    this.AddInitialize();
                }
            }
        }

        protected void RadlClientType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (((this.HdnAction.Value == "Modify") && (this.HdnClientType.Value != this.RadlClientType.SelectedValue)) && (DataConverter.CLng(this.RadlClientType.SelectedValue) != 1))
            {
                Choiceset.DropDownListDataBind("PE_Company", "StatusInField", this.DropStatusInField);
                Choiceset.DropDownListDataBind("PE_Company", "CompanySize", this.DropCompanySize);
                Choiceset.DropDownListDataBind("PE_Company", "ManagementForms", this.DropManagementForms);
            }
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -