Esempio n. 1
0
    public void Bind()
    {
        int pageCount = 0;
        int Counts    = 0;

        //每页显示的数据设置
        if (this.txtPageSize.Value.ToString() != "")
        {
            if (this.txtPageSize.Value.Trim().Length >= 5)
            {
                Pager.PageSize         = 100;
                this.txtPageSize.Value = "100";
            }
            else
            {
                Pager.PageSize = this.txtPageSize.Value.Trim().ToInt(0);
            }
        }
        List <Hi.Model.BD_SalesMan> LAdminuser = new Hi.BLL.BD_SalesMan().GetList(Pager.PageSize, Pager.CurrentPageIndex, "id", false, SearchWhere(), out pageCount, out Counts);

        this.Rpt_Distribute.DataSource = LAdminuser;
        this.Rpt_Distribute.DataBind();
        Pager.RecordCount = Counts;
        page = Pager.CurrentPageIndex.ToString();
        this.allorg.SelectedValue = this.OrgID == 0 ? allorg.SelectedValue : this.OrgID.ToString();
    }
Esempio n. 2
0
 public void Databinds()
 {
     Hi.Model.BD_SalesMan sale = new Hi.BLL.BD_SalesMan().GetModel(KeyID);
     if (sale != null)
     {
         try
         {
             if (UserType == 3 || UserType == 4)
             {
                 if (sale.OrgID != OrgID)
                 {
                     Response.Write("业务员不存在。");
                     Response.End();
                 }
             }
             txtOrg.SelectedValue = sale.OrgID.ToString();
             txtSaleName.Value    = sale.SalesName;
             txtSaleCode.Value    = sale.SalesCode;
             txtPhone.Value       = sale.Phone;
             txtEmail.Value       = sale.Email;
             txtRemark.Value      = sale.Remark;
             int status = sale.IsEnabled;
             this.rdoStatus1.Checked = (status != 1);
             this.rdoStatus0.Checked = (status == 1);
         }
         catch (Exception ex)
         {
         }
     }
 }
Esempio n. 3
0
 public void DataBinds()
 {
     Hi.Model.BD_SalesMan sale = new Hi.BLL.BD_SalesMan().GetModel(KeyID);
     if (sale != null)
     {
         if (UserType == 3 || UserType == 4)
         {
             if (sale.OrgID != OrgID)
             {
                 Response.Write("业务员不存在。");
                 Response.End();
             }
         }
         lblOrg.InnerText      = GetOrgName(sale.OrgID);
         lblSaleName.InnerText = sale.SalesName;
         lblSaleCode.InnerText = sale.SalesCode;
         lblPhone.InnerText    = sale.Phone;
         lblEmail.InnerText    = sale.Email;
         lblRemark.InnerText   = sale.Remark;
         lblstate.InnerHtml    = sale.IsEnabled == 1 ? "启用" : "<i style='color:red'>禁用</i>";
     }
     else
     {
         Response.Write("业务员不存在。");
         Response.End();
     }
 }
Esempio n. 4
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        Hi.Model.BD_SalesMan sale = null;
        if (KeyID != 0)
        {
            sale           = new Hi.BLL.BD_SalesMan().GetModel(KeyID);
            sale.SalesName = Common.NoHTML(txtSaleName.Value.Trim());
            sale.SalesCode = Common.NoHTML(txtSaleCode.Value.Trim());
            sale.Phone     = Common.NoHTML(txtPhone.Value.Trim());
            sale.Email     = Common.NoHTML(txtEmail.Value.Trim());
            sale.Remark    = Common.NoHTML(txtRemark.Value.Trim());
            if (this.rdoStatus1.Checked)
            {
                sale.IsEnabled = 0;
            }
            else
            {
                sale.IsEnabled = 1;
            }

            sale.ts         = DateTime.Now;
            sale.modifyuser = UserID;
            if (new Hi.BLL.BD_SalesMan().Update(sale))
            {
                //JScript.AlertMsgMo(this, "操作成功", "function(){ window.location.href='SaleManInfo.aspx?KeyID=" + KeyID + "'; }");
                Response.Redirect("SaleManInfo.aspx?KeyID=" + KeyID + "");
            }
        }
        else
        {
            sale           = new Hi.Model.BD_SalesMan();
            sale.OrgID     = Convert.ToInt32(txtOrg.SelectedValue);
            sale.SalesName = Common.NoHTML(txtSaleName.Value.Trim());
            sale.SalesCode = Common.NoHTML(txtSaleCode.Value.Trim());
            sale.Phone     = Common.NoHTML(txtPhone.Value.Trim());
            sale.Email     = Common.NoHTML(txtEmail.Value.Trim());
            sale.Remark    = Common.NoHTML(txtRemark.Value.Trim());
            if (this.rdoStatus1.Checked)
            {
                sale.IsEnabled = 0;
            }
            else
            {
                sale.IsEnabled = 1;
            }

            //标准参数
            sale.ts         = DateTime.Now;
            sale.modifyuser = UserID;
            int newuserid = 0;
            newuserid = new Hi.BLL.BD_SalesMan().Add(sale);
            if (newuserid > 0)
            {
                Response.Redirect("SaleManInfo.aspx?KeyID=" + newuserid);
            }
        }
    }
Esempio n. 5
0
    public void SaleManDataBind()
    {
        int pageCount = 0;
        int Counts    = 0;
        List <Hi.Model.BD_SalesMan> LDis = new Hi.BLL.BD_SalesMan().GetList(Pager1.PageSize, Pager1.CurrentPageIndex, "id", false, " and isnull(dr,0)=0 and OrgID=" + KeyID + "", out pageCount, out Counts);

        this.Rpt_SalesMan.DataSource = LDis;
        this.Rpt_SalesMan.DataBind();
        Pager1.RecordCount = Counts;
        page1 = Pager1.CurrentPageIndex.ToString();
    }
Esempio n. 6
0
 protected void btn_Del(object sender, EventArgs e)
 {
     Hi.Model.BD_SalesMan sale = new Hi.BLL.BD_SalesMan().GetModel(KeyID);
     if (sale != null)
     {
         sale.dr         = 1;
         sale.ts         = DateTime.Now;
         sale.modifyuser = UserID;
         if (new Hi.BLL.BD_SalesMan().Update(sale))
         {
             //JScript.AlertMsgMo(this, "操作成功", "function(){ window.location.href='SaleManList.aspx'; }");
             Response.Redirect("SaleManList.aspx");
         }
     }
 }