Ejemplo n.º 1
0
 protected void Save_Btn(object sender, EventArgs e)
 {
     if (!string.IsNullOrEmpty(base.Request.QueryString["cid"]))
     {
         CRM_SupInfo cRM_SupInfo = this.ViewState["ci"] as CRM_SupInfo;
         if (cRM_SupInfo != null && cRM_SupInfo.CreatorID == Convert.ToInt32(this.Uid))
         {
             cRM_SupInfo.MainPeople = this.MainPeople.Value;
             cRM_SupInfo.Notes      = this.Notes.Value;
             cRM_SupInfo.Sup_Name   = this.Sup_Name.Value;
             cRM_SupInfo.Tel        = this.Tel.Value;
             cRM_SupInfo.Addr       = this.Addr.Value;
             CRM_Sup.Init().Update(cRM_SupInfo);
             string str = HttpContext.Current.Server.HtmlEncode("您好!供应商信息已保存成功!");
             base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
         }
     }
     else
     {
         CRM_SupInfo cRM_SupInfo = new CRM_SupInfo();
         cRM_SupInfo.MainPeople      = this.MainPeople.Value;
         cRM_SupInfo.Notes           = this.Notes.Value;
         cRM_SupInfo.Sup_Name        = this.Sup_Name.Value;
         cRM_SupInfo.Tel             = this.Tel.Value;
         cRM_SupInfo.Addr            = this.Addr.Value;
         cRM_SupInfo.CreatorDepName  = this.DepName;
         cRM_SupInfo.CreatorID       = Convert.ToInt32(this.Uid);
         cRM_SupInfo.CreatorRealName = this.RealName;
         CRM_Sup.Init().Add(cRM_SupInfo);
         string str = HttpContext.Current.Server.HtmlEncode("您好!供应商信息已添加成功!");
         base.Response.Redirect("~/InfoTip/Operate_Success.aspx?returnpage=" + base.Request.Url.AbsoluteUri + "&tip=" + str);
     }
 }
Ejemplo n.º 2
0
    protected void Del_Btn(object obj, EventArgs e)
    {
        LinkButton        linkButton        = obj as LinkButton;
        RepeaterItem      repeaterItem      = linkButton.Parent as RepeaterItem;
        HtmlInputCheckBox htmlInputCheckBox = repeaterItem.FindControl("chk") as HtmlInputCheckBox;
        int id = Convert.ToInt32(htmlInputCheckBox.Value);

        CRM_Sup.Init().Delete(id);
        this.Show();
    }
Ejemplo n.º 3
0
 private void Show(string cid)
 {
     if (!string.IsNullOrEmpty(cid))
     {
         CRM_SupInfo byId = CRM_Sup.Init().GetById(Convert.ToInt32(cid));
         if (byId != null)
         {
             this.ViewState["ci"]  = byId;
             this.Sup_Name.Value   = byId.Sup_Name;
             this.MainPeople.Value = byId.MainPeople;
             this.Tel.Value        = byId.Tel;
             this.Addr.Value       = byId.Addr;
             this.Notes.Value      = byId.Notes;
         }
     }
 }