Ejemplo n.º 1
0
    protected void btnSubmit_Click(object sender, EventArgs e)
    {
        int year  = common.IntSafeConvert(cmbyear.SelectedItem.Value);
        int month = common.IntSafeConvert(cmbmonth.SelectedItem.Value);

        if (year <= 0 || month <= 0)
        {
            X.Msg.Alert("提示", "请先选择年度").Show();
            return;
        }
        string    Month     = month > 9 ? month.ToString() : "0" + month.ToString();
        string    YearMonth = year.ToString() + "-" + Month;
        int       depid     = common.IntSafeConvert(cmbdept.SelectedItem.Value.ToString());
        int       pici      = common.IntSafeConvert(cmbpici.SelectedItem.Text);
        DataTable dt        = BG_ChaSecAuditLogic.GetChaSecAudit(depid, year, month, pici);
        string    months    = month < 10 ? 0 + month.ToString() : month.ToString();

        // string yearMon = year + "-" + months;
        if (dt.Rows.Count <= 0)
        {
            X.Msg.Alert("提示", "没有可选数据").Show();
        }
        else
        {
            int prid = 0;
            if (depid == 0 || pici == 0)
            {
                DataTable dt_new = dt.DefaultView.ToTable(true, "PRID");
                dt_new.AsEnumerable().ToList().ForEach(
                    x =>
                {
                    prid = common.IntSafeConvert(x["PRID"].ToString());
                    if (prid > 0)
                    {
                        DoAudit(YearMonth, depid, pici, dt, prid);
                    }
                });
            }
            else
            {
                prid = common.IntSafeConvert(dt.Rows[0]["PRID"]);
                if (prid > 0)
                {
                    DoAudit(YearMonth, depid, pici, dt, prid);
                }
            }
        }
        DepDataBind();
        MonthDataBind();
    }
Ejemplo n.º 2
0
    private void AuditStoreBind1()
    {
        hidflag.Text = "2";
        int       year  = Convert.ToInt32(cmbyear.SelectedItem.Value);
        int       month = Convert.ToInt32(cmbmonth.SelectedItem.Value);
        int       depid = common.IntSafeConvert(cmbdept.SelectedItem.Value.ToString());
        DataTable dt    = BG_ChaSecAuditLogic.GetChaSecAudit1(depid, year, month, common.IntSafeConvert(cmbpici.SelectedItem.Text));

        AuditStore.DataSource = Getnew1(dt);
        AuditStore.DataBind();
        if (dt.Rows.Count <= 1)
        {
            X.Msg.Alert("提示", "没有查询到数据").Show();
        }
    }
Ejemplo n.º 3
0
    private void AuditStoreBind1(int depid, int year, int month, int pici)
    {
        cmbdept.SelectedItem.Value  = depid.ToString();
        cmbyear.SelectedItem.Value  = year.ToString();
        cmbmonth.SelectedItem.Value = month.ToString();
        cmbpici.SelectedItem.Value  = pici.ToString();
        hidflag.Text = "2";
        DataTable dt = BG_ChaSecAuditLogic.GetChaSecAudit1(depid, year, month, pici);

        AuditStore.DataSource = Getnew1(dt);
        AuditStore.DataBind();
        if (dt.Rows.Count <= 1)
        {
            X.Msg.Alert("提示", "没有查询到数据").Show();
        }
    }
Ejemplo n.º 4
0
    public void GetRowexpand(string pisubid)
    {
        int psub = common.IntSafeConvert(pisubid);

        if (psub == 1000 || psub == 1015 || psub == 1051 || psub == 1065)
        {
            if (psub == 1000)
            {
                if (common.IntSafeConvert(Session["1000"]) == 1)
                {
                    Session["1000"] = 0;
                }
                else
                {
                    Session["1000"] = 1;
                }
            }
            if (psub == 1015)
            {
                if (common.IntSafeConvert(Session["1015"]) == 1)
                {
                    Session["1015"] = 0;
                }
                else
                {
                    Session["1015"] = 1;
                }
            }
            if (psub == 1051)
            {
                if (common.IntSafeConvert(Session["1051"]) == 1)
                {
                    Session["1051"] = 0;
                }
                else
                {
                    Session["1051"] = 1;
                }
            }
            if (psub == 1065)
            {
                if (common.IntSafeConvert(Session["1065"]) == 1)
                {
                    Session["1065"] = 0;
                }
                else
                {
                    Session["1065"] = 1;
                }
            }
            int       year   = common.IntSafeConvert(cmbyear.SelectedItem.Value.ToString());
            int       month  = common.IntSafeConvert(cmbmonth.SelectedItem.Value.ToString());
            int       depid  = common.IntSafeConvert(cmbdept.SelectedItem.Value.ToString());
            DataTable dt     = BG_ChaSecAuditLogic.GetChaSecAudit(depid, year, month, common.IntSafeConvert(cmbpici.SelectedItem.Text));
            DataRow[] drlist = dt.Select(" PIEcoSubParID=" + pisubid + " ");
            DataTable dtbase = BG_ChaSecAuditLogic.GetChaSecAudit1(depid, year, month, common.IntSafeConvert(cmbpici.SelectedItem.Text));
            if (common.IntSafeConvert(Session[pisubid]) == 0)
            {
                AuditStore.DataSource = Getnew1(dtbase);
                AuditStore.DataBind();
            }
            else
            {
                int t = 0;
                for (int j = 0; j < dtbase.Rows.Count; j++)
                {
                    if (common.IntSafeConvert(dtbase.Rows[j]["PIEcoSubParID"]) == psub)
                    {
                        t = j + 1;
                    }
                }
                for (int i = 0; i < drlist.Length; i++)
                {
                    DataRow row = dtbase.NewRow();
                    //设定行中的值
                    row["PIEcoSubParID"] = drlist[i]["PIEcoSubParID"];

                    row["PIEcoSubName"] = drlist[i]["PIEcoSubName"];
                    row["MPFunding"]    = drlist[i]["MPFunding"];
                    row["MASta"]        = drlist[i]["MASta"];
                    dtbase.Rows.InsertAt(row, t++);
                }
                AuditStore.DataSource = Getnew1(dtbase);
                AuditStore.DataBind();
            }
        }
        else
        {
            return;
        }
    }