Beispiel #1
0
        protected void Button_save_Click(object sender, EventArgs e)
        {
            cw_sbzx.Model.JFYSSBB JFYSSBB_model = new cw_sbzx.Model.JFYSSBB();
            cw_sbzx.BLL.JFYSSBB JFYSSBB_bll = new cw_sbzx.BLL.JFYSSBB();
            JFYSSBB_model.JFZL = DropDownList_jfzl.SelectedText.Trim();
            JFYSSBB_model.USERUID = pb.GetIdentityId();
            JFYSSBB_model.SBBM = ViewState["zrbm"].ToString().Trim();
            if (ViewState["dt"] != null)
            {
                DataTable dt = ViewState["dt"] as DataTable;
                if (dt.Rows.Count == 0)
                {
                    Alert.Show("工作经费预算列表中没有添加数据,请先添加");
                    return;
                }
                for (int i = 0; i < dt.Rows.Count; i++)
                {
                    try
                    {
                        JFYSSBB_model.YJMC = dt.Rows[i]["YJMC"].ToString().Trim();
                        JFYSSBB_model.EJMC = dt.Rows[i]["EJMC"].ToString().Trim();
                        JFYSSBB_model.SJMC = dt.Rows[i]["SJMC"].ToString().Trim();
                        JFYSSBB_model.ZZRYFY = decimal.Parse(dt.Rows[i]["ZZRYFY"].ToString().Trim());
                        JFYSSBB_model.TXRYFY = decimal.Parse(dt.Rows[i]["TXRYFY"].ToString().Trim());
                        JFYSSBB_model.QTRYFY = decimal.Parse(dt.Rows[i]["QTRYFY"].ToString().Trim());
                        JFYSSBB_model.FLF = decimal.Parse(dt.Rows[i]["FLF"].ToString().Trim());
                        JFYSSBB_model.SBHCF = decimal.Parse(dt.Rows[i]["SBHCF"].ToString().Trim());
                        JFYSSBB_model.YWF = decimal.Parse(dt.Rows[i]["YWF"].ToString().Trim());
                        JFYSSBB_model.QT = decimal.Parse(dt.Rows[i]["QT"].ToString().Trim());
                        JFYSSBB_model.YSJE = decimal.Parse(dt.Rows[i]["YSJE"].ToString().Trim());
                        JFYSSBB_model.BZ = dt.Rows[i]["BZ"].ToString().Trim();
                        JFYSSBB_model.SFSC = 0;
                        JFYSSBB_model.CZSJ = DateTime.Now.ToString();
                        JFYSSBB_model.ZT = 0;
                        string year= DateTime.Now.ToString("yyyy");
                        string date1 = year+"-01-01";
                        string date2 = year + "-06-30";
                        DateTime nowdate = Convert.ToDateTime(DateTime.Now.ToString("yy-MM-dd"));
                        if (DateTime.Compare(nowdate, Convert.ToDateTime(date2)) > 0)
                        {
                            JFYSSBB_model.NDXH = year + "02";
                        }
                        else
                        {
                            JFYSSBB_model.NDXH = year + "01";
                        }
                        //DateTime dt1 = Convert.ToDateTime(date1);
                    }
                    catch (Exception ex)
                    {
                        //NumberBox_sqzxjfhj.Text = "0";
                        Alert.Show("错误:" + ex.Message);
                        return;
                    }
                    JFYSSBB_bll.Add(JFYSSBB_model);

                }
                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            }
            else
            {
                Alert.Show("工作经费预算列表中没有添加数据,请先添加");
                return;
            }
        }
Beispiel #2
0
        protected void Button_save_Click(object sender, EventArgs e)
        {
            cw_sbzx.Model.JFYSSBB JFYSSBB_model = new cw_sbzx.Model.JFYSSBB();
            cw_sbzx.BLL.JFYSSBB JFYSSBB_bll = new cw_sbzx.BLL.JFYSSBB();
            JFYSSBB_model.JFZL = DropDownList_jfzl.SelectedText.Trim();
            if (DropDownList_yj.SelectedText.Trim() == "请选择")
            {
                Alert.Show("请选择一级");
                return;
            }
            if (DropDownList_ej.SelectedText.Trim() == "请选择")
            {
                Alert.Show("请选择二级");
                return;
            }
            try
            {
                JFYSSBB_model.USERUID = pb.GetIdentityId();
                JFYSSBB_model.SBBM = TextBox_sbbm.Text.Trim();
                JFYSSBB_model.XMMC = TextBox_xmmc.Text.Trim();
                JFYSSBB_model.XMFZR = TextBox_fzr.Text.Trim();
                JFYSSBB_model.ZXKSRQ = DatePicker_zxksrq.Text.Trim();
                JFYSSBB_model.ZXJSRQ = DatePicker_zxjsrq.Text.Trim();

                JFYSSBB_model.YJMC = DropDownList_yj.SelectedText.Trim();
                JFYSSBB_model.EJMC = DropDownList_ej.SelectedText.Trim();
                //JFYSSBB_model.SJMC = dt.Rows[i]["SJMC"].ToString().Trim();
                JFYSSBB_model.SJMC = TextBox_xmmc.Text.Trim();
                JFYSSBB_model.XMNRGS = TextArea_xmnrms.Text.Trim();
                JFYSSBB_model.ZZRYFY = decimal.Parse(NumberBox_zz.Text.Trim());
                JFYSSBB_model.TXRYFY = decimal.Parse(NumberBox_txry.Text.Trim());
                JFYSSBB_model.QTRYFY = decimal.Parse(NumberBox_qtry.Text.Trim());
                JFYSSBB_model.FLF = decimal.Parse(NumberBox_flf.Text.Trim());
                JFYSSBB_model.SBHCF = decimal.Parse(NumberBox_sbhc.Text.Trim());
                JFYSSBB_model.YWF = decimal.Parse(NumberBox_ywf.Text.Trim());
                JFYSSBB_model.QT = decimal.Parse(NumberBox_qt.Text.Trim());
                JFYSSBB_model.YSJE = decimal.Parse(NumberBox_ysje.Text.Trim());
                //JFYSSBB_model.BZ = TextArea_bz.Text.Trim();
                JFYSSBB_model.SFSC = 0;
                JFYSSBB_model.CZSJ = DateTime.Now.ToString();

                JFYSSBB_model.ZT = 0;

                string year = DateTime.Now.ToString("yyyy");
                string date1 = year + "-01-01";
                string date2 = year + "-06-30";
                DateTime nowdate = Convert.ToDateTime(DateTime.Now.ToString("yy-MM-dd"));
                if (DateTime.Compare(nowdate, Convert.ToDateTime(date2)) > 0)
                {
                    JFYSSBB_model.NDXH = year + "02";
                }
                else
                {
                    JFYSSBB_model.NDXH = year + "01";
                }
            }
            catch (Exception ex)
            {
                //NumberBox_sqzxjfhj.Text = "0";
                Alert.Show("错误:" + ex.Message);
                return;
            }
            JFYSSBB_bll.Add(JFYSSBB_model);

                PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
        }