private void getType() { IList <CusType> com = CusTypeManager.getCusTypeAll(); this.rpCusType.DataSource = com; this.rpCusType.DataBind(); }
//加载基本信息 private void loadcus() { string cusid = Request.QueryString["id"].ToString(); EtNet_Models.Customer cus = CustomerManager.getCustomerById(Convert.ToInt32(cusid)); this.cusshortname.Value = cus.CusshortName.ToString(); this.cusCName.Value = cus.CusCName.ToString(); this.cusCAddress.Value = cus.CusCAddress.ToString(); this.companyURL.Value = cus.CompanyURL.ToString(); this.rbPro.SelectedValue = cus.CusPro.ToString(); this.address.Text = cus.Province.ToString() + " " + cus.City.ToString(); //this.txtcustype.Text = CusTypeManager.getCusTypeById(cus.CusType).TypeName.ToString(); this.lblMadeFrom.Value = LoginInfoManager.getLoginInfoById(((LoginInfo)Session["login"]).Id).Cname; this.lblMadeTime.Value = DateTime.Now.ToString("yyyy-MM-dd"); //this.rbUsed.SelectedValue = cus.Used.ToString(); int id = cus.CusType; if (id > 0) { this.TxtType.Text = CusTypeManager.getCusTypeById(cus.CusType).TypeName; } else { this.TxtType.Text = ""; } this.HidTypeID.Value = cus.CusType.ToString(); //主要联系人 this.linkName.Value = cus.LinkName.ToString(); this.linkPost.Value = cus.Post.ToString(); this.linkTel.Value = cus.Telephone.ToString(); this.linkMobile.Value = cus.Mobile.ToString(); this.linkFax.Value = cus.Fax.ToString(); this.linkEmail.Value = cus.Email.ToString(); this.linkMsn.Value = cus.Msn.ToString(); this.linkSkype.Value = cus.Skype.ToString(); //主要银行信息 this.bankName.Value = cus.Bank.ToString(); this.bankCard.Value = cus.CardId.ToString(); this.bankMan.Value = cus.CardName.ToString(); this.bankremark.Value = cus.Remark.ToString(); RuleSet(cusid); }
protected void rpCusType_ItemCommand(object source, RepeaterCommandEventArgs e) { if (e.CommandName == "Delete") { string id = e.CommandArgument.ToString(); IList <Customer> cop = CustomerManager.getCustomerType(Convert.ToInt32(id)); if (cop.Count > 0) { this.Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('正在使用中的类型不能删除!');", true); } else { CusTypeManager.deleteCusType(Convert.ToInt32(id)); } } getType(); }
protected void imgbtnsave_Click(object sender, ImageClickEventArgs e) { if (tbxTypeName.Text.ToString() == "") { this.lblTypename.Text = "<span style='Color:red'>类别名称不能为空!<span>"; } else if (Checktypename(tbxTypeName.Text.ToString()) > 0) { this.lblTypename.Text = "<span style='Color:red'>类别名称已存在<span>"; } else { CusType type = new CusType(); type.TypeName = this.tbxTypeName.Text.ToString(); type.Typeremark = this.tbxTypeRemark.Text.ToString(); CusTypeManager.addCusType(type); getAddType(); this.tbxTypeName.Text = ""; this.lblTypename.Text = ""; } }
public int Checktypename(string typename) { int count = CusTypeManager.getCusTypeBytypename(typename); return(count); }