//绑定部门
    private void ddlDepBind()
    {
        DataTable depTable = null;

        if (DepID == AreaDepID || UserLimStr == "审核员")//if (PurviewConstant.Admin || PurviewConstant.Auditor || PurviewConstant.Examiner)
        {
            depTable = BGDepartmentManager.GetDepByfadepid(AreaDepID);
        }
        else
        {
            depTable = BGDepartmentManager.GetDepByDepid(DepID);
        }
        for (int i = 0; i < depTable.Rows.Count; i++)
        {
            cbDepment.Items.Add(new Ext.Net.ListItem(depTable.Rows[i]["depName"].ToString(), depTable.Rows[i]["depID"].ToString()));
        }

        if (DepID == AreaDepID || UserLimStr == "审核员")//if (PurviewConstant.Admin || PurviewConstant.Auditor || PurviewConstant.Examiner)
        {
            cbDepment.Items.Insert(0, new Ext.Net.ListItem("全局", "0"));
            //cbDepment.SelectedItem.Index = 0;
        }


        if (!string.IsNullOrEmpty(Request.QueryString["depid"]))
        {
            cbDepment.SelectedItem.Value = Request.QueryString["depid"];
        }
    }
    private DataTable GetGroupByDeptDt(DataTable dt)
    {
        if (dt.Rows.Count <= 0)
        {
            return(dt);
        }
        DataView dv = dt.DefaultView;

        dv.Sort = "BICode";
        DataTable dt2 = dv.ToTable(true);

        dt2.Columns.Add("DepName");
        for (int i = 0; i < dt2.Rows.Count; i++)
        {
            int depid = common.IntSafeConvert(dt2.Rows[i]["DepID"]);
            dt2.Rows[i]["DepName"] = BGDepartmentManager.GetDepNameBydepid(depid);
            total += ParseUtil.ToDecimal(dt2.Rows[i]["BIMon"].ToString(), 0);
        }
        hidtotal.Value = total.ToString();
        DataRow drNew1 = dt2.NewRow();

        drNew1["BICode"]    = "汇总统计";
        drNew1["BIStaTime"] = DateTime.Now;// Convert.ToDateTime(CurrentYear + "-10-10");
        drNew1["BudSta"]    = "合计";
        drNew1["BudID"]     = "-2";
        dt2.Rows.Add(drNew1);
        return(dt2);
    }
    private void ddlDepBind(int depid)
    {
        DataTable dt = new DataTable();                //BGDepartmentManager.GetDepByfadepid(depid);

        if (DepID == AreaDepID || UserLimStr == "审核员") //(PurviewConstant.Admin || PurviewConstant.Auditor || PurviewConstant.Examiner)
        {
            dt = BGDepartmentManager.GetDepByfadepid(AreaDepID);
        }
        else
        {
            dt = BGDepartmentManager.GetDepByDepid(depid);
        }
        if (dt.Rows.Count > 0)
        {
            ddlDep.DataSource     = dt;
            ddlDep.DataTextField  = "DepName";
            ddlDep.DataValueField = "DepID";
            ddlDep.DataBind();
        }
        if (DepID == AreaDepID || UserLimStr == "审核员")//(PurviewConstant.Admin || PurviewConstant.Auditor || PurviewConstant.Examiner)
        {
            ddlDep.Items.Insert(0, new ListItem("全局", "0"));
            cbBIProType.Enabled = true;
        }
    }
Ejemplo n.º 4
0
    private void DepDataBind()
    {
        DataTable dt = BGDepartmentManager.GetDepByfadepid(AreaDepID);

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            cmbdept.Items.Add(new ListItem(dt.Rows[i]["DepName"].ToString(), dt.Rows[i]["DepID"].ToString()));
        }
    }
Ejemplo n.º 5
0
    private void ddlDepDataBind()
    {
        DataTable dt = BGDepartmentManager.GetDepByfadepid(AreaDepID);

        ddlDep.DataTextField  = "DepName";
        ddlDep.DataValueField = "DepID";
        ddlDep.DataSource     = dt;
        ddlDep.DataBind();
        ddlDep.Items.Insert(0, new ListItem("全局", "0"));
    }
Ejemplo n.º 6
0
    private void DepDataBind()
    {
        DataTable dt = BGDepartmentManager.GetDepByfadepid(AreaDepID);

        cmbDep.Items.Add(new Ext.Net.ListItem("全局", "0"));
        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()));
            cmbDep.Items.Add(new Ext.Net.ListItem(dt.Rows[i]["DepName"].ToString(), dt.Rows[i]["DepID"].ToString()));
        }
    }
Ejemplo n.º 7
0
    ///// <summary>
    ///// 部门
    ///// </summary>
    //private void ddlDeptNameBind()
    //{
    //    DataTable dt = BGBudItemsLibrariesManager.GetAllBG_BudItemsLibrariesDept();
    //    if (dt != null && dt.Rows.Count > 0)
    //    {
    //        ddlDeptName.DataSource = dt;
    //        ddlDeptName.DataTextField = "DepName";
    //        ddlDeptName.DataValueField = "DepID";
    //        ddlDeptName.DataBind();
    //    }
    //}

    //绑定部门
    private void ddlDepBind()
    {
        DataTable dt = null;

        //if (depid == 0)//if (PurviewConstant.Admin || PurviewConstant.Auditor || PurviewConstant.Examiner)
        //{
        dt = BGDepartmentManager.GetDepByfadepid(AreaDepID);
        if (dt != null && dt.Rows.Count > 0)
        {
            ddlDeptName.DataSource     = dt;
            ddlDeptName.DataTextField  = "DepName";
            ddlDeptName.DataValueField = "DepID";
            ddlDeptName.DataBind();
        }
    }
Ejemplo n.º 8
0
    //private void Editbind()
    //{
    //    string[] strlist = decodeuse.Value.ToString().Split('*');
    //    for (int i = 0; i < strlist.Count(); i++)
    //    {
    //        TFBIProDescrip.Text = strlist[0];
    //        TFBILAppReaCon.Text = strlist[1];
    //        TFBILExpGistExp.Text = strlist[2];
    //        TFBILLongGoal.Text = strlist[3];
    //        TFBILYearGoal.Text = strlist[4];
    //        TFBILOthExpProb.Text = strlist[5];
    //    }

    //}
    //绑定部门
    private void ddlDepBind()
    {
        DataTable depTable = null;

        //if (depid == 0)//if (PurviewConstant.Admin || PurviewConstant.Auditor || PurviewConstant.Examiner)
        //{
        depTable = BGDepartmentManager.GetDepByfadepid(AreaDepID);
        //}
        //else
        //{
        //    depTable = BGDepartmentManager.GetDepByDepid(depid);
        //}
        for (int i = 0; i < depTable.Rows.Count; i++)
        {
            cb2.Items.Add(new Ext.Net.ListItem(depTable.Rows[i]["DepName"].ToString(), depTable.Rows[i]["DepID"].ToString()));
        }
    }
Ejemplo n.º 9
0
    //private void PayProjectNameBind()
    //{
    //    string bILProName = tf.Text.ToString();
    //    DataTable dt = BGBudItemsLibrariesManager.GetBGBudItemsLibrariesProjectName(bILProName);
    //    stBudget.DataSource = new DataTable();
    //    stBudget.DataSource = dt;
    //    stBudget.DataBind();
    //}
    //protected void Button1_DirectClick(object sender, DirectEventArgs e)
    //{
    //    GetItemsList();
    //}

    private DataTable GetDepName(DataTable dt)
    {
        if (dt == null && dt.Rows.Count <= 0)
        {
            X.Msg.Alert("提示", "数据为空").Show();
            return(dt);
        }

        else
        {
            dt.Columns.Add("DepName");
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                dt.Rows[i]["DepName"] = BGDepartmentManager.GetDepNameBydepid(common.IntSafeConvert(dt.Rows[i]["DepID"]));
            }
            return(dt);
        }
    }
    private DataTable getnewdt1(DataTable dt)
    {
        DataTable datNew = dt.DefaultView.ToTable();

        datNew.Columns.Add("ProProper");
        for (int i = 0; i < datNew.Rows.Count; i++)
        {
            DataTable dtbppjm = BGPayProjectManager.GetPayProjectByPPID(common.IntSafeConvert(datNew.Rows[i]["PPID"]));
            if (dtbppjm.Rows.Count > 0)
            {
                datNew.Rows[i]["ProProper"] = dtbppjm.Rows[0]["PayPrjName"].ToString();
                datNew.Rows[i]["BIFunSub"]  = BGDepartmentManager.GetDepBydepid(dt.Rows[i]["DepID"].ToString()).DepName;
            }
            else
            {
                datNew.Rows[i]["ProProper"] = 0;
                datNew.Rows[i]["BIFunSub"]  = 0;
            }
        }
        return(datNew);
    }
    private void DepDataBind()
    {
        DataTable dt = new DataTable(); //BGDepartmentManager.GetDepByfadepid(depid);

        if (UserLimStr == "录入员")
        {
            cmbDep.Text    = BG_DepartmentManager.GetBG_DepartmentByDepID(depid).DepName;
            Execute.Hidden = false;
        }
        else
        {
            cmbDep.Enable(true);
            dt = BGDepartmentManager.GetDepByfadepid(AreaDepID);
            cmbDep.Items.Add(new Ext.Net.ListItem("全局", "0"));
            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()));
                cmbDep.Items.Add(new Ext.Net.ListItem(dt.Rows[i]["DepName"].ToString(), dt.Rows[i]["DepID"].ToString()));
            }
        }
    }
Ejemplo n.º 12
0
    private void DepDataBind()
    {
        DataTable dt = new DataTable(); //BGDepartmentManager.GetDepByfadepid(depid);

        DepID = ((UserLimStr == "审核员" || UserLimStr == "出纳员") ? AreaDepID : DepID);
        if (DepID == AreaDepID)
        {
            dt = BGDepartmentManager.GetDepByfadepid(AreaDepID);
            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()));
                cmbdept.SelectedItem.Index = 0;
            }
        }
        else
        {
            dt = BGDepartmentManager.GetDepByDepid(DepID);
            cmbdeptstore.DataSource = dt;
            cmbdeptstore.DataBind();
            cmbdept.SelectedItem.Index = 0;
        }
    }
    public DataTable GetProtypeDt(DataTable dt)
    {
        decimal TotalMoney = 0;

        dt.Columns.Add("IsRed");

        List <string> listTmp      = new List <string>();
        List <string> listIndexTmp = new List <string>();

        for (int i = 0; i < dt.Rows.Count; i++)
        {
            DataRow drNew       = dt.NewRow();
            string  year        = dt.Rows[i]["StaYear"].ToString();
            string  YearProType = year + dt.Rows[i]["BIProType"].ToString();
            dt.Rows[i]["BIFunSub"] = BGDepartmentManager.GetDepBydepid(dt.Rows[i]["DepID"].ToString()).DepName;

            DataRow[] dr = dt.Select("BIProType ='" + dt.Rows[i]["BIProType"].ToString() + "' and StaYear=" + year);


            if (dr.Length > 1)
            {
                TotalMoney = 0;
                for (int j = 0; j < dr.Length; j++)
                {
                    TotalMoney += ParseUtil.ToDecimal(dr[j]["BIMon"].ToString(), 0);
                }
                if (!listTmp.Contains(YearProType))
                {
                    drNew["BICode"]    = "项目类型汇总";
                    drNew["BIProType"] = dt.Rows[i]["BIProType"].ToString();
                    drNew["BIProName"] = "";
                    drNew["BIFunSub"]  = "";
                    drNew["BIMon"]     = TotalMoney;
                    drNew["BIStaTime"] = dt.Rows[i]["BIStaTime"].ToString();
                    drNew["BudSta"]    = dt.Rows[i]["BudSta"].ToString();
                    drNew["BudID"]     = "-1";
                    drNew["IsRed"]     = "-1";
                    dt.Rows.InsertAt(drNew, i);
                    listTmp.Add(YearProType);
                }
            }

            else
            {
                dt.Rows[i]["IsRed"] = "-1";
            }
        }
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            if (dt.Rows[i]["IsRed"] == "-1")
            {
                total += ParseUtil.ToDecimal(dt.Rows[i]["BIMon"].ToString(), 0);
            }
        }
        DataRow drNew1 = dt.NewRow();

        drNew1["BICode"]    = "汇总统计";
        drNew1["BIStaTime"] = Convert.ToDateTime(CurrentYear + "-10-10");
        drNew1["BudSta"]    = "合计";
        drNew1["BudID"]     = "-2";
        dt.Rows.Add(drNew1);
        return(dt);
    }
Ejemplo n.º 14
0
    private List <object> GetListStr()
    {
        txtshow.Text = "";
        int           depid    = common.IntSafeConvert(cmbDep.SelectedItem.Value);
        List <object> strlist  = new List <object>();
        int           piidflag = 0;
        string        depname  = "";
        string        name     = "";
        decimal       mon      = 0;
        decimal       supp     = 0;

        if (depid == 0 && DropDownFieldDv.Text.ToString() == "全部")
        {
            DataTable dt = BG_BudgetAllocationLogic.GetALLAAMon(common.IntSafeConvert(CurrentYear));
            //for (int i = 0; i < dt.Rows.Count; i++)
            //{
            //    depname = BG_DepartmentManager.GetBG_DepartmentByDepID(common.IntSafeConvert(dt.Rows[i]["depid"])).DepName;
            //    name = BG_PayIncomeManager.GetBG_PayIncomeByPIID(common.IntSafeConvert(dt.Rows[i]["PIID"])).PIEcoSubName;
            //    strlist.Add(new { depname = depname, name = name, mon = mon });
            //}
            if (dt.Rows.Count <= 0)
            {
                strlist.Clear();
                string message = "没有查询到数据";
                txtshow.Text = message;
            }
            else
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    piidflag = common.IntSafeConvert(dt.Rows[i]["PIID"]);
                    depname  = BG_DepartmentManager.GetBG_DepartmentByDepID(common.IntSafeConvert(dt.Rows[i]["DepID"])).DepName;
                    name     = BG_PayIncomeManager.GetBG_PayIncomeByPIID(common.IntSafeConvert(dt.Rows[i]["PIID"])).PIEcoSubName;
                    mon      = ParToDecimal.ParToDel(dt.Rows[i]["BAAMon"].ToString());
                    supp     = ParToDecimal.ParToDel(dt.Rows[i]["SuppMon"].ToString());
                    strlist.Add(new { piidflag = piidflag, depname = depname, name = name, mon = mon, supp = supp });
                }
            }
        }
        else if (depid == 0 && DropDownFieldDv.Text.ToString() != "全部")
        {
            name = DropDownFieldDv.Text.ToString();
            DataTable dt   = BGDepartmentManager.GetDepByfadepid(AreaDepID);
            string    bgpi = BG_BudItemsLogic.GetBG_PayIncomeByname(name);
            if (name == "工资福利支出" || name == "商品和服务支出" || name == "对个人和家庭补助支出" || name == "其他资本性支出")
            {
                DataTable dta = BG_BudgetAllocationLogic.GetALLAAMon(common.IntSafeConvert(CurrentYear));
                //for (int i = 0; i < dta.Rows.Count; i++)
                //{
                //    depname = BG_DepartmentManager.GetBG_DepartmentByDepID(common.IntSafeConvert(dta.Rows[i]["depid"])).DepName;
                //    name = BG_PayIncomeManager.GetBG_PayIncomeByPIID(common.IntSafeConvert(dta.Rows[i]["PIID"])).PIEcoSubName;
                //    strlist.Add(new { depname = depname, name = name, mon = mon });
                //}
                if (dta.Rows.Count <= 0)
                {
                    strlist.Clear();
                    string message = "没有查询到数据";
                    txtshow.Text = message;
                }
                else
                {
                    for (int i = 0; i < dta.Rows.Count; i++)
                    {
                        piidflag = common.IntSafeConvert(dta.Rows[i]["PIID"]);
                        depname  = BG_DepartmentManager.GetBG_DepartmentByDepID(common.IntSafeConvert(dta.Rows[i]["DepID"])).DepName;
                        name     = BG_PayIncomeManager.GetBG_PayIncomeByPIID(common.IntSafeConvert(dta.Rows[i]["PIID"])).PIEcoSubName;
                        mon      = ParToDecimal.ParToDel(dta.Rows[i]["BAAMon"].ToString());
                        supp     = ParToDecimal.ParToDel(dta.Rows[i]["SuppMon"].ToString());
                        strlist.Add(new { piidflag = piidflag, depname = depname, name = name, mon = mon, supp = supp });
                    }
                }
            }

            string[]  slist = bgpi.Split(',');
            DataTable dt1   = new DataTable();
            for (int i = 0; i < slist.Count(); i++)
            {
                int piid = common.IntSafeConvert(slist[i]);
                dt1 = BG_BudgetAllocationLogic.GetAAMonDTbyPIID(common.IntSafeConvert(CurrentYear), piid);
                if (dt1.Rows.Count > 0)
                {
                    for (int j = 0; j < dt1.Rows.Count; j++)
                    {
                        depname = BG_DepartmentManager.GetBG_DepartmentByDepID(common.IntSafeConvert(dt1.Rows[j]["DepID"])).DepName;
                        mon    += ParToDecimal.ParToDel(dt1.Rows[j]["BAAMon"].ToString());
                        supp   += ParToDecimal.ParToDel(dt1.Rows[j]["SuppMon"].ToString());
                        strlist.Add(new { piidflag = piid, depname = depname, name = name, mon = mon, supp = supp });
                    }
                }
            }
            if (strlist.Count <= 0)
            {
                strlist.Clear();
                string message = "没有查询到数据";
                txtshow.Text = message;
            }
        }
        else if (depid != 0 && DropDownFieldDv.Text.ToString() == "全部")
        {
            depname = cmbDep.SelectedItem.Text;
            DataTable dt = BG_BudgetAllocationLogic.GetAAMonDTbyDepID(common.IntSafeConvert(CurrentYear), common.IntSafeConvert(cmbDep.SelectedItem.Value));
            if (dt.Rows.Count <= 0)
            {
                strlist.Clear();
                string message = "没有查询到数据";
                txtshow.Text = message;
            }
            else
            {
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    piidflag = common.IntSafeConvert(dt.Rows[i]["PIID"]);
                    name     = BG_PayIncomeManager.GetBG_PayIncomeByPIID(piidflag).PIEcoSubName;
                    mon      = ParToDecimal.ParToDel(dt.Rows[i]["BAAMon"].ToString());
                    supp     = ParToDecimal.ParToDel(dt.Rows[i]["SuppMon"].ToString());
                    strlist.Add(new { piidflag = piidflag, depname = depname, name = name, mon = mon, supp = supp });
                }
            }
        }
        else
        {
            name = DropDownFieldDv.Text.ToString();
            if (name == "工资福利支出" || name == "商品和服务支出" || name == "对个人和家庭补助支出" || name == "其他资本性支出")
            {
                depname = cmbDep.SelectedItem.Text;
                DataTable dta = BG_BudgetAllocationLogic.GetAAMonDTbyDepID(common.IntSafeConvert(CurrentYear), common.IntSafeConvert(cmbDep.SelectedItem.Value));
                if (dta.Rows.Count <= 0)
                {
                    strlist.Clear();
                    string message = "没有查询到数据";
                    txtshow.Text = message;
                }
                else
                {
                    for (int i = 0; i < dta.Rows.Count; i++)
                    {
                        piidflag = common.IntSafeConvert(dta.Rows[i]["PIID"]);
                        name     = BG_PayIncomeManager.GetBG_PayIncomeByPIID(piidflag).PIEcoSubName;
                        mon      = ParToDecimal.ParToDel(dta.Rows[i]["BAAMon"].ToString());
                        supp     = ParToDecimal.ParToDel(dta.Rows[i]["SuppMon"].ToString());
                        strlist.Add(new { piidflag = piidflag, depname = depname, name = name, mon = mon, supp = supp });
                    }
                }
            }
            string    bgpi  = BG_BudItemsLogic.GetBG_PayIncomeByname(name);
            string[]  slist = bgpi.Split(',');
            DataTable dt    = new DataTable();
            for (int i = 0; i < slist.Count(); i++)
            {
                int piid = common.IntSafeConvert(slist[i]);
                dt = BG_BudgetAllocationLogic.GetAAMon(depid, piid, common.IntSafeConvert(CurrentYear));
                if (dt.Rows.Count > 0)
                {
                    mon  += ParToDecimal.ParToDel(dt.Rows[0]["BAAMon"].ToString());
                    supp += ParToDecimal.ParToDel(dt.Rows[0]["SuppMon"].ToString());
                }
                mon  += 0;
                supp += 0;
            }

            if (dt.Rows.Count <= 0)
            {
                strlist.Clear();
                string message = "没有查询到数据";
                txtshow.Text = message;
            }
            else
            {
                depname = cmbDep.SelectedItem.Text;
                strlist.Add(new { piidflag = common.IntSafeConvert(slist[0]), depname = depname, name = name, mon = mon, supp = supp });
            }
        }
        string  str     = "";
        decimal summon  = 0;
        decimal sumsupp = 0;

        for (int i = 0; i < strlist.Count; i++)
        {
            str      = strlist[i].ToString();
            summon  += Getmon(str, "mon");
            sumsupp += Getmon(str, "supp");
        }
        strlist.Add(new { piidflag = 0, depname = "总计", name = "", mon = summon, supp = sumsupp });
        return(strlist);
    }