Exemple #1
0
    protected void btnPreadd_DirectClick(object sender, DirectEventArgs e)
    {
        int curtime = common.IntSafeConvert(txtPreYear.Text.Trim());

        if (!BG_PreLogic.IsPreByYear(curtime))
        {
            BG_Pre bg_pre = new BG_Pre();
            bg_pre.PreMon = ParToDecimal.ParToDel(txtPreMon.Text.Trim());
            bg_pre.Year   = Convert.ToInt32(txtPreYear.Text.Trim());
            BG_PreManager.AddBG_Pre(bg_pre);
            X.Msg.Alert("提示", "添加成功!").Show();
        }
        else
        {
            BG_Pre    bg_pre = new BG_Pre();
            DataTable bgsuid = BG_PreLogic.GetBG_PreByyear(curtime);
            bg_pre.PreID  = common.IntSafeConvert(bgsuid.Rows[0]["PreID"].ToString());
            bg_pre.PreMon = ParToDecimal.ParToDel(txtPreMon.Text.Trim());
            bg_pre.Year   = Convert.ToInt32(txtPreYear.Text.Trim());
            bool flag = BG_PreManager.ModifyBG_Pre(bg_pre);
            if (flag)
            {
                X.Msg.Alert("提示", "修改成功!").Show();
            }
            else
            {
                X.Msg.Alert("提示", "修改失败,请与管理员联系!").Show();
            }
        }
    }
Exemple #2
0
    protected void btnadd_DirectClick(object sender, DirectEventArgs e)
    {
        int       curtime = common.IntSafeConvert(txtSuppyear.Text.Trim());
        DataTable dtpre   = BG_PreLogic.GetBG_PreByyear(curtime - 1);
        decimal   premon  = 0;

        if (dtpre.Rows.Count <= 0)
        {
            premon = 0;
        }
        else
        {
            premon = ParToDecimal.ParToDel(dtpre.Rows[0]["PreMon"].ToString());
        }
        if (!BG_SupplementaryLogic.IsSuppByYear(curtime))
        {
            BG_Supplementary bg_sup = new BG_Supplementary();
            bg_sup.SuppMon = ParToDecimal.ParToDel(txtSupp.Text.Trim()) - premon;
            bg_sup.Year    = Convert.ToInt32(txtSuppyear.Text.Trim());
            BG_SupplementaryManager.AddBG_Supplementary(bg_sup);
            X.Msg.Alert("提示", "添加成功!").Show();
        }
        else
        {
            BG_Supplementary bg_sup = new BG_Supplementary();
            DataTable        bgsuid = BG_SupplementaryLogic.GetBG_SupplementaryByyear(curtime);
            bg_sup.SuppID  = common.IntSafeConvert(bgsuid.Rows[0]["SuppID"].ToString());
            bg_sup.SuppMon = ParToDecimal.ParToDel(txtSupp.Text.Trim()) - premon;
            bg_sup.Year    = Convert.ToInt32(txtSuppyear.Text.Trim());
            bool flag = BG_SupplementaryManager.ModifyBG_Supplementary(bg_sup);
            if (flag)
            {
                X.Msg.Alert("提示", "修改成功!").Show();
            }
            else
            {
                X.Msg.Alert("提示", "修改失败,请与管理员联系!").Show();
            }
        }
    }
Exemple #3
0
    protected void txtPreYear_DirectChange(object sender, DirectEventArgs e)
    {
        int       curtime = common.IntSafeConvert(txtPreYear.Text.Trim());
        DataTable bgsuid  = BG_PreLogic.GetBG_PreByyear(curtime);

        if (bgsuid.Rows.Count > 0)
        {
            if (ParToDecimal.ParToDel(bgsuid.Rows[0]["PreMon"].ToString()) == 0)
            {
                lbPre.Text = "0";
            }
            else
            {
                lbPre.Text = ParToDecimal.ParToDel(bgsuid.Rows[0]["PreMon"].ToString()).ToString();
            }
        }
        else
        {
            lbPre.Text = "0";
        }
        lbPre.Text += "万元";
    }
Exemple #4
0
    /// <summary>
    ///     绑定数据
    /// </summary>
    private void DtDataBind()
    {
        decimal txt     = 0;
        decimal txt1    = 0;
        int     year    = Convert.ToInt32(HidYear.Value);
        int     bgmonid = BG_MonLogic.GEtIDisEditMon(common.IntSafeConvert(CurrentYear));
        BG_Mon  bgMon   = BG_MonManager.GetBG_MonByBGID(bgmonid);

        if (bgMon != null && bgMon.IsEditMon == 1)
        {
            txt = bgMon.BGMon;
        }
        else
        {
            DataTable dt1 = BG_BudItemsLogic.GetPayOne(year);
            if (dt1.Rows.Count > 0)
            {
                txt += ParToDecimal.ParToDel(dt1.Rows[0]["POTitol"].ToString());
            }
            DataTable dt2 = BG_BudItemsLogic.GetPayTwo(year);
            if (dt1.Rows.Count > 0)
            {
                if (dt2.Rows.Count > 0)
                {
                    txt += ParToDecimal.ParToDel(dt2.Rows[0]["PTTitol"].ToString());
                }
            }
            DataTable dt3 = BG_BudItemsLogic.GetPubPay(year);
            if (dt1.Rows.Count > 0)
            {
                if (dt3.Rows.Count > 0)
                {
                    txt += ParToDecimal.ParToDel(dt3.Rows[0]["PBIDTitol"].ToString());
                }
            }
            DataTable dt4 = BG_BudItemsLogic.GetProPay(year);
            if (dt4.Rows.Count > 0)
            {
                for (int i = 0; i < dt4.Rows.Count; i++)
                {
                    txt += Convert.ToDecimal(dt4.Rows[i]["ProPA0M"]);
                }
            }
        }
        txt1 = txt;
        DataTable dt5 = BG_BudItemsLogic.GetBudgetAllocation(year);

        if (dt5.Rows.Count > 0)
        {
            for (int i = 0; i < dt5.Rows.Count; i++)
            {
                txt -= ParToDecimal.ParToDel(dt5.Rows[i]["BAAMon"].ToString());
            }
        }
        DataTable dtpre  = BG_PreLogic.GetBG_PreByyear(common.IntSafeConvert(CurrentYear));
        decimal   premon = 0;

        if (dtpre == null || dtpre.Rows.Count == 0)
        {
            premon = 0;
        }
        else
        {
            premon = ParToDecimal.ParToDel(dtpre.Rows[0]["PreMon"].ToString());
        }
        //YTDProvinceMon.Text = (txt1 + premon).ToString("f8").TrimEnd('0').TrimEnd('.');
        ////tatal.Value = txt.ToString();
        ////YTDProvinceMon.Text = txt.ToString();
        //Deserved.Text = (txt1 - txt).ToString("f8").TrimEnd('0').TrimEnd('.');
        //ResidualMon.Text = (txt + premon).ToString("f8").TrimEnd('0').TrimEnd('.');

        baa.Value = txt.ToString();
        DataTable dt    = BG_DepartmentLogic.GetAllBG_DepartmentMon(year, DepID);
        DataTable dt6   = BG_SupplementaryLogic.GetBG_SupplementaryByyear(year);
        decimal   sutxt = 0;

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sutxt += ParToDel(dt.Rows[i]["SuppMon"].ToString());
            }
        }
        decimal SuppMontotal = 0;

        if (dt6 == null)
        {
            SuppMontotal         = 0;
            ResidualSuppMon.Text = "0";
        }
        else if (dt6.Rows.Count == 0)
        {
            SuppMontotal         = 0;
            ResidualSuppMon.Text = "0";
        }
        else
        {
            SuppMontotal         = ParToDecimal.ParToDel(dt6.Rows[0]["SuppMon"].ToString());
            ResidualSuppMon.Text = (SuppMontotal - sutxt).ToString("f8").TrimEnd('0').TrimEnd('.');
        }
        supp.Value = Convert.ToDecimal(ResidualSuppMon.Text);

        YTDProvinceMon.Text = (txt1 + premon).ToString("f8").TrimEnd('0').TrimEnd('.');
        //tatal.Value = txt.ToString();
        //YTDProvinceMon.Text = txt.ToString();
        Deserved.Text       = (txt1 - txt).ToString("f8").TrimEnd('0').TrimEnd('.');
        ResidualMon.Text    = (txt + premon).ToString("f8").TrimEnd('0').TrimEnd('.');
        SuppMon.Text        = SuppMontotal.ToString();
        BudgetTatol.Text    = (txt1 + premon + SuppMontotal).ToString("f8").TrimEnd('0').TrimEnd('.');
        YTDDeserved.Text    = ((txt1 - txt) + SuppMontotal - ParToDecimal.ParToDel(ResidualSuppMon.Text)).ToString("f8").TrimEnd('0').TrimEnd('.');
        YTDResidualMon.Text = (txt + premon + SuppMontotal).ToString("f8").TrimEnd('0').TrimEnd('.');
        DataTable dtIc = IncomeContrastpayLogic.GetAllocation(year);

        if (dtIc.Rows.Count > 0)
        {
            for (int i = 0; i < dtIc.Rows.Count; i++)
            {
                DataRow dr = dt.NewRow();
                for (int j = 0; j < dtIc.Columns.Count; j++)
                {
                    dr[j] = dtIc.Rows[i][j];
                }
                dt.Rows.Add(dr);
            }
        }
        else
        {
            DataRow dr = dt.NewRow();
            dr["DepName"] = "科室业务费";
            dr["DepID"]   = 1;
            dt.Rows.Add(dr);
            DataRow dr1 = dt.NewRow();
            dr1["DepName"] = "局长基金";
            dr1["DepID"]   = 0;
            dt.Rows.Add(dr1);
        }
        dt.Columns.Add("DepNum");
        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["DepNum"] = (i + 1).ToString();
            }
            Store1.DataSource = dt;
            Store1.DataBind();
        }
        else
        {
            ExtNet.Msg.Show(new MessageBoxConfig
            {
                Title   = "提示",
                Message = "本年度还没有添加预算,请先添加预算。",
                Width   = 300,
                Buttons = MessageBox.Button.OK,
                //Multiline = true,
                //AnimEl = this.Button3.ClientID,
                //Fn = new JFunction { Fn = "showResultText" }
            });
            Store1.DataSource = dt;
            Store1.DataBind();
        }
        if ((txt1 - txt) == 0 && sutxt == 0)
        {
        }
        DataTable bgmp = BG_MonPayPlanManager.GetAllBG_MonPayPlan();
        DataView  dv   = bgmp.DefaultView;

        dv.RowFilter = string.Format("convert(MPTime,'System.String') LIKE '{0}%'", CurrentYear);
        DataTable newbgmp = dv.ToTable(true);

        if (newbgmp != null)
        {
            if (newbgmp.Rows.Count == 0)
            {
                BtnSettingPayIncome.Hidden = false;
            }
        }
    }
Exemple #5
0
    private void DtDataBind()
    {
        decimal txt    = 0;
        decimal txt1   = 0;
        int     year   = Convert.ToInt32(HidYear.Value);
        decimal pbbase = BG_BudItemsLogic.GetTotal(year);

        Session["BaseMon"] = pbbase;
        int    bgmonid = BG_MonLogic.GEtIDisEditMon(common.IntSafeConvert(CurrentYear));
        BG_Mon bgMon   = BG_MonManager.GetBG_MonByBGID(bgmonid);

        if (bgMon != null && bgMon.IsEditMon == 1)
        {
            txt = bgMon.BGMon;
        }
        else
        {
            DataTable dt1 = BG_BudItemsLogic.GetPayOne(year);
            if (dt1.Rows.Count > 0)
            {
                txt += ParToDecimal.ParToDel(dt1.Rows[0]["POTitol"].ToString());
            }
            DataTable dt2 = BG_BudItemsLogic.GetPayTwo(year);
            if (dt1.Rows.Count > 0)
            {
                if (dt2.Rows.Count > 0)
                {
                    txt += ParToDecimal.ParToDel(dt2.Rows[0]["PTTitol"].ToString());
                }
            }
            DataTable dt3 = BG_BudItemsLogic.GetPubPay(year);
            if (dt1.Rows.Count > 0)
            {
                if (dt3.Rows.Count > 0)
                {
                    txt += ParToDecimal.ParToDel(dt3.Rows[0]["PBIDTitol"].ToString());
                }
            }
            DataTable dt4 = BG_BudItemsLogic.GetProPay(year);
            if (dt4.Rows.Count > 0)
            {
                for (int i = 0; i < dt4.Rows.Count; i++)
                {
                    txt += Convert.ToDecimal(dt4.Rows[i]["ProPA0M"]);
                }
            }
        }
        txt1 = txt;
        DataTable dt5 = BG_BudItemsLogic.GetBudgetAllocation(year);

        if (dt5.Rows.Count > 0)
        {
            for (int i = 0; i < dt5.Rows.Count; i++)
            {
                txt -= ParToDecimal.ParToDel(dt5.Rows[i]["BAAMon"].ToString());
            }
        }
        DataTable dtpre  = BG_PreLogic.GetBG_PreByyear(common.IntSafeConvert(CurrentYear));
        decimal   premon = 0;

        if (dtpre == null || dtpre.Rows.Count == 0)
        {
            premon = 0;
        }
        else
        {
            premon = ParToDecimal.ParToDel(dtpre.Rows[0]["PreMon"].ToString());
        }
        Session["TotalMon"] = (txt + premon).ToString("f8").TrimEnd('0').TrimEnd('.');
    }
Exemple #6
0
    //public string GetXML()
    //{
    //    string str = "";
    //    string xmlPath = Server.MapPath("~/Settings/") + "Settings.xml";
    //    List<string> list = new List<string>();
    //    XmlDocument xmlDoc = new XmlDocument();
    //    xmlDoc.Load(xmlPath);
    //    XmlNode xmlNode = xmlDoc.SelectSingleNode("UserInfo");
    //    foreach (XmlNode node in xmlNode)
    //    {

    //        //验证是否登录通过
    //        if (UserName.ToLower() == node.ChildNodes[1].InnerText.ToLower() && UserID.ToString().ToLower() == node.ChildNodes[0].InnerText.ToLower())
    //        {
    //            str = node.ChildNodes[2].InnerText.ToLower();
    //        }
    //    }
    //    return str;
    //}
    private void DtDataBind()
    {
        decimal txt = 0;

        if (CurrentYear == "")
        {
            return;
        }
        int    year    = common.IntSafeConvert(CurrentYear);
        int    bgmonid = BG_MonLogic.GEtIDisEditMon(common.IntSafeConvert(CurrentYear));
        BG_Mon bgMon   = BG_MonManager.GetBG_MonByBGID(bgmonid);

        if (bgMon != null && bgMon.IsEditMon == 1)
        {
            txt = bgMon.BGMon;
        }
        else
        {
            DataTable dt1 = BG_BudItemsLogic.GetPayOne(year);
            if (dt1.Rows.Count > 0)
            {
                txt += ParToDecimal.ParToDel(dt1.Rows[0]["POTitol"].ToString());
            }
            DataTable dt2 = BG_BudItemsLogic.GetPayTwo(year);
            if (dt1.Rows.Count > 0)
            {
                if (dt2.Rows.Count > 0)
                {
                    txt += ParToDecimal.ParToDel(dt2.Rows[0]["PTTitol"].ToString());
                }
            }
            DataTable dt3 = BG_BudItemsLogic.GetPubPay(year);
            if (dt1.Rows.Count > 0)
            {
                if (dt3.Rows.Count > 0)
                {
                    txt += ParToDecimal.ParToDel(dt3.Rows[0]["PBIDTitol"].ToString());
                }
            }
            DataTable dt4 = BG_BudItemsLogic.GetProPay(year);
            if (dt4.Rows.Count > 0)
            {
                for (int i = 0; i < dt4.Rows.Count; i++)
                {
                    txt += Convert.ToDecimal(dt4.Rows[i]["ProPA0M"]);
                }
            }

            //tatal.Value = txt.ToString();
            //BAA.Text = txt.ToString();
        }
        DataTable dt5 = BG_BudItemsLogic.GetBudgetAllocation(year);

        if (dt5.Rows.Count > 0)
        {
            for (int i = 0; i < dt5.Rows.Count; i++)
            {
                txt -= ParToDecimal.ParToDel(dt5.Rows[i]["BAAMon"].ToString());
            }
        }
        DataTable dtpre  = BG_PreLogic.GetBG_PreByyear(common.IntSafeConvert(CurrentYear));
        decimal   premon = 0;

        if (dtpre == null || dtpre.Rows.Count == 0)
        {
            premon = 0;
        }
        else
        {
            premon = ParToDecimal.ParToDel(dtpre.Rows[0]["PreMon"].ToString());
        }
        BAA.Text = (txt + premon).ToString("f8").TrimEnd('0').TrimEnd('.');
        DataTable dt    = BG_DepartmentLogic.GetAllBG_DepartmentMon(year, DepID);
        DataTable dt6   = BG_SupplementaryLogic.GetBG_SupplementaryByyear(year);
        decimal   sutxt = 0;

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                sutxt += ParToDecimal.ParToDel(dt.Rows[i]["SuppMon"].ToString());
            }
        }
        if (dt6.Rows.Count <= 0)
        {
            SUPP.Text = "0.00";
        }
        else
        {
            SUPP.Text = (ParToDecimal.ParToDel(dt6.Rows[0]["SuppMon"].ToString()) - sutxt).ToString("f8").TrimEnd('0').TrimEnd('.');
        }
        HidBAA.Text  = BAA.Text;
        HidSupp.Text = SUPP.Text;
    }