Exemple #1
0
    private void IFDYearDataBind()
    {
        DataTable dt    = BG_SysSettingManager.GetAllBG_SysSetting();
        int       count = dt.Rows.Count;

        if (count > 0)
        {
            txtYear1.Text = CurrentYear.ToString();
        }
    }
Exemple #2
0
    private void IFDYearDataBind()
    {
        DataTable dt    = BG_SysSettingManager.GetAllBG_SysSetting();
        int       count = dt.Rows.Count;

        if (count > 0)
        {
            txtYear1.Text = dt.Rows[count - 1]["DefaultYear"].ToString();
        }
    }
    private void STDataBind()
    {
        DataTable dt    = BG_SysSettingManager.GetAllBG_SysSetting();
        int       count = dt.Rows.Count;

        if (count > 0)
        {
            hidID.Value        = dt.Rows[count - 1]["SSID"].ToString();
            TFSysName.Text     = dt.Rows[count - 1]["SysName"].ToString();
            TFDefaultYear.Text = dt.Rows[count - 1]["DefaultYear"].ToString();
            TFPopNum.Text      = dt.Rows[count - 1]["PepNum"].ToString();
        }
    }
Exemple #4
0
    private void ddlTimeDataBind()
    {
        DataTable dt  = BG_SysSettingManager.GetAllBG_SysSetting();
        DataTable dt1 = new DataTable();

        dt1.Columns.Add("Year");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            dt1.Rows.Add("");
            dt1.Rows[i]["Year"] = dt.Rows[dt.Rows.Count - i - 1]["DefaultYear"];
        }
        ddlYear.DataTextField  = "Year";
        ddlYear.DataValueField = "Year";
        ddlYear.DataSource     = dt1;
        ddlYear.DataBind();
    }
    protected void btnSure_DirectClick(object sender, Ext.Net.DirectEventArgs e)
    {
        DataTable dt      = BG_SysSettingManager.GetAllBG_SysSetting();
        int       count   = dt.Rows.Count;
        int       curtime = 0;

        if (count == 0)
        {
            curtime = Convert.ToInt32(TFDefaultYear.Text);
        }
        else
        {
            curtime = Convert.ToInt32(dt.Rows[count - 1]["DefaultYear"].ToString());
        }

        if (Convert.ToInt32(TFDefaultYear.Text.Trim()) >= curtime)
        {
            BG_SysSetting bg_sys = new BG_SysSetting();
            bg_sys.SysName     = TFSysName.Text.Trim();
            bg_sys.DefaultYear = Convert.ToInt32(TFDefaultYear.Text.Trim());
            bg_sys.PepNum      = Convert.ToInt32(TFPopNum.Text.Trim());
            BG_SysSettingManager.AddBG_SysSetting(bg_sys);
            X.Msg.Alert("提示", "添加成功!").Show();
        }
        else
        {
            BG_SysSetting bg_sys = new BG_SysSetting();
            bg_sys.SSID        = Convert.ToInt32(hidID.Value);
            bg_sys.SysName     = TFSysName.Text.Trim();
            bg_sys.DefaultYear = Convert.ToInt32(TFDefaultYear.Text.Trim());
            bg_sys.PepNum      = Convert.ToInt32(TFPopNum.Text.Trim());
            bool flag = BG_SysSettingManager.ModifyBG_SysSetting(bg_sys);
            if (flag)
            {
                X.Msg.Alert("提示", "修改成功!").Show();
            }
            else
            {
                X.Msg.Alert("提示", "修改失败,请与管理员联系!").Show();
            }
        }
    }
    private void PreviewDataBind()
    {
        DataTable dt = BG_PreviewDataLogic.GetPublicPart();

        dt.Columns.Add("rsold");
        dt.Columns.Add("rsnew");
        dt.Columns.Add("rjsold");
        dt.Columns.Add("rjsnew");
        for (int i = 0; i < dt.Rows.Count; i++)
        {
            int       year    = common.IntSafeConvert(CurrentYear);
            string    pnumold = "";
            string    pnumnew = "";
            DataTable dt1     = BG_SysSettingManager.GetAllBG_SysSetting();
            if (dt.Rows.Count > 0)
            {
                pnumold     = BG_SysSettingLogic.GetPerByYear(year - 1);
                pnumnew     = BG_SysSettingLogic.GetPerByYear(year);
                hidbn.Value = pnumnew;
            }
            else
            {
                pnumold     = "0";
                pnumnew     = "0";
                hidbn.Value = pnumnew;
            }
            dt.Rows[i]["rsold"] = pnumold;
            dt.Rows[i]["rsnew"] = pnumnew;
            int pepold = common.IntSafeConvert(pnumold);
            int pepnew = common.IntSafeConvert(pnumnew);
            dt.Rows[i]["rjsold"] = (Convert.ToDouble(dt.Rows[i]["PDBaseLYData"]) / (pepold * 1.0f)).ToString("f8").TrimEnd('0').TrimEnd('.');
            dt.Rows[i]["rjsnew"] = (Convert.ToDouble(dt.Rows[i]["PDBaseData"]) / (pepnew * 1.0f)).ToString("f8").TrimEnd('0').TrimEnd('.');
        }

        Store1.DataSource = Getquota(dt);
        Store1.DataBind();
    }
    private void PreviewDataBind()
    {
        int       year = common.IntSafeConvert(CurrentYear);
        DataTable dt1  = BG_PreviewDataLogic.GetPersonPart();

        dt1.Columns.Add("rsold");
        dt1.Columns.Add("rsnew");
        dt1.Columns.Add("rjsold");
        dt1.Columns.Add("rjsnew");
        DataTable dt2 = BG_PreviewDataLogic.GetPublicPart();

        dt2.Columns.Add("rsold");
        dt2.Columns.Add("rsnew");
        dt2.Columns.Add("rjsold");
        dt2.Columns.Add("rjsnew");
        DataTable dt3 = BG_PreviewDataLogic.GetCapitalPart();

        dt3.Columns.Add("rsold");
        dt3.Columns.Add("rsnew");
        dt3.Columns.Add("rjsold");
        dt3.Columns.Add("rjsnew");

        for (int j = 0; j < dt1.Rows.Count; j++)
        {
            string    pnumold = "";
            string    pnumnew = "";
            DataTable dt      = BG_SysSettingManager.GetAllBG_SysSetting();
            if (dt.Rows.Count > 0)
            {
                pnumold      = BG_SysSettingLogic.GetPerByYear(year - 1);
                pnumnew      = BG_SysSettingLogic.GetPerByYear(year);
                hidbn1.Value = pnumnew;
            }
            else
            {
                pnumold      = "0";
                pnumnew      = "0";
                hidbn1.Value = pnumnew;
            }

            dt1.Rows[j]["rsold"] = pnumold;
            dt1.Rows[j]["rsnew"] = pnumnew;
            int Pepold = common.IntSafeConvert(pnumold);
            int Pepnew = common.IntSafeConvert(pnumnew);
            dt1.Rows[j]["rjsold"] = (Convert.ToDouble(dt1.Rows[j]["PDProjectLYData"]) / (Pepold * 1.0f)).ToString("f8").TrimEnd('0').TrimEnd('.');
            dt1.Rows[j]["rjsnew"] = (Convert.ToDouble(dt1.Rows[j]["PDProjectData"]) / (Pepnew * 1.0f)).ToString("f8").TrimEnd('0').TrimEnd('.');
        }
        for (int k = 0; k < dt2.Rows.Count; k++)
        {
            string    pnumold = ""; string pnumnew = "";
            DataTable dt = BG_SysSettingManager.GetAllBG_SysSetting();
            if (dt.Rows.Count > 0)
            {
                pnumold      = BG_SysSettingLogic.GetPerByYear(year - 1);
                pnumnew      = BG_SysSettingLogic.GetPerByYear(year);
                hidbn2.Value = pnumnew;
            }
            else
            {
                pnumold      = "0";
                pnumnew      = "0";
                hidbn2.Value = pnumnew;
            }

            dt2.Rows[k]["rsold"] = pnumold;
            dt2.Rows[k]["rsnew"] = pnumnew;
            int Pepold = common.IntSafeConvert(pnumold);
            int Pepnew = common.IntSafeConvert(pnumnew);
            dt2.Rows[k]["rjsold"] = (Convert.ToDouble(dt2.Rows[k]["PDProjectLYData"]) / (Pepold * 1.0f)).ToString("f8").TrimEnd('0').TrimEnd('.');
            dt2.Rows[k]["rjsnew"] = (Convert.ToDouble(dt2.Rows[k]["PDProjectData"]) / (Pepnew * 1.0f)).ToString("f8").TrimEnd('0').TrimEnd('.');
        }

        for (int i = 0; i < dt3.Rows.Count; i++)
        {
            string    pnumold = ""; string pnumnew = "";
            DataTable dt = BG_SysSettingManager.GetAllBG_SysSetting();
            if (dt.Rows.Count > 0)
            {
                pnumold      = BG_SysSettingLogic.GetPerByYear(year - 1);
                pnumnew      = BG_SysSettingLogic.GetPerByYear(year);
                hidbn3.Value = pnumnew;
            }
            else
            {
                pnumold      = "0";
                pnumnew      = "0";
                hidbn3.Value = pnumnew;
            }

            dt3.Rows[i]["rsold"] = pnumold;
            dt3.Rows[i]["rsnew"] = pnumnew;
            int Pepold = common.IntSafeConvert(pnumold);
            int Pepnew = common.IntSafeConvert(pnumnew);
            dt3.Rows[i]["rjsold"] = (Convert.ToDouble(dt3.Rows[i]["PDProjectLYData"]) / (Pepold * 1.0f)).ToString("f8").TrimEnd('0').TrimEnd('.');
            dt3.Rows[i]["rjsnew"] = (Convert.ToDouble(dt3.Rows[i]["PDProjectData"]) / (Pepnew * 1.0f)).ToString("f8").TrimEnd('0').TrimEnd('.');
        }
        Store2.DataSource = Getquota(dt1, hidbn1.Value == null ? "" : hidbn1.Value.ToString());
        Store2.DataBind();
        Store3.DataSource = Getquota(dt2, hidbn2.Value == null ? "" : hidbn2.Value.ToString());
        Store3.DataBind();
        Store1.DataSource = Getquota(dt3, hidbn3.Value == null ? "" : hidbn3.Value.ToString());
        Store1.DataBind();
    }