Ejemplo n.º 1
0
        public static decimal GetTotal(int year)
        {
            string  sql = string.Format("select PBIDTitol  from [dbo].[BG_ProBasiPubPay] where Year(PBYear)={0}", year);
            decimal t   = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sql, null));

            return(t);
        }
Ejemplo n.º 2
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();
            }
        }
    }
Ejemplo n.º 3
0
    private void AddBind(string strcon)
    {
        string Depname = Getlist(strcon)[0];
        string time    = Getlist(strcon)[1];
        string money   = Getlist(strcon)[2];
        string Agent   = Getlist(strcon)[3];

        TextBox1.Text = Depname;
        char cr;

        if (time.Contains("/"))
        {
            cr = '/';
        }
        else
        {
            cr = '-';
        }
        ////////TextBox33.Text = ConvertSum.ConvertToSum(money);
        TextBox2.Text = time.Split(cr)[0];
        TextBox3.Text = time.Split(cr)[1];
        TextBox4.Text = time.Split(cr)[2].Substring(0, 2);
        //TextBox34.Text = Agent;
        Session["money"] = (ParToDecimal.ParToDel(money) * 10000).ToString(); Session["time"] = time;
    }
Ejemplo n.º 4
0
    public void Edit2(int id, string name, object BGAMID, string oldValue, string newValue, object customer)
    {
        int       deptid  = DepID;
        string    message = " {0}<br /><b>原收入经费:</b> {1}<br /><b>更改收入经费:</b> {2}";
        bool      flag    = false;
        BG_Amount ma      = new BG_Amount();

        ma = BG_AmountLogic.GetBG_AmountByYear(id, common.IntSafeConvert(cmbyear.SelectedItem.Value), deptid);
        if (ma == null)
        {
            ma            = new BG_Amount();
            ma.BGAMIncome = ParToDecimal.ParToDel(newValue);
            ma.DepID      = deptid;
            ma.BGAMYear   = common.IntSafeConvert(cmbyear.SelectedItem.Value);
            ma.CBID       = id;
            flag          = BG_AmountManager.AddBG_Amount(ma).BGAMID > 0;
        }
        else
        {
            ma.BGAMIncome = ParToDecimal.ParToDel(newValue);
            flag          = BG_AmountManager.ModifyBG_Amount(ma);
        }
        if (flag)
        {
            X.Msg.Notify(new NotificationConfig()
            {
                Title = "消息提示",
                Html  = string.Format(message, common.IntSafeConvert(cmbyear.SelectedItem.Value) - 1 + "年" + "口径:" + name.Split('、')[1], oldValue, newValue),
                Width = 250
            }).Show();
        }
    }
Ejemplo n.º 5
0
        public static decimal  GetARUseMon(int ppid, int DepID, int Year)
        {
            string  str = string.Format("select sum(ARMon) as ARMon from BG_ApplyReimbur where ppid={0} and DepId={1} and  Year(ARTime)={2} and ARListSta='审核通过'", ppid, DepID, Year);
            decimal t   = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, str, null));

            return(t);
        }
Ejemplo n.º 6
0
    public void DoYes1(string bgmonid, string mon)
    {
        BG_Mon bgMon = BG_MonManager.GetBG_MonByBGID(common.IntSafeConvert(bgmonid));

        bgMon.BGMon = ParToDecimal.ParToDel(mon);
        BG_MonManager.ModifyBG_Mon(bgMon);
        X.Msg.Alert("提示", "录入金额修改成功!").Show();
    }
        public static decimal GetEAMon(int depid, int piid, int year)
        {
            decimal del = 0;
            string  str = string.Format(" select sum(BEAMon) as BEAMon  from dbo.BG_EstimatesAllocation where BEAYear={0} and DepID={1} and PIID={2} ", year, depid, piid);

            del = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, str, null));

            return(del);
        }
Ejemplo n.º 8
0
    private static void DoAudit(string YearMonth, int depid, int pici, DataTable dt, int prid)
    {
        BG_MonPayPlanRemark mppr = BG_MonPayPlanRemarkManager.GetBG_MonPayPlanRemarkByPRID(prid);

        mppr.MASta = "审核通过";
        if (BG_MonPayPlanRemarkManager.ModifyBG_MonPayPlanRemark(mppr))
        {
            DataTable paydt = BG_MonPayPlanGenerateLogic.GetMonPayTimepici(YearMonth, depid, pici);
            for (int i = 0; i < paydt.Rows.Count; i++)
            {
                BG_MonPayPlan_His bgMonPayPlanHis = new BG_MonPayPlan_His();
                bgMonPayPlanHis.CPID              = common.IntSafeConvert(paydt.Rows[i]["CPID"]);
                bgMonPayPlanHis.DeptID            = depid;
                bgMonPayPlanHis.MPFunding         = ParseUtil.ToDecimal(paydt.Rows[i]["MPFunding"].ToString(), 0);
                bgMonPayPlanHis.MPPHisTime        = DateTime.Now;
                bgMonPayPlanHis.PIID              = common.IntSafeConvert(paydt.Rows[i]["PIID"]);
                bgMonPayPlanHis.MPRemark          = "审核通过";
                bgMonPayPlanHis.MPFundingAdd      = ParseUtil.ToDecimal(paydt.Rows[i]["MPFundingAdd"].ToString(), 0);
                bgMonPayPlanHis.MPTime            = Convert.ToDateTime(paydt.Rows[i]["MPTime"]);
                bgMonPayPlanHis.MPFundingAddTimes = common.IntSafeConvert(paydt.Rows[i]["MPFundingAddTimes"]);
                BG_MonPayPlan_HisManager.AddBG_MonPayPlan_His(bgMonPayPlanHis);
            }
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                int CashierID = BG_CashierLogic.GetCashierIDAudit_RemarkByPiid(depid, YearMonth,
                                                                               common.IntSafeConvert(dt.Rows[i]["PIID"]));
                if (CashierID > 0)
                {
                    BG_Cashier bgCashier = BG_CashierManager.GetBG_CashierByCashierid(CashierID);
                    bgCashier.BQMon          += ParToDecimal.ParToDel(dt.Rows[i]["MPFundingAdd"].ToString());
                    bgCashier.BgMon          += ParToDecimal.ParToDel(dt.Rows[i]["MPFundingAdd"].ToString());
                    bgCashier.CashierBalance += ParToDecimal.ParToDel(dt.Rows[i]["MPFundingAdd"].ToString());
                    bgCashier.CZMon           = 0;
                    bgCashier.QTMon           = 0;
                    bgCashier.CTime           = mppr.MATime;
                    bgCashier.Piid            = common.IntSafeConvert(dt.Rows[i]["PIID"]);
                    bgCashier.DepID           = mppr.DeptID;
                    BG_CashierManager.ModifyBG_Cashier(bgCashier);
                }
                else
                {
                    BG_Cashier bgCashier = new BG_Cashier();
                    bgCashier.BQMon          += ParToDecimal.ParToDel(dt.Rows[i]["MPFundingAdd"].ToString());
                    bgCashier.BgMon          += ParToDecimal.ParToDel(dt.Rows[i]["MPFundingAdd"].ToString());
                    bgCashier.CashierBalance += ParToDecimal.ParToDel(dt.Rows[i]["MPFundingAdd"].ToString());
                    bgCashier.CZMon           = 0;
                    bgCashier.QTMon           = 0;
                    bgCashier.CTime           = mppr.MATime;
                    bgCashier.Piid            = common.IntSafeConvert(dt.Rows[i]["PIID"]);
                    bgCashier.DepID           = mppr.DeptID;
                    BG_CashierManager.AddBG_Cashier(bgCashier);
                }
            }
        }
    }
Ejemplo n.º 9
0
        public static decimal GetMonPayYear(int PPID, int depid, int year)
        {
            DataTable dt     = new DataTable();
            string    sqlStr =
                "select sum(MPFunding) as mon from  dbo.BG_MonPayPlan where deptid={0} and PIID={1} and Year(MPTime)={2}";

            sqlStr = string.Format(sqlStr, depid, PPID, year);
            decimal t = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sqlStr, null));

            return(t);
        }
Ejemplo n.º 10
0
        public static bool GetAllMonByDepID(int DepID, string year)
        {
            string  sql = string.Format("select  Sum(BAAMon)+Sum(SuppMon)  from [dbo].[BG_BudgetAllocation]  where DepID={0} and BAAYear='{1}'", DepID, year);
            decimal t   = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sql, null));

            if (t > 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 11
0
        public static decimal GetMon(int year, int piid, int depid)
        {
            decimal tt  = 0;
            string  sql = string.Format("SELECT sum(BAAMon)+sum(SuppMon) FROM BG_BudgetAllocation WHERE PIID = {0} and DepID = {1} and BAAYear={2}", piid, depid, year);

            try
            {
                tt = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sql, null));
            }
            catch (Exception ex)
            {
                tt = 0;
            }
            return(tt);
        }
Ejemplo n.º 12
0
        public static Decimal GetBGQuotaByPIID(int PIID, int year)
        {
            Decimal qt = 0;

            try
            {
                string sql = string.Format("SELECT Money FROM BG_Quota WHERE PIID={0} and Year={1} ", PIID, year);
                qt = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sql, null));
            }
            catch
            {
                qt = 0;
            }
            return(qt);
        }
Ejemplo n.º 13
0
        //public static DataTable GetARMon(int ppid, int DepID, string ARTime)
        //{
        //    DataTable dt = null;
        //    try
        //    {
        //        string str = string.Format("select sum(ARMon) as ARMon from BG_ApplyReimbur where ppid={0} and DepId={1} and  convert(varchar(7),ARTime,120)='{2}' and ARListSta='审核通过'", ppid, DepID, ARTime);
        //        dt = DBUnity.AdapterToTab(str);
        //    }
        //    catch
        //    {
        //        dt = null;
        //    }
        //    return dt;
        //}

        public static decimal GetARMon(int ppid, int DepID, string YearMonth)
        {
            decimal tt = 0;

            try
            {
                string str = string.Format("select BQMon from V_Cashier_PayIncome where piid={0} and Depid={1} and Convert(varchar(7),Ctime,120)<'{2}'", ppid, DepID, YearMonth);
                tt = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, str, null));
            }
            catch
            {
                tt = 0;
            }
            return(tt);
        }
Ejemplo n.º 14
0
        public static decimal ApplyMon(string ARTime, int DepID)
        {
            decimal t = 0;

            try
            {
                string str = string.Format("select sum(ARMon) as ARMon from BG_ApplyReimbur where DepId={0} and  convert(varchar(7),ARTime,120)<='{1}'", DepID, ARTime);
                t = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, str, null).ToString());
            }
            catch
            {
                t = 0;
            }
            return(t);
        }
Ejemplo n.º 15
0
    protected void btnSure_DirectClick(object sender, DirectEventArgs e)
    {
        string name = "";

        try
        {
            name = ComboBox1.SelectedItem.Value;
        }
        catch
        {
            X.Msg.Alert("系统提示", "请选择科目名称。").Show();
            return;
        }
        if (tfMon.Text == "")
        {
            X.Msg.Alert("系统提示", "请填写经费。").Show();
            return;
        }
        string bgpi  = BG_BudItemsLogic.GetBG_PayIncomeByname(name);
        int    piid  = common.IntSafeConvert(bgpi.Split(',')[0]);
        int    year  = Convert.ToInt32(HidYear.Value);
        int    depid = Convert.ToInt32(HidDepid.Value);
        BG_EstimatesAllocation ba = new BG_EstimatesAllocation();

        ba.DepID   = depid;
        ba.PIID    = piid;
        ba.BEAYear = year;
        ba.BEAMon  = ParToDecimal.ParToDel(tfMon.Text);
        if (Convert.ToDecimal(tatal.Value) - ba.BEAMon > 0)
        {
            if (BGBudItemsService.Isba(year, piid, depid) > 0)
            {
                ba.BEAID = BGBudItemsService.IsBEAba(year, piid, depid);
                BG_EstimatesAllocationManager.ModifyBG_EstimatesAllocation(ba);
            }
            else
            {
                BG_EstimatesAllocationManager.AddBG_EstimatesAllocation(ba);
            }
            Window1.Hidden = true;
            AddDataBind();
            DtDataBind();
        }
        else
        {
            X.Msg.Alert("提示", "预算金额不足,无法分配!").Show();
        }
    }
Ejemplo n.º 16
0
        public static decimal getAllMon(int depid, string YearMonth)
        {
            decimal t = 0;

            try
            {
                string sql = string.Format("select sum([MPFunding]) as Mon from [dbo].[BG_MonPayPlan] where Convert(varchar(7),MPTime,120)='{0}' and DeptID={1}", YearMonth, depid);
                t = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sql, null));
            }
            catch (System.Exception ex)
            {
                t = 0;
            }

            return(t);
        }
Ejemplo n.º 17
0
        public static decimal GetbxMon(string yearMonth, int DepID)
        {
            decimal tt = 0;

            try
            {
                string sql =
                    "select count(Armon) as Armon ,DepID from dbo.BG_ApplyReimbur where Convert(varchar(7),ARTime,120)<='{0}' and  ARListSta='审核通过' Where Depid ={1} group by DepID";
                sql = string.Format(sql, yearMonth, DepID);
                tt  = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sql, null));
            }
            catch (Exception)
            {
                tt = 0;
            }
            return(tt);
        }
Ejemplo n.º 18
0
        public static decimal GetsqMont(string yearMonth, int Depid)
        {
            decimal tt = 0;

            try
            {
                string sql =
                    "select sum(MPFunding) as MPFunding from BG_MonPayPlan where Convert(varchar(7),MPTime,120)<='{0}' and deptid={1} ";
                sql = string.Format(sql, yearMonth, Depid);
                tt  = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sql, null));
            }
            catch (Exception)
            {
                tt = 0;
            }
            return(tt);
        }
Ejemplo n.º 19
0
    private decimal Getmon(string str, string mm)
    {
        int     monend   = 0;
        decimal montmp   = 0;
        int     monindex = str.IndexOf(mm);

        if (mm == "supp")
        {
            monend = str.IndexOf("}", monindex);
            montmp = ParToDecimal.ParToDel(str.Substring(monindex + 6, monend - monindex - 6));
        }
        else if (mm == "mon")
        {
            monend = str.IndexOf(",", monindex);
            montmp = ParToDecimal.ParToDel(str.Substring(monindex + 5, monend - monindex - 5));
        }
        return(montmp);
    }
Ejemplo n.º 20
0
    public void Edit(int id, string name, object BGAMID, string oldValue, string newValue, object customer)
    {
        int deptid = DepID;

        if (UserLimStr == "审核员")
        {
            deptid = common.IntSafeConvert(cmbdept.SelectedItem.Value);
            editnum.Disable(true);
        }
        string    message = " {0}<br /><b>原支出经费:</b> {1}<br /><b>更改支出经费:</b> {2}";
        bool      flag    = false;
        BG_Amount ma      = new BG_Amount();

        ma = BG_AmountLogic.GetBG_AmountByYear(id, common.IntSafeConvert(cmbyear.SelectedItem.Value), deptid);
        if (ma == null)
        {
            ma          = new BG_Amount();
            ma.BGAMMon  = ParToDecimal.ParToDel(newValue);
            ma.DepID    = deptid;
            ma.BGAMYear = common.IntSafeConvert(cmbyear.SelectedItem.Value);
            ma.CBID     = id;
            flag        = BG_AmountManager.AddBG_Amount(ma).BGAMID > 0;
        }
        else
        {
            ma.BGAMMon = ParToDecimal.ParToDel(newValue);
            flag       = BG_AmountManager.ModifyBG_Amount(ma);
        }
        if (flag)
        {
            X.Msg.Notify(new NotificationConfig()
            {
                Title = "消息提示",
                Html  = string.Format(message, common.IntSafeConvert(cmbyear.SelectedItem.Value) + "年" + "口径:" + name.Split('、')[1], oldValue, newValue),
                Width = 250
            }).Show();
        }
        // Send Message...


        //this.GridPanel1.GetStore().GetById(id).Commit();
    }
Ejemplo n.º 21
0
    private DataTable GetNewdt(DataTable dt)
    {
        dt.Columns.Add("BalanceMon");
        decimal t1 = 0, t2 = 0, t3 = 0;

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["BalanceMon"] = ParToDecimal.ParToDel(dt.Rows[i]["InComeMon"].ToString()) - ParToDecimal.ParToDel(dt.Rows[i]["PayMon"].ToString());
            t1 += ParToDecimal.ParToDel(dt.Rows[i]["InComeMon"].ToString());
            t2 += ParToDecimal.ParToDel(dt.Rows[i]["PayMon"].ToString());
            t3 += ParToDecimal.ParToDel(dt.Rows[i]["BalanceMon"].ToString());
        }
        DataRow dr = dt.NewRow();

        dr["DepName"]    = "总计";
        dr["InComeMon"]  = t1;
        dr["PayMon"]     = t2;
        dr["BalanceMon"] = t3;
        dt.Rows.Add(dr);
        return(dt);
    }
Ejemplo n.º 22
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();
            }
        }
    }
Ejemplo n.º 23
0
        public static decimal GetMonauditPay(string YearMonth)
        {
            decimal t      = 0;
            string  sqlStr =
                "select sum(Armon) as armon from dbo.BG_ApplyReimbur where Convert(varchar(7),ARTime,120)='{0}' and  ARListSta='审核通过'";

            sqlStr = string.Format(sqlStr, YearMonth);
            try
            {
                t = ParToDecimal.ParToDel(DBUnity.ExecuteScalar(CommandType.Text, sqlStr, null));
                if (t <= 0)
                {
                    t = 0;
                }
            }
            catch (System.Exception ex)
            {
                t = 0;
            }

            return(t);
        }
Ejemplo n.º 24
0
    protected void txtSuppyear_DirectChange(object sender, DirectEventArgs e)
    {
        int       curtime = common.IntSafeConvert(txtSuppyear.Text.Trim());
        DataTable bgsuid  = BG_SupplementaryLogic.GetBG_SupplementaryByyear(curtime);

        if (bgsuid.Rows.Count > 0)
        {
            if (ParToDecimal.ParToDel(bgsuid.Rows[0]["SuppMon"].ToString()) == 0)
            {
                lbsupp.Text = "0";
            }
            else
            {
                lbsupp.Text = ParToDecimal.ParToDel(bgsuid.Rows[0]["SuppMon"].ToString()).ToString();
            }
        }
        else
        {
            lbsupp.Text = "0";
        }
        lbsupp.Text += "万元";
    }
Ejemplo n.º 25
0
    protected void btnAdd_Click(object sender, EventArgs e)
    {
        BG_ReimAppendix ra = new BG_ReimAppendix();

        ra.ARID      = common.IntSafeConvert(arid);
        ra.ARContent = getCbCatalog();
        ra.ARType    = "资料印制";
        ra.ARTime    = Convert.ToDateTime(Session["time"]);
        string[] str   = ra.ARContent.Split('☆');
        decimal  total = ParToDecimal.ParToDel(Session["money"].ToString());

        if (BGReimAppendixManager.AddAccessories(ra))
        {
            lblMResult.Text = "* 添加成功";
        }
        else
        {
            lblMResult.Text = "* 操作失败、请检查数据后重试";
        }

        //if (total > Convert.ToDecimal(str[32]))
        //{
        //    lblMResult.Text = "* 所填金额不能大于分配金额";
        //    return;
        //}
        //else
        //{
        //    if (BGReimAppendixManager.AddAccessories(ra))
        //    {
        //        lblMResult.Text = "* 添加成功";

        //    }
        //    else
        //    {
        //        lblMResult.Text = "* 操作失败、请检查数据后重试";
        //    }
        //}
    }
Ejemplo n.º 26
0
    protected void btnAlter_Click(object sender, EventArgs e)
    {
        BG_ReimAppendix ra = BGReimAppendixManager.GetAcc(arid);

        string[] str   = ra.ARContent.Split('☆');
        decimal  total = ParToDecimal.ParToDel(Session["money"].ToString());

        ra.ARContent = getCbCatalog();
        ra.ARTime    = Convert.ToDateTime(Session["time"]);
        if (BGReimAppendixManager.UpdAccessories(ra))
        {
            lblMResult.Text = "* 修改成功";
            Response.Redirect("ApplyAlter.aspx?arid=" + arid, true);
        }
        else
        {
            lblMResult.Text = "* 操作失败、请检查数据后重试";
        }
        //if (total > Convert.ToDecimal(str[8]))
        //{
        //    lblMResult.Text = "* 所填金额不能大于分配金额";
        //    return;
        //}
        //else
        //{
        //    ra.ARContent = getCbCatalog();
        //    if (BGReimAppendixManager.UpdAccessories(ra))
        //    {
        //        lblMResult.Text = "* 修改成功";
        //        Response.Redirect("ApplyAlter.aspx?arid=" + arid, true);
        //    }
        //    else
        //    {
        //        lblMResult.Text = "* 操作失败、请检查数据后重试";
        //    }
        //}
    }
    //private void repBudConDataBind(string depname)
    //{
    //    DataTable dt = VApplyPayDepartManager.GetVApplyPayDepartByDepName(depname);
    //    repBudCon.DataSource = dt;
    //    repBudCon.DataBind();
    //}
    protected void btnInq_Click(object sender, EventArgs e)
    {
        lanotice.Text = "";
        string    ARTime  = ddlyear.Text.Trim() + "-" + DropDownList1.Text.Trim();
        string    BAAYear = ddlyear.Text.Trim();
        DataTable dt2     = IncomeContrastpayLogic.GetARMonByBAAYear(BAAYear);

        if (dt2.Rows.Count < 1)
        {
            lanotice.Text = "查询结果为空!";
            repBudCon.DataBind();
        }
        else
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("DepName");
            dt.Columns.Add("ARMon");
            dt.Columns.Add("ChangeMon");
            dt.Columns.Add("UserMon");
            dt.Columns.Add("Pecent");
            //dt.Columns.Add("");
            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                dt.Rows.Add("");
                dt.Rows[i]["DepName"] = IncomeContrastpayLogic.GetDepBydepid(dt2.Rows[i]["DepID"].ToString());
                dt.Rows[i]["ARMon"]   = Convert.ToDecimal(dt2.Rows[i]["BAAMon"]).ToString("f2").TrimEnd('0').TrimEnd('.');
                int       depid  = common.IntSafeConvert(dt2.Rows[i]["DepID"]);
                DataTable dtsupp = IncomeContrastpayLogic.GetBG_SupplementaryDivide(depid, common.IntSafeConvert(ddlyear.Text.Trim()));
                dt.Rows[i]["ChangeMon"] = Convert.ToDecimal(dtsupp.Rows[0]["SuppMon"]).ToString("f2").TrimEnd('0').TrimEnd('.');
                //DataTable dt1 = BG_ApplyReimburLogic.GetARMonByARTime(ARTime, int.Parse(dt2.Rows[i]["DepID"].ToString()));
                DataTable dt1 = IncomeContrastpayLogic.GetZXMonByZXTime(ARTime, int.Parse(dt2.Rows[i]["DepID"].ToString()));
                if (dt1 != null && dt1.Rows.Count > 0 && dt1.Rows[0][0].ToString() != "")
                {
                    //dt.Rows[i]["Balance"] = (Convert.ToInt32(dt2.Rows[0]["BAAMon"]) - Convert.ToInt32(dt1.Rows[0]["ARMon"])).ToString();
                    dt.Rows[i]["UserMon"] = ParToDecimal.ParToDel((dt1.Rows[0][0]).ToString()).ToString("f2").TrimEnd('0').TrimEnd('.');
                }
                else
                {
                    //dt.Rows[i]["Balance"] = dt2.Rows[i]["BAAMon"].ToString();
                    dt.Rows[i]["UserMon"] = "0";
                }
                if (ParseUtil.ToDecimal(dt.Rows[i]["ARMon"].ToString(), 0) != 0)
                {
                    decimal usermon = ParseUtil.ToDecimal(dt.Rows[i]["UserMon"].ToString(), 0);
                    decimal armon   = ParseUtil.ToDecimal(dt.Rows[i]["ARMon"].ToString(), 0) + ParseUtil.ToDecimal(dt.Rows[i]["ChangeMon"].ToString(), 0);
                    dt.Rows[i]["Pecent"] = ((usermon / armon) * 100).ToString("f2").TrimEnd('0') + "%";
                }
                else
                {
                    dt.Rows[i]["Pecent"] = "0%";
                }
            }
            decimal k1  = IncomeContrastpayLogic.GetARmon(ARTime, "科室业务费");
            decimal k2  = IncomeContrastpayLogic.GetUserMon(ARTime, "科室业务费");
            decimal zj1 = IncomeContrastpayLogic.GetARmonZJ(ARTime, "科室业务费");
            decimal j1  = IncomeContrastpayLogic.GetARmon(ARTime, "局长基金");
            decimal j2  = IncomeContrastpayLogic.GetUserMon(ARTime, "局长基金");

            decimal zj2 = IncomeContrastpayLogic.GetARmonZJ(ARTime, "局长基金");
            DataRow dr  = dt.NewRow();
            dr["DepName"]   = "科室业务费";
            dr["ARMon"]     = k1.ToString("f2");
            dr["ChangeMon"] = zj1.ToString("f2");
            dr["UserMon"]   = k2.ToString("f2");
            if (k2 == 0)
            {
                dr["Pecent"] = "0.00%";
            }
            else
            {
                dr["Pecent"] = k1 + zj1 / k2 * 100 + "%";
            }

            DataRow dr1 = dt.NewRow();
            dr1["DepName"]   = "局长基金";
            dr1["ARMon"]     = j1.ToString("f2");
            dr1["ChangeMon"] = zj2.ToString("f2");
            dr1["UserMon"]   = j2.ToString("f2");
            if (j2 == 0)
            {
                dr1["Pecent"] = "0.00%";
            }
            else
            {
                dr1["Pecent"] = j1 + zj2 / j2 * 100 + "%";
            }
            dt.Rows.Add(dr);
            dt.Rows.Add(dr1);
            repBudCon.DataSource = dt;
            repBudCon.DataBind();
        }
    }
Ejemplo n.º 28
0
    private DataTable Getewdt(DataTable dt)
    {
        decimal mon = 0;
        decimal p1 = 0, p2 = 0, p3 = 0, p4 = 0, p5 = 0, p6 = 0;

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt.Rows[i]["MPFunding"] = ParToDecimal.ParToDel(dt.Rows[i]["MPFunding"].ToString()) * 10000;
            if (dt.Rows[i]["MASta"].ToString() == "未提交")
            {
                p1 += ParToDecimal.ParToDel(dt.Rows[i]["MPFunding"].ToString());
                dt.Rows[i]["MASta"] = "财务室待审核";
            }
            if (dt.Rows[i]["MASta"].ToString() == "提交")
            {
                p2 += ParToDecimal.ParToDel(dt.Rows[i]["MPFunding"].ToString());
                dt.Rows[i]["MASta"] = "局领导待审核";
            }
            if (dt.Rows[i]["MASta"].ToString() == "审核通过")
            {
                p3 += ParToDecimal.ParToDel(dt.Rows[i]["MPFunding"].ToString());
            }
            if (dt.Rows[i]["MASta"].ToString() == "退回")
            {
                p4 += ParToDecimal.ParToDel(dt.Rows[i]["MPFunding"].ToString());
            }
            if (dt.Rows[i]["MASta"].ToString() == "审核不通过")
            {
                p5 += ParToDecimal.ParToDel(dt.Rows[i]["MPFunding"].ToString());
            }
            if (dt.Rows[i]["MASta"].ToString() == "")
            {
                p6 += ParToDecimal.ParToDel(dt.Rows[i]["MPFunding"].ToString());
                dt.Rows[i]["MASta"] = "未提交";
            }
            mon += ParToDecimal.ParToDel(dt.Rows[i]["MPFunding"].ToString());
        }
        if (p1 > 0)
        {
            DataRow dr1 = dt.NewRow();
            dr1["DepName"]   = "财务室待审核总金额";
            dr1["MPFunding"] = p1;
            dt.Rows.Add(dr1);
        }
        if (p2 > 0)
        {
            DataRow dr1 = dt.NewRow();
            dr1["DepName"]   = "局领导待审核总金额";
            dr1["MPFunding"] = p2;
            dt.Rows.Add(dr1);
        }
        if (p3 > 0)
        {
            DataRow dr1 = dt.NewRow();
            dr1["DepName"]   = "审核通过总金额";
            dr1["MPFunding"] = p3;
            dt.Rows.Add(dr1);
        }
        if (p4 > 0)
        {
            DataRow dr1 = dt.NewRow();
            dr1["DepName"]   = "退回总金额";
            dr1["MPFunding"] = p4;
            dt.Rows.Add(dr1);
        }
        if (p5 > 0)
        {
            DataRow dr1 = dt.NewRow();
            dr1["DepName"]   = "审核不通过总金额";
            dr1["MPFunding"] = p5;
            dt.Rows.Add(dr1);
        }
        if (p6 > 0)
        {
            DataRow dr1 = dt.NewRow();
            dr1["DepName"]   = "未提交总金额";
            dr1["MPFunding"] = p6;
            dt.Rows.Add(dr1);
        }
        if (mon > 0)
        {
            DataRow dr = dt.NewRow();
            dr["DepName"]   = "总计";
            dr["MPFunding"] = mon;
            dt.Rows.Add(dr);
        }

        return(dt);
    }
Ejemplo n.º 29
0
    /// <summary>
    /// 绑定数据
    /// </summary>
    private void DtDataBind()
    {
        decimal txt  = 0;
        int     year = Convert.ToInt32(HidYear.Value);

        //DataTable dt1 = BG_BudItemsLogic.GetPayOne(year);
        //if (dt1.Rows.Count > 0)
        //{
        //    txt += Convert.ToDecimal(dt1.Rows[0]["POTitol"]);
        //}
        //DataTable dt2 = BG_BudItemsLogic.GetPayTwo(year);
        //if (dt1.Rows.Count > 0)
        //{
        //    txt += Convert.ToDecimal(dt2.Rows[0]["PTTitol"]);
        //}
        //DataTable dt3 = BG_BudItemsLogic.GetPubPay(year);
        //if (dt1.Rows.Count > 0)
        //{
        //    txt += Convert.ToDecimal(dt3.Rows[0]["PBIDTitol"]);
        //}
        //DataTable dt4 = BG_BudItemsLogic.GetProPay(year);
        //txt += Convert.ToDecimal(dt4.Rows[0]["ProPA0M"]);
        //if (dt4.Rows.Count > 0)
        //{
        //    for (int i = 0; i < dt4.Rows.Count; i++)
        //    {
        //        txt += Convert.ToDecimal(dt4.Rows[i]["ProPA0M"]);
        //    }
        //}
        //DataTable dt5 = BG_BudItemsLogic.GetBudgetAllocation(year);
        //if (dt5.Rows.Count > 0)
        //{
        //    for (int i = 0; i < dt5.Rows.Count; i++)
        //    {
        //        txt -= Convert.ToDecimal(dt5.Rows[i]["BAAMon"]);
        //    }
        //}
        DataTable dt1 = BG_PreviewDataLogic.GetPersonPart();
        DataTable dt2 = BG_PreviewDataLogic.GetPublicPart();
        DataTable dt3 = BG_PreviewDataLogic.GetCapitalPart();

        if (dt1.Rows.Count > 0)
        {
            for (int i = 0; i < dt1.Rows.Count; i++)
            {
                txt += ParToDecimal.ParToDel(dt1.Rows[i]["PDBaseData"].ToString()) + ParToDecimal.ParToDel(dt1.Rows[i]["PDProjectData"].ToString());
            }
        }
        if (dt2.Rows.Count > 0)
        {
            for (int i = 0; i < dt2.Rows.Count; i++)
            {
                txt += ParToDecimal.ParToDel(dt2.Rows[i]["PDBaseData"].ToString()) + ParToDecimal.ParToDel(dt2.Rows[i]["PDProjectData"].ToString());
            }
        }
        if (dt3.Rows.Count > 0)
        {
            for (int i = 0; i < dt3.Rows.Count; i++)
            {
                txt += ParToDecimal.ParToDel(dt3.Rows[i]["PDBaseData"].ToString());
            }
        }
        tatal.Value = txt;
        Label4.Text = txt.ToString();
        DataTable dt = BG_DepartmentLogic.GetAllBG_EstimateDepartmentMon(year, depID);

        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();
            }
            this.Store1.DataSource = dt;
            this.Store1.DataBind();
        }
        else
        {
            X.Msg.Show(new MessageBoxConfig
            {
                Title   = "提示",
                Message = "本年度还没有添加预算,请先添加预算。",
                Width   = 300,
                Buttons = Ext.Net.MessageBox.Button.OK,
                //Multiline = true,
                //AnimEl = this.Button3.ClientID,
                //Fn = new JFunction { Fn = "showResultText" }
            });
        }
    }
    private Ext.Net.NodeCollection BuildTree(Ext.Net.NodeCollection nodes)
    {
        if (nodes == null)
        {
            nodes = new Ext.Net.NodeCollection();
        }
        Ext.Net.Node root = new Ext.Net.Node();
        root.Text = "Root";
        nodes.Add(root);



        int depid = 0, tem = 0;

        if (common.IntSafeConvert(cmbdept.SelectedItem.Value) > 0)
        {
            depid = common.IntSafeConvert(cmbdept.SelectedItem.Value);
        }
        string year = cmbyear.SelectedItem.Value ?? DateTime.Now.Year.ToString();

        string month = cmbmonth.SelectedItem.Value ?? DateTime.Now.Month.ToString();

        month = month.Length == 1 ? "0" + month : month;
        string yearMonth = year + "-" + month;

        string precmb = (common.IntSafeConvert(month) - 1).ToString();

        precmb = precmb.Length == 1 ? "0" + precmb : precmb;
        string preYearMonth = year + "-" + precmb;
        //yearMonth = "2015-02";
        //preYearMonth = "2015-01";
        //DataTable dtpiidTable = ExecuteNewLogic.GetDtPiidList(depid, yearMonth, tem);
        //DataTable predtpiidTable = ExecuteNewLogic.GetDtPiidList(depid, preYearMonth, tem);

        // DataTable dt = BG_PayIncomeLogic.GetDtPayIncomeByPIID(tem);
        DataTable dt = ExecuteNewLogic.GetDtAllPiidList(depid, yearMonth, preYearMonth);

        if (dt.Rows.Count == 0)
        {
            X.Msg.Alert("系统提示", "本月没有执行相关数据").Show();
            root.EmptyChildren = true;
            return(nodes);
        }
        DataTable dtroot   = dt.DefaultView.ToTable("dtroot", true, new string[] { "PIID", "ParentPIEcoSubName" });
        string    piidList = "";

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                int piid = common.IntSafeConvert(dt.Rows[i]["ChildID"]);
                piidList += piid + ",";
            }
        }
        piidList = piidList.TrimEnd(',');
        DataTable dtcashier = ExecuteNewLogic.GetCashierData(depid, yearMonth, piidList);
        DataTable pMoney    = ExecuteNewLogic.GetReceiptsData(depid, preYearMonth, piidList, 0);
        DataTable pMoney1   = ExecuteNewLogic.GetReceiptsData(depid, preYearMonth, piidList, 1);
        DataTable pMoney2   = ExecuteNewLogic.GetReceiptsData(depid, preYearMonth, piidList, 2);
        DataTable rpMoney   = ExecuteNewLogic.GetReceiptsData(depid, yearMonth, piidList, 0);
        DataTable rpMoney1  = ExecuteNewLogic.GetReceiptsData(depid, yearMonth, piidList, 1);
        DataTable rpMoney2  = ExecuteNewLogic.GetReceiptsData(depid, yearMonth, piidList, 2);
        DataTable totalMon  = ExecuteNewLogic.GetBudgetAllocationData(depid, year, piidList);
        DataTable newTable  = new DataTable();

        newTable.Columns.Add("PIID");
        newTable.Columns.Add("ChildID");
        newTable.Columns.Add("PIEcoSubName");
        newTable.Columns.Add("totalMon");
        newTable.Columns.Add("BQMon");
        newTable.Columns.Add("CashierBalance");
        newTable.Columns.Add("PMoney");
        newTable.Columns.Add("PMoney1");
        newTable.Columns.Add("PMoney2");
        newTable.Columns.Add("RpMoney");
        newTable.Columns.Add("RpMoney1");
        newTable.Columns.Add("RpMoney2");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow drRow = newTable.NewRow();
            int     piid  = common.IntSafeConvert(dt.Rows[i]["ChildID"]);
            if (dtcashier.Rows.Count > 0)
            {
                DataRow[] dtca = dtcashier.Select("piid=" + piid);
                if (dtca.Length > 0)
                {
                    drRow["BQMon"]          = dtca[0]["BQMon"];
                    drRow["CashierBalance"] = dtca[0]["CashierBalance"];
                }
            }
            if (rpMoney.Rows.Count > 0)
            {
                DataRow[] dtrp = rpMoney.Select("piid=" + piid);
                if (dtrp.Length > 0)
                {
                    drRow["RpMoney"] = dtrp[0]["RpMoney"];
                }
            }
            if (rpMoney1.Rows.Count > 0)
            {
                DataRow[] dtrp1 = rpMoney1.Select("piid=" + piid);
                if (dtrp1.Length > 0)
                {
                    drRow["RpMoney1"] = dtrp1[0]["RpMoney"];
                }
            }
            if (rpMoney2.Rows.Count > 0)
            {
                DataRow[] dtrp2 = rpMoney2.Select("piid=" + piid);
                if (dtrp2.Length > 0)
                {
                    drRow["RpMoney2"] = dtrp2[0]["RpMoney"];
                }
            }
            if (pMoney.Rows.Count > 0)
            {
                {
                    DataRow[] dtp = pMoney.Select("piid=" + piid);
                    if (dtp.Length > 0)
                    {
                        drRow["PMoney"] = dtp[0]["RpMoney"];
                    }
                }
            }
            if (pMoney1.Rows.Count > 0)
            {
                DataRow[] dtp1 = pMoney1.Select("piid=" + piid);
                if (dtp1.Length > 0)
                {
                    drRow["PMoney1"] = dtp1[0]["RpMoney"];
                }
            }
            if (pMoney2.Rows.Count > 0)
            {
                DataRow[] dtp2 = pMoney2.Select("piid=" + piid);
                if (dtp2.Length > 0)
                {
                    drRow["PMoney2"] = dtp2[0]["RpMoney"];
                }
            }
            if (totalMon.Rows.Count > 0)
            {
                DataRow[] dttotalMon = totalMon.Select("piid=" + piid);
                if (dttotalMon.Length > 0)
                {
                    drRow["totalMon"] = dttotalMon[0]["total"];
                }
            }
            drRow["PIEcoSubName"] = dt.Rows[i]["PIEcoSubName"].ToString();
            drRow["ChildID"]      = dt.Rows[i]["ChildID"].ToString();
            drRow["PIID"]         = dt.Rows[i]["PIID"].ToString();
            newTable.Rows.Add(drRow);
        }

        for (int i = 0; i < dtroot.Rows.Count; i++)
        {
            Node   newNode = new Node();
            string piid    = dtroot.Rows[i]["piid"].ToString();
            newNode.NodeID = piid;
            newNode.Text   = dtroot.Rows[i]["ParentPIEcoSubName"].ToString();
            newNode.Icon   = Icon.Folder;
            decimal   BQMon = 0, CashierBalance = 0, PMoney = 0, PMoney1 = 0, PMoney2 = 0, RpMoney = 0, RpMoney1 = 0, RpMoney2 = 0, total = 0;
            DataRow[] drrowsleaf = newTable.Select("PIID=" + piid);
            if (drrowsleaf.Length > 0)
            {
                for (int j = 0; j < drrowsleaf.Length; j++)
                {
                    Node nodenew = new Node();
                    nodenew.NodeID = drrowsleaf[j]["ChildID"].ToString();
                    nodenew.Text   = drrowsleaf[j]["PIEcoSubName"].ToString();
                    //nodenew.CustomAttributes.Add(new ConfigItem("PIID",drRows[j]["PIEcoSubName"].ToString(), ParameterMode.Value));
                    //nodenew.CustomAttributes.Add(new ConfigItem("PIEcoSubName",drRows[j]["PIEcoSubName"].ToString(), ParameterMode.Value));
                    nodenew.CustomAttributes.Add(new ConfigItem("BQMon", drrowsleaf[j]["BQMon"].ToString(), ParameterMode.Value));
                    nodenew.CustomAttributes.Add(new ConfigItem("CashierBalance", drrowsleaf[j]["CashierBalance"].ToString(), ParameterMode.Value));
                    nodenew.CustomAttributes.Add(new ConfigItem("PMoney", drrowsleaf[j]["PMoney"].ToString(), ParameterMode.Value));
                    nodenew.CustomAttributes.Add(new ConfigItem("PMoney1 ", drrowsleaf[j]["PMoney1"].ToString(), ParameterMode.Value));
                    nodenew.CustomAttributes.Add(new ConfigItem("PMoney2 ", drrowsleaf[j]["PMoney2"].ToString(), ParameterMode.Value));
                    nodenew.CustomAttributes.Add(new ConfigItem("RpMoney ", drrowsleaf[j]["RpMoney"].ToString(), ParameterMode.Value));
                    nodenew.CustomAttributes.Add(new ConfigItem("RpMoney1 ", drrowsleaf[j]["RpMoney1"].ToString(), ParameterMode.Value));
                    nodenew.CustomAttributes.Add(new ConfigItem("RpMoney2 ", drrowsleaf[j]["RpMoney2"].ToString(), ParameterMode.Value)); nodenew.CustomAttributes.Add(new ConfigItem("totalMon ", drrowsleaf[j]["totalMon"].ToString(), ParameterMode.Value));
                    nodenew.Leaf = true;
                    nodenew.Icon = Icon.Anchor;
                    newNode.Children.Add(nodenew);
                    BQMon          += ParToDecimal.ParToDel(drrowsleaf[j]["BQMon"].ToString());
                    CashierBalance += ParToDecimal.ParToDel(drrowsleaf[j]["CashierBalance"].ToString());
                    PMoney         += ParToDecimal.ParToDel(drrowsleaf[j]["PMoney"].ToString());
                    PMoney1        += ParToDecimal.ParToDel(drrowsleaf[j]["PMoney1"].ToString());
                    PMoney2        += ParToDecimal.ParToDel(drrowsleaf[j]["PMoney2"].ToString());
                    RpMoney        += ParToDecimal.ParToDel(drrowsleaf[j]["RpMoney"].ToString());
                    RpMoney1       += ParToDecimal.ParToDel(drrowsleaf[j]["RpMoney1"].ToString());
                    RpMoney2       += ParToDecimal.ParToDel(drrowsleaf[j]["RpMoney2"].ToString());
                    total          += ParToDecimal.ParToDel(drrowsleaf[j]["totalMon"].ToString());
                }
            }
            else
            {
                newNode.EmptyChildren = true;
            }
            newNode.CustomAttributes.Add(new ConfigItem("BQMon", BQMon.ToString(), ParameterMode.Value));
            newNode.CustomAttributes.Add(new ConfigItem("CashierBalance", CashierBalance.ToString(), ParameterMode.Value));
            newNode.CustomAttributes.Add(new ConfigItem("PMoney", PMoney.ToString(), ParameterMode.Value));
            newNode.CustomAttributes.Add(new ConfigItem("PMoney1 ", PMoney1.ToString(), ParameterMode.Value));
            newNode.CustomAttributes.Add(new ConfigItem("PMoney2 ", PMoney2.ToString(), ParameterMode.Value));
            newNode.CustomAttributes.Add(new ConfigItem("RpMoney ", RpMoney.ToString(), ParameterMode.Value));
            newNode.CustomAttributes.Add(new ConfigItem("RpMoney1 ", RpMoney1.ToString(), ParameterMode.Value));
            newNode.CustomAttributes.Add(new ConfigItem("RpMoney2 ", RpMoney2.ToString(), ParameterMode.Value));
            newNode.CustomAttributes.Add(new ConfigItem("totalMon ", total.ToString(), ParameterMode.Value));
            root.Children.Add(newNode);
        }

        return(nodes);
    }