protected void btnSave_Click(object sender, EventArgs e)
    {
        if (ddl_Quarter.SelectedValue == "0")
        {
            MessageBox.Show(this, "请选择季度!");
            return;
        }

        FNA_StaffBounsLevelBLL bll = new FNA_StaffBounsLevelBLL();

        if (ViewState["ID"] != null)
        {
            bll = new FNA_StaffBounsLevelBLL((int)ViewState["ID"]);
        }
        bll.Model.Quarter = int.Parse(ddl_Quarter.SelectedValue);
        AC_AccountQuarterBLL quarter = new AC_AccountQuarterBLL(bll.Model.Quarter);

        bll.Model.BegainMonth  = quarter.Model.BeginMonth;
        bll.Model.EndMonth     = quarter.Model.EndMonth;
        bll.Model.Level        = int.Parse(ddl_level.SelectedValue);
        bll.Model.OrganizeCity = int.Parse(tr_OrganizeCity.SelectValue);
        bll.Model.SalesVolume1 = decimal.Parse(txt_sales1.Text.Trim()) * 10000;
        bll.Model.SalesVolume2 = decimal.Parse(txt_sales2.Text.Trim()) * 10000;
        bll.Model.Bouns        = decimal.Parse(txt_BounsBase.Text.Trim());
        if (ViewState["ID"] != null)
        {
            bll.Update();
        }
        else
        {
            bll.Add();
        }
        ViewState["ID"] = null;
        BindGrid();
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        if (ddl_Quarter.SelectedValue == "0")
        {
            MessageBox.Show(this, "请选择季度!");
            return;
        }

        FNA_StaffBounsLevelBLL bll = new FNA_StaffBounsLevelBLL();
        if (ViewState["ID"] != null)
        {
            bll = new FNA_StaffBounsLevelBLL((int)ViewState["ID"]);
        }
        bll.Model.Quarter = int.Parse(ddl_Quarter.SelectedValue);
        AC_AccountQuarterBLL quarter = new AC_AccountQuarterBLL(bll.Model.Quarter);
        bll.Model.BegainMonth = quarter.Model.BeginMonth;
        bll.Model.EndMonth = quarter.Model.EndMonth;
        bll.Model.Level = int.Parse(ddl_level.SelectedValue);
        bll.Model.OrganizeCity = int.Parse(tr_OrganizeCity.SelectValue);
        bll.Model.SalesVolume1 = decimal.Parse(txt_sales1.Text.Trim())*10000;
        bll.Model.SalesVolume2 = decimal.Parse(txt_sales2.Text.Trim())*10000;
        bll.Model.Bouns = decimal.Parse(txt_BounsBase.Text.Trim());
        if (ViewState["ID"] != null)
        {
            bll.Update();
        }
        else
        {
            bll.Add();
        }
        ViewState["ID"] = null;
        BindGrid();
    }
 private void BindDropDown()
 {
     ddl_Quarter.DataSource = AC_AccountQuarterBLL.GetModelList("");
     ddl_Quarter.DataBind();
     if ((int)ViewState["Quarter"] > 0)
     {
         ddl_Quarter.SelectedValue = ViewState["Quarter"].ToString();
     }
 }
    protected void btn_Delete_Click(object sender, EventArgs e)
    {
        if (ViewState["ID"] != null)
        {
            AC_AccountQuarterBLL bll = new AC_AccountQuarterBLL(int.Parse(ViewState["ID"].ToString()));
            bll.Delete();
        }

        BindGrid();
    }
Exemple #5
0
    protected void btn_Delete_Click(object sender, EventArgs e)
    {
        if (ViewState["ID"] != null)
        {
            AC_AccountQuarterBLL bll = new AC_AccountQuarterBLL(int.Parse(ViewState["ID"].ToString()));
            bll.Delete();
        }

        BindGrid();
    }
Exemple #6
0
    private void BindDropDown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion
        ddl_Quarter.DataSource = AC_AccountQuarterBLL.GetModelList("");
        ddl_Quarter.DataBind();
    }
Exemple #7
0
    private void BindData()
    {
        if (ViewState["ID"] != null)
        {
            AC_AccountQuarter _m = new AC_AccountQuarterBLL(int.Parse(ViewState["ID"].ToString())).Model;
            this.tbx_Name.Text           = _m.Name;
            ddl_Quarter.SelectedValue    = _m.Quarter.ToString();
            ddl_year.SelectedValue       = _m.Year.ToString();
            ddl_BeginMonth.SelectedValue = _m.BeginMonth.ToString();
            ddl_EndMonth.SelectedValue   = _m.EndMonth.ToString();

            this.bt_Add.Text        = "修改";
            this.bt_Add.ForeColor   = System.Drawing.Color.Red;
            this.btn_Delete.Visible = true;
            MessageBox.ShowConfirm(this.btn_Delete, "确实要删除所选择的会计月吗?");
        }
        else
        {
        }
    }
    private void BindDropDown()
    {
        #region 绑定用户可管辖的片区
        Org_StaffBLL staff = new Org_StaffBLL((int)Session["UserID"]);
        tr_OrganizeCity.DataSource = staff.GetStaffOrganizeCity();

        if (tr_OrganizeCity.DataSource.Select("ID = 1").Length > 0)
        {
            tr_OrganizeCity.RootValue   = "0";
            tr_OrganizeCity.SelectValue = "1";
        }
        else
        {
            tr_OrganizeCity.RootValue   = new Addr_OrganizeCityBLL(staff.Model.OrganizeCity).Model.SuperID.ToString();
            tr_OrganizeCity.SelectValue = staff.Model.OrganizeCity.ToString();
        }
        #endregion

        ddl_Quarter.DataSource = AC_AccountQuarterBLL.GetModelList("");
        ddl_Quarter.DataBind();
        ddl_level.DataSource = DictionaryBLL.GetDicCollections("FNA_BounsLevel");
        ddl_level.DataBind();
        ddl_level.Items.Insert(0, new ListItem("请选择", "0"));
    }
    protected void bt_Add_Click(object sender, EventArgs e)
    {
        AC_AccountQuarterBLL bll = new AC_AccountQuarterBLL();
        if (ViewState["ID"] != null)
        {
            //修改
            bll = new AC_AccountQuarterBLL(int.Parse(ViewState["ID"].ToString()));
        }
        else
        {
            //新增
            bll = new AC_AccountQuarterBLL();
        }
        bll.Model.Name = tbx_Name.Text.Trim();
        int year, begainmonth, endmonth, Quarter;
        if (int.TryParse(ddl_year.SelectedValue, out year) && year ==0)
        {
            MessageBox.Show(this, "请选择会计年度");
            return;
        }
        if (int.TryParse(ddl_BeginMonth.SelectedValue, out begainmonth) && begainmonth == 0)
        {
            MessageBox.Show(this, "请选择开始月份");
            return;
        }
        if (int.TryParse(ddl_EndMonth.SelectedValue, out endmonth) && endmonth == 0)
        {
            MessageBox.Show(this, "请选择截止月份");
            return;
        }
        if (int.TryParse(ddl_Quarter.SelectedValue, out Quarter) && Quarter == 0)
        {
            MessageBox.Show(this, "请选择季度");
            return;
        }
        bll.Model.BeginDate = new AC_AccountMonthBLL(begainmonth).Model.BeginDate;
        bll.Model.EndDate = new AC_AccountMonthBLL(endmonth).Model.BeginDate;
        bll.Model.Year = year;
        bll.Model.Quarter = Quarter;
        bll.Model.BeginMonth = begainmonth;
        bll.Model.EndMonth = endmonth;

        if (ViewState["ID"] != null)
        {
            //修改
            if (bll.Update() < 0)
            {
                lbl_AlertInfo.Text = "更新记录失败!";
                return;
            }
        }
        else
        {
            //新增

            if (bll.Add() <= 0)
            {
                lbl_AlertInfo.Text = "新增记录失败!";
                return;
            }
        }
        BindGrid();
    }
    private void BindData()
    {
        if (ViewState["ID"] != null)
        {
            AC_AccountQuarter _m = new AC_AccountQuarterBLL(int.Parse(ViewState["ID"].ToString())).Model;
            this.tbx_Name.Text = _m.Name;
            ddl_Quarter.SelectedValue = _m.Quarter.ToString();
            ddl_year.SelectedValue = _m.Year.ToString();
            ddl_BeginMonth.SelectedValue = _m.BeginMonth.ToString();
            ddl_EndMonth.SelectedValue = _m.EndMonth.ToString();

            this.bt_Add.Text = "修改";
            this.bt_Add.ForeColor = System.Drawing.Color.Red;
            this.btn_Delete.Visible = true;
            MessageBox.ShowConfirm(this.btn_Delete, "确实要删除所选择的会计月吗?");
        }
        else
        {

        }
    }
Exemple #11
0
 private void DownQuarterFeeRateTemp_Load(object sender, EventArgs e)
 {
     cmb_Quarter.DataSource    = AC_AccountQuarterBLL.GetModelList("");
     cmb_Quarter.DisplayMember = "Name";
     cmb_Quarter.ValueMember   = "ID";
 }
Exemple #12
0
    protected void bt_Add_Click(object sender, EventArgs e)
    {
        AC_AccountQuarterBLL bll = new AC_AccountQuarterBLL();

        if (ViewState["ID"] != null)
        {
            //修改
            bll = new AC_AccountQuarterBLL(int.Parse(ViewState["ID"].ToString()));
        }
        else
        {
            //新增
            bll = new AC_AccountQuarterBLL();
        }
        bll.Model.Name = tbx_Name.Text.Trim();
        int year, begainmonth, endmonth, Quarter;

        if (int.TryParse(ddl_year.SelectedValue, out year) && year == 0)
        {
            MessageBox.Show(this, "请选择会计年度");
            return;
        }
        if (int.TryParse(ddl_BeginMonth.SelectedValue, out begainmonth) && begainmonth == 0)
        {
            MessageBox.Show(this, "请选择开始月份");
            return;
        }
        if (int.TryParse(ddl_EndMonth.SelectedValue, out endmonth) && endmonth == 0)
        {
            MessageBox.Show(this, "请选择截止月份");
            return;
        }
        if (int.TryParse(ddl_Quarter.SelectedValue, out Quarter) && Quarter == 0)
        {
            MessageBox.Show(this, "请选择季度");
            return;
        }
        bll.Model.BeginDate  = new AC_AccountMonthBLL(begainmonth).Model.BeginDate;
        bll.Model.EndDate    = new AC_AccountMonthBLL(endmonth).Model.BeginDate;
        bll.Model.Year       = year;
        bll.Model.Quarter    = Quarter;
        bll.Model.BeginMonth = begainmonth;
        bll.Model.EndMonth   = endmonth;

        if (ViewState["ID"] != null)
        {
            //修改
            if (bll.Update() < 0)
            {
                lbl_AlertInfo.Text = "更新记录失败!";
                return;
            }
        }
        else
        {
            //新增

            if (bll.Add() <= 0)
            {
                lbl_AlertInfo.Text = "新增记录失败!";
                return;
            }
        }
        BindGrid();
    }