Esempio n. 1
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();
    }
Esempio n. 2
0
 protected void btnImport_DirectClick(object sender, DirectEventArgs e)
 {
     if (Radio1.Checked)
     {
         decimal mon     = ParToDecimal.ParToDel(TFMon.Text);
         int     bgmonid = BG_MonLogic.GEtIDisEditMon(common.IntSafeConvert(CurrentYear));
         if (bgmonid > 0)
         {
             //BG_Mon bgMon=BG_MonManager.GetBG_MonByBGID(bgmonid);
             //bgMon.BGMon = mon;
             //BG_MonManager.ModifyBG_Mon(bgMon);
             //X.Msg.Alert("提示", "数据已初始化,无法修改.").Show();
             string luruyes = string.Format("luru.DoYes1({0},{1})", bgmonid, mon);
             if (BG_MonManager.GetBG_MonByBGID(bgmonid).BGMon > mon)
             {
                 X.Msg.Confirm("提示", "录入金额少于上次录入金额,是否保存?", new MessageBoxButtonsConfig
                 {
                     Yes = new MessageBoxButtonConfig
                     {
                         Handler = luruyes,
                         Text    = "是"
                     },
                     No = new MessageBoxButtonConfig
                     {
                         Handler = "luru.DoNo1()",
                         Text    = "否"
                     }
                 }).Show();
             }
             else
             {
                 BG_Mon bgMon = BG_MonManager.GetBG_MonByBGID(bgmonid);
                 bgMon.BGMon = mon;
                 BG_MonManager.ModifyBG_Mon(bgMon);
                 X.Msg.Alert("提示", "录入金额修改成功!").Show();
             }
         }
         else
         {
             BG_Mon bgMon = new BG_Mon();
             bgMon.BGYear    = common.IntSafeConvert(CurrentYear);
             bgMon.BGMon     = mon;
             bgMon.IsEditMon = 1;
             BG_MonManager.AddBG_Mon(bgMon);
             X.Msg.Alert("提示", "保存成功!").Show();
         }
     }
     else
     {
         if (FUFEXC.HasFile)
         {
             dtBind();
             // X.Msg.Alert("提示", "导入成功!").Show();
             //string message = "导入成功!";
             //Response.Write("<script language=javascript>alert(\"" + message.Trim() + "\");window.top.close();</script>");
         }
         else
         {
             X.Msg.Notify(new NotificationConfig()
             {
                 Title = "提示",
                 Html  = "                                         请先选择文件!",
                 Width = 250
             }).Show();
         }
     }
 }
Esempio n. 3
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('.');
    }
Esempio n. 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;
            }
        }
    }
Esempio n. 5
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;
    }