Exemplo n.º 1
0
 private void DepDataBind()
 {
     if (UserLimStr == "审核员")
     {
         int year = common.IntSafeConvert(CurrentYear);
         try
         {
             year = common.IntSafeConvert(cmbyear.SelectedItem.Value);
         }
         catch
         {
             year = common.IntSafeConvert(CurrentYear);
         }
         if (year == 0)
         {
             year = common.IntSafeConvert(CurrentYear);
         }
         DataTable dt = BG_DepartmentLogic.GetDepByfadepid(AreaDepID, year);
         cmbdeptStore.DataSource = dt;
         cmbdeptStore.DataBind();
         //for (int i = 0; i < dt.Rows.Count; i++)
         //{
         //    //  cmbDepnaem.Items.Add(new Ext.Net.ListItem(depTable.Rows[i]["depName"].ToString(), depTable.Rows[i]["depID"].ToString()));
         //    cmbdept.Items.Add(new Ext.Net.ListItem(dt.Rows[i]["DepName"].ToString(), dt.Rows[i]["DepID"].ToString()));
         //}
     }
     else
     {
         cmbdept.Items.Add(new Ext.Net.ListItem(DepName, DepID.ToString()));
         cmbdept.Disable(true);
     }
 }
    /// <summary>
    /// 绑定数据
    /// </summary>
    private void DtDataBind()
    {
        DataTable dt = BG_DepartmentLogic.GetAllBG_Department(AreaDepID);

        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 = MessageBox.Button.OK,
                //Multiline = true,
                //AnimEl = this.Button3.ClientID,
                //Fn = new JFunction { Fn = "showResultText" }
            });
        }
    }
Exemplo n.º 3
0
    public string NodeLoad(string nodeID)
    {
        DataTable      dt       = BG_DepartmentLogic.GetAllBG_Department(AreaDepID);
        NodeCollection nodes    = new Ext.Net.NodeCollection();
        Node           rootNode = new Node();

        rootNode.Text = "部门管理";
        rootNode.Icon = Icon.Folder;
        nodes.Add(rootNode);
        rootNode.Expanded = true;
        List <string> listdep = new List <string>();

        if (dt.Rows.Count > 0)
        {
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                string depname = dt.Rows[i]["DepName"].ToString();

                string depid = dt.Rows[i]["DepID"].ToString();
                listdep.Add(depname);
                Node node1 = new Node();
                node1.NodeID = dt.Rows[i]["DepID"].ToString();
                node1.Text   = depname;
                node1.Icon   = Icon.UserHome;
                int sedepid = common.IntSafeConvert((int)Session["depid"]);
                if (sedepid == common.IntSafeConvert(dt.Rows[i]["DepID"]))
                {
                    node1.Expanded = true;
                }
                //node1.Leaf = true;
                rootNode.Children.Add(node1);
                DataTable dt1 = BG_UserLogic.GetDtUserByDepid(depid);
                if (dt1.Rows.Count > 0)
                {
                    for (int j = 0; j < dt1.Rows.Count; j++)
                    {
                        Node node2 = new Node();
                        node2.NodeID = dt1.Rows[j]["UserID"].ToString() + "用户";
                        node2.Text   = dt1.Rows[j]["UserName"].ToString();
                        node2.Icon   = Icon.User;
                        node2.Leaf   = true;
                        node1.Children.Add(node2);
                    }
                }
                else
                {
                    node1.EmptyChildren = true;
                }
            }
        }
        Session["sedep"] = listdep;
        return(nodes.ToJson());
    }
    protected void btnMod_DirectClick(object sender, DirectEventArgs e)
    {
        BG_Department dp = BG_DepartmentManager.GetBG_DepartmentByDepID(StrToInt(hiddepid.Text));

        if (BG_DepartmentLogic.GetBG_DepartmentByName(AdName.Text.Trim()) != null)
        {
            X.Msg.Alert("提示", "部门名称重复,请重新填写.").Show();
            return;
        }
        dp.DepName = txtEDName.Text.Trim().Replace(",", string.Empty).Replace(",", string.Empty);
        dp.DepRem  = txtEDDes.Text.Trim().Replace(",", string.Empty).Replace(",", string.Empty);
        BG_DepartmentManager.ModifyBG_Department(dp);
        txtEDName.Clear();
        hiddepid.Clear();
        txtEDDes.Clear();
        DtDataBind();
        reset.Reset();
        WinEdit.Close();
    }
 protected void btnWinAdd_DirectClick(object sender, DirectEventArgs e)
 {
     if (AdName.Text != null)
     {
         if (BG_DepartmentLogic.GetBG_DepartmentByName(AdName.Text.Trim()) != null)
         {
             X.Msg.Alert("提示", "部门名称重复,请重新填写.").Show();
             return;
         }
         BG_Department dp = new BG_Department();
         dp.DepName = AdName.Text.ToString();
         dp.DepRem  = AdDes.Text.ToString();
         dp.FaDepID = AreaDepID;
         dp.DepLev  = 4;
         BG_DepartmentManager.AddBG_Department(dp);
         DtDataBind();
         resetform.Reset();
     }
     else
     {
         X.Msg.Alert("提示", "部门为必填项").Show();
     }
 }
Exemplo n.º 6
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" }
            });
        }
    }
Exemplo n.º 7
0
    private void add()
    {
        UserID.Text = "";
        BG_User user = new BG_User();

        user.UserIDNum = TextField4.Text;
        user.UserName  = TextField1.Text.Replace(",", string.Empty).Replace(",", string.Empty);
        if (user.UserName == "" || user.UserName == (string)Session["depname"])
        {
            X.Msg.Alert("提示", "人名不能与部门名重名!").Show();
            return;
        }
        if (BG_UserLogic.IsUser(user.UserName))
        {
            X.Msg.Alert("提示", "已经存在该姓名,请使用其他姓名添加!").Show();
            return;
        }
        user.UserNum = TextField3.Text;
        user.UserRem = txtRem.Text.Replace(",", string.Empty).Replace(",", string.Empty);
        string limit = string.Empty;
        int    isvip = 0;

        if (Radio1.Checked == true)
        {
            limit = "100000";
            user.UserDescription = "管理员";
        }

        if (Radio2.Checked == true)
        {
            limit = "010000";
            user.UserDescription = "局领导";
        }
        if (Radio3.Checked == true)
        {
            limit = "001000";
            user.UserDescription = "审核员";
        }
        if (Radio4.Checked == true)
        {
            limit = "000100";
            user.UserDescription = "录入人员";
        }
        if (Radio5.Checked == true)
        {
            limit = "000010";
            user.UserDescription = "查询人员";
        }
        if (Radio6.Checked == true)
        {
            limit = "000001";
            user.UserDescription = "出纳员";
        }

        if (Radio7.Checked == true)
        {
            isvip = 1;
        }
        if (Radio8.Checked == true)
        {
            isvip = 0;
        }
        //if (Radio19.Checked == true)
        //{
        //    isvip = 2;
        //}
        string applyrem  = "";
        string applyrem1 = "";
        string applyrem2 = "";
        string applyrem3 = "";

        applyrem1 = Radio9.Checked == true ? "1" : "0";
        applyrem2 = Radio10.Checked == true ? "1" : "0";
        applyrem3 = Radio11.Checked == true ? "1" : "0";

        user.UserLim = limit;
        //user.UserSta = StrToInt(cbbSta.Text);
        //if (cbbSta.Text == "禁用")
        //{
        //    user.UserSta = 2;
        //}
        //if (cbbSta.Text == "禁用")
        //{
        //    user.UserSta = 1;
        //}
        user.UserSta = 1;
        user.UserPwd = "12345";
        int depid = common.IntSafeConvert(BG_DepartmentLogic.GetBG_DepartmentByName((string)Session["depname"]).DepID);

        user.DepID    = depid;
        user.IsVIP    = isvip;
        user.ApplyRem = applyrem;
        if (BG_UserManager.AddBG_User(user).UserID > 0)
        {
            Node node = new Node();

            node.Text = user.UserName;
            node.Icon = Icon.User;
            node.Leaf = true;
            STMem.GetNodeById(depid).AppendChild(node);
            //X.Msg.Show(new MessageBoxConfig
            //{
            //    Title = "提示",
            //    Message = "添加成功",
            //    Width = 300,
            //    Buttons = MessageBox.Button.OK,
            //});
            Session["depname"] = "政策法规科";
            Response.Redirect("STMember.aspx?depid=" + depid, true);
        }
        //STMem.ExpandAll();
        //int depid = AreaDepID;
    }
Exemplo n.º 8
0
    private void mod(int uid)
    {
        BG_User user = BG_UserManager.GetBG_UserByUserID(uid);

        user.UserName  = TextField1.Text.Replace(",", string.Empty).Replace(",", string.Empty);
        user.UserNum   = TextField3.Text.Replace(",", string.Empty).Replace(",", string.Empty);
        user.UserIDNum = TextField4.Text.Replace(",", string.Empty).Replace(",", string.Empty);
        user.UserRem   = txtRem.Text.Replace(",", string.Empty).Replace(",", string.Empty);
        string limit    = string.Empty;
        int    isvip    = 0;
        string applyrem = "";

        if (Radio1.Checked == true)
        {
            limit = "100000";
            user.UserDescription = "管理员";
        }

        if (Radio2.Checked == true)
        {
            limit = "010000";
            user.UserDescription = "局领导";
        }
        if (Radio3.Checked == true)
        {
            limit = "001000";
            user.UserDescription = "审核员";
        }
        if (Radio4.Checked == true)
        {
            limit = "000100";
            user.UserDescription = "录入人员";
        }
        if (Radio5.Checked == true)
        {
            limit = "000010";
            user.UserDescription = "查询人员";
        }
        if (Radio6.Checked == true)
        {
            limit = "000001";
            user.UserDescription = "出纳员";
        }

        if (Radio7.Checked == true)
        {
            isvip = 1;
        }
        if (Radio8.Checked == true)
        {
            isvip = 0;
        }
        //if (Radio9.Checked == true)
        //{
        //    applyrem = "000";
        //}
        string applyrem1 = "";
        string applyrem2 = "";
        string applyrem3 = "";

        applyrem1    = Radio9.Checked == true ? "1" : "0";
        applyrem2    = Radio10.Checked == true ? "1" : "0";
        applyrem3    = Radio11.Checked == true ? "1" : "0";
        applyrem     = applyrem1 + applyrem2 + applyrem3;
        user.UserLim = limit;
        string    depname = ComboBox1.Text; //ComboBox1.RawValue.ToString();
        DataTable dt      = BG_DepartmentLogic.GetDepidByName(depname);

        if (dt.Rows.Count > 0)
        {
            user.DepID = StrToInt(dt.Rows[0]["DepID"].ToString());
        }
        user.IsVIP    = isvip;
        user.ApplyRem = applyrem;
        // faUser.UserPurStr = "000000";
        if (BG_UserManager.ModifyBG_User(user))
        {
            X.Msg.Show(new MessageBoxConfig
            {
                Title   = "提示",
                Message = "修改成功",
                Width   = 300,
                Buttons = Ext.Net.MessageBox.Button.OK,
            });
            int depid = common.IntSafeConvert(user.DepID);
            Response.Redirect("STMember.aspx?depid=" + depid, true);
            //Response.Redirect("STMember.aspx", true);
        }
    }
Exemplo n.º 9
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;
            }
        }
    }
Exemplo n.º 10
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;
    }