public List<PD_PROJECT_INSPECTION_Model> DataTableToList(DataTable dt) { List<PD_PROJECT_INSPECTION_Model> list = new List<PD_PROJECT_INSPECTION_Model>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { PD_PROJECT_INSPECTION_Model item = new PD_PROJECT_INSPECTION_Model { AUTO_NO = dt.Rows[i]["AUTO_NO"].ToString(), PD_PROJECT_CODE = dt.Rows[i]["PD_PROJECT_CODE"].ToString(), PD_INSPECTION_PROCESS = dt.Rows[i]["PD_INSPECTION_PROCESS"].ToString() }; if (dt.Rows[i]["PD_INSPECTION_DATE"].ToString() != "") { item.PD_INSPECTION_DATE = new DateTime?(DateTime.Parse(dt.Rows[i]["PD_INSPECTION_DATE"].ToString())); } item.PD_INSPECTION_MANS = dt.Rows[i]["PD_INSPECTION_MANS"].ToString(); item.PD_INSPECTION_ADDR = dt.Rows[i]["PD_INSPECTION_ADDR"].ToString(); item.PD_INSPECTION_CONTENT = dt.Rows[i]["PD_INSPECTION_CONTENT"].ToString(); item.PD_INSPECTION_SUGGEST = dt.Rows[i]["PD_INSPECTION_SUGGEST"].ToString(); item.PD_INSPECTION_CONCLUSION = dt.Rows[i]["PD_INSPECTION_CONCLUSION"].ToString(); item.PD_INSPECTION_FILENAME = dt.Rows[i]["PD_INSPECTION_FILENAME"].ToString(); item.PD_INSPECTION_FILENAME_SYSTEM = dt.Rows[i]["PD_INSPECTION_FILENAME_SYSTEM"].ToString(); item.PD_INSPECTION_PEASANT = dt.Rows[i]["PD_INSPECTION_PEASANT"].ToString(); item.PD_INSPECTION_IDNO = dt.Rows[i]["PD_INSPECTION_IDNO"].ToString(); if (dt.Rows[i]["PD_INSPECTION_FFNUM"].ToString() != "") { item.PD_INSPECTION_FFNUM = new int?(int.Parse(dt.Rows[i]["PD_INSPECTION_FFNUM"].ToString())); } if (dt.Rows[i]["PD_INSPECTION_FFSTAND"].ToString() != "") { item.PD_INSPECTION_FFSTAND = new decimal?(int.Parse(dt.Rows[i]["PD_INSPECTION_FFSTAND"].ToString())); } if (dt.Rows[i]["PD_INSPECTION_FFMONEY"].ToString() != "") { item.PD_INSPECTION_FFMONEY = new decimal?(int.Parse(dt.Rows[i]["PD_INSPECTION_FFMONEY"].ToString())); } item.PD_INSPECTION_ACCOUNTNO = dt.Rows[i]["PD_INSPECTION_ACCOUNTNO"].ToString(); item.PD_INSPECTION_PEASANT_ADDR = dt.Rows[i]["PD_INSPECTION_PEASANT_ADDR"].ToString(); list.Add(item); } } return list; }
public bool Add(PD_PROJECT_INSPECTION_Model model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into PD_PROJECT_INSPECTION("); builder.Append("AUTO_NO,PD_PROJECT_CODE,PD_INSPECTION_PROCESS,PD_INSPECTION_DATE,PD_INSPECTION_MANS,PD_INSPECTION_ADDR,PD_INSPECTION_CONTENT,PD_INSPECTION_SUGGEST,PD_INSPECTION_CONCLUSION,PD_INSPECTION_FILENAME,PD_INSPECTION_FILENAME_SYSTEM,PD_INSPECTION_PEASANT,PD_INSPECTION_IDNO,PD_INSPECTION_FFNUM,PD_INSPECTION_FFSTAND,PD_INSPECTION_FFMONEY,PD_INSPECTION_ACCOUNTNO,PD_INSPECTION_PEASANT_ADDR,PD_MONITOR_PROCEED_WCL,PD_PROJECT_TOTAL_MONEY,PD_MONITOR_TOTAL_MONEY_PAY,PD_MONITOR_TOTAL_MONEY_WCL,PD_BZFFLIST_DATE,PD_INSPECTION_BTFFID,PD_INSPECTION_BTFFNAME,PD_YEAR,PD_NOW_SERVERPK)"); builder.Append(" values ("); builder.Append(":AUTO_NO,:PD_PROJECT_CODE,:PD_INSPECTION_PROCESS,:PD_INSPECTION_DATE,:PD_INSPECTION_MANS,:PD_INSPECTION_ADDR,:PD_INSPECTION_CONTENT,:PD_INSPECTION_SUGGEST,:PD_INSPECTION_CONCLUSION,:PD_INSPECTION_FILENAME,:PD_INSPECTION_FILENAME_SYSTEM,:PD_INSPECTION_PEASANT,:PD_INSPECTION_IDNO,:PD_INSPECTION_FFNUM,:PD_INSPECTION_FFSTAND,:PD_INSPECTION_FFMONEY,:PD_INSPECTION_ACCOUNTNO,:PD_INSPECTION_PEASANT_ADDR,:PD_MONITOR_PROCEED_WCL,:PD_PROJECT_TOTAL_MONEY,:PD_MONITOR_TOTAL_MONEY_PAY,:PD_MONITOR_TOTAL_MONEY_WCL,:PD_BZFFLIST_DATE,:PD_INSPECTION_BTFFID,:PD_INSPECTION_BTFFNAME,:PD_YEAR,:PD_NOW_SERVERPK)"); builder.Append(" RETURNING AUTO_NO INTO :R_Auto_No "); OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":AUTO_NO", OracleType.Number, 4), new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 0x24), new OracleParameter(":PD_INSPECTION_PROCESS", OracleType.VarChar, 30), new OracleParameter(":PD_INSPECTION_DATE", OracleType.DateTime), new OracleParameter(":PD_INSPECTION_MANS", OracleType.VarChar, 100), new OracleParameter(":PD_INSPECTION_ADDR", OracleType.VarChar, 100), new OracleParameter(":PD_INSPECTION_CONTENT", OracleType.VarChar, 0x3e8), new OracleParameter(":PD_INSPECTION_SUGGEST", OracleType.VarChar, 0x3e8), new OracleParameter(":PD_INSPECTION_CONCLUSION", OracleType.VarChar, 0x3e8), new OracleParameter(":PD_INSPECTION_FILENAME", OracleType.VarChar, 50), new OracleParameter(":PD_INSPECTION_FILENAME_SYSTEM", OracleType.VarChar, 50), new OracleParameter(":PD_INSPECTION_PEASANT", OracleType.VarChar, 50), new OracleParameter(":PD_INSPECTION_IDNO", OracleType.VarChar, 50), new OracleParameter(":PD_INSPECTION_FFNUM", OracleType.Number, 4), new OracleParameter(":PD_INSPECTION_FFSTAND", OracleType.Number, 4), new OracleParameter(":PD_INSPECTION_FFMONEY", OracleType.Number, 4), new OracleParameter(":PD_INSPECTION_ACCOUNTNO", OracleType.VarChar, 100), new OracleParameter(":PD_INSPECTION_PEASANT_ADDR", OracleType.VarChar, 100), new OracleParameter(":PD_MONITOR_PROCEED_WCL", OracleType.Number, 4), new OracleParameter(":PD_PROJECT_TOTAL_MONEY", OracleType.Number, 4), new OracleParameter(":PD_MONITOR_TOTAL_MONEY_PAY", OracleType.Number, 4), new OracleParameter(":PD_MONITOR_TOTAL_MONEY_WCL", OracleType.Number, 4), new OracleParameter(":PD_INSPECTION_BTFFID", OracleType.Number, 20), new OracleParameter(":PD_INSPECTION_BTFFNAME", OracleType.VarChar, 100), new OracleParameter(":PD_BZFFLIST_DATE", OracleType.DateTime), new OracleParameter(":PD_YEAR", OracleType.VarChar, 4), new OracleParameter(":PD_NOW_SERVERPK", OracleType.VarChar, 100), new OracleParameter(":R_Auto_No", OracleType.Number, 20) }; cmdParms[0].Value = model.AUTO_NO; cmdParms[1].Value = model.PD_PROJECT_CODE; cmdParms[2].Value = model.PD_INSPECTION_PROCESS; cmdParms[3].Value = model.PD_INSPECTION_DATE; cmdParms[4].Value = model.PD_INSPECTION_MANS; cmdParms[5].Value = model.PD_INSPECTION_ADDR; cmdParms[6].Value = model.PD_INSPECTION_CONTENT; cmdParms[7].Value = model.PD_INSPECTION_SUGGEST; cmdParms[8].Value = model.PD_INSPECTION_CONCLUSION; cmdParms[9].Value = model.PD_INSPECTION_FILENAME; cmdParms[10].Value = model.PD_INSPECTION_FILENAME_SYSTEM; cmdParms[11].Value = model.PD_INSPECTION_PEASANT; cmdParms[12].Value = model.PD_INSPECTION_IDNO; cmdParms[13].Value = model.PD_INSPECTION_FFNUM; cmdParms[14].Value = model.PD_INSPECTION_FFSTAND; cmdParms[15].Value = model.PD_INSPECTION_FFMONEY; cmdParms[0x10].Value = model.PD_INSPECTION_ACCOUNTNO; cmdParms[0x11].Value = model.PD_INSPECTION_PEASANT_ADDR; cmdParms[0x12].Value = model.PD_MONITOR_PROCEED_WCL; cmdParms[0x13].Value = model.PD_PROJECT_TOTAL_MONEY; cmdParms[20].Value = model.PD_MONITOR_TOTAL_MONEY_PAY; cmdParms[0x15].Value = model.PD_MONITOR_TOTAL_MONEY_WCL; cmdParms[0x16].Value = model.PD_INSPECTION_BTFFID; cmdParms[0x17].Value = model.PD_INSPECTION_BTFFNAME; cmdParms[0x18].Value = model.PD_BZFFLIST_DATE; cmdParms[0x19].Value = model.PD_YEAR; cmdParms[0x1a].Value = model.PD_NOW_SERVERPK; cmdParms[0x1b].Direction = ParameterDirection.Output; int num = DbHelperOra.ExecuteSql(builder.ToString(), cmdParms); model.AUTO_NO = cmdParms[0x1b].Value.ToString(); return (num > 0); }
private void Save() { PD_PROJECT_INSPECTION_Bll bll = new PD_PROJECT_INSPECTION_Bll(); if (base.Request["CCXCDoType"] != null) { if (base.Request["CCXCDoType"] == "update") { if (PublicDal.PageValidate.IsDecimal(this.txtPD_PROJECT_CODE.Value)) { PD_PROJECT_INSPECTION_Model model = bll.GetModel(int.Parse(this.lblAUTO_NO.Text)); this.getModel(model); if (bll.Update(model)) { this.AddImgMethod(model); Const.DoSuccessNoClose("修改成功", this.Page.Request.Url.LocalPath + "?CCXCDoType=look&UpdatePK=" + base.Request["UpdatePK"].ToString(), this.Page); } else { Const.DoSuccessNoClose("修改失败", this.Page.Request.Url.LocalPath + "?CCXCDoType=look&UpdatePK=" + base.Request["UpdatePK"].ToString(), this.Page); } } } else if (base.Request["CCXCDoType"] == "add") { if (base.Request["UpdatePK"] != null) { PD_PROJECT_INSPECTION_Model model2 = new PD_PROJECT_INSPECTION_Model { PD_DB_LOOP = "1", PD_NOW_SERVERPK = PublicDal.SetCreateServiceStream(this.Page) }; this.getModel(model2); this.txt_file.Text.ToString(); if (bll.Add(model2)) { this.AddImgMethod(model2); Const.DoSuccessNoClose("添加成功", this.Page.Request.Url.LocalPath + "?CCXCDoType=look&UpdatePK=" + model2.PD_PROJECT_CODE + "&strTitle=" + base.Request["strTitle"].ToString(), this.Page); } else { Const.DoSuccessNoClose("添加失败", this.Page.Request.Url.LocalPath + "?CCXCDoType=look&UpdatePK=" + base.Request["UpdatePK"].ToString(), this.Page); } } else { PageShowText.Refurbish("主项目信息不明确", this.Page); } } } }
private void GetQUOTA(PD_PROJECT_INSPECTION_Model model) { DataSet set = null; DataView defaultView = null; string s = base.Server.UrlDecode(this.FilePostCtr1.getFileName); if ((s != null) && (s.Trim() != "")) { set = new DataSet(); XmlTextReader reader = new XmlTextReader(new StringReader(s)); set.ReadXml(reader); } if ((set != null) && (set.Tables.Count > 0)) { defaultView = set.Tables[0].DefaultView; } if (defaultView != null) { defaultView.RowFilter = " tableID='zxzb_bt' "; if (defaultView.Count > 0) { model.PD_INSPECTION_FILENAME = defaultView[0]["FileName"].ToString(); model.PD_INSPECTION_FILENAME_SYSTEM = defaultView[0]["FileSysName"].ToString(); } } }
private void getModel(PD_PROJECT_INSPECTION_Model model) { model.PD_PROJECT_CODE = base.Request["UpdatePK"].ToString(); model.PD_INSPECTION_PROCESS = this.txtPD_INSPECTION_PROCESS.SelectedValue; model.PD_INSPECTION_MANS = this.txtPD_INSPECTION_MANS.Text; model.PD_INSPECTION_ADDR = this.txtPD_INSPECTION_ADDR.Text; model.PD_INSPECTION_CONTENT = this.txtPD_INSPECTION_CONTENT.Text; model.PD_INSPECTION_SUGGEST = this.txtPD_INSPECTION_SUGGEST.Text; model.PD_INSPECTION_CONCLUSION = this.txtPD_INSPECTION_CONCLUSION.Text; model.PD_YEAR = this.ddlPD_YEAR.SelectedValue; if (PublicDal.PageValidate.IsDateTime(this.txtPD_INSPECTION_DATE.Value)) { model.PD_INSPECTION_DATE = new DateTime?(DateTime.Parse(this.txtPD_INSPECTION_DATE.Value)); } else { model.PD_INSPECTION_DATE = new DateTime(); } model.PD_INSPECTION_PEASANT = this.txtPD_INSPECTION_PEASANT.Text; model.PD_INSPECTION_IDNO = this.txtPD_INSPECTION_IDNO.Text; if (PublicDal.PageValidate.IsInt(this.txtPD_INSPECTION_FFNUM.Text)) { model.PD_INSPECTION_FFNUM = new int?(int.Parse(this.txtPD_INSPECTION_FFNUM.Text)); } if (PublicDal.PageValidate.IsDecimal(this.txtPD_INSPECTION_FFSTAND.Text)) { model.PD_INSPECTION_FFSTAND = new decimal?(decimal.Parse(this.txtPD_INSPECTION_FFSTAND.Text)); } if (PublicDal.PageValidate.IsDecimal(this.txtPD_INSPECTION_FFMONEY.Text)) { model.PD_INSPECTION_FFMONEY = new decimal?(decimal.Parse(this.txtPD_INSPECTION_FFMONEY.Text)); } model.PD_INSPECTION_ACCOUNTNO = this.txtPD_INSPECTION_ACCOUNTNO.Text; model.PD_INSPECTION_PEASANT_ADDR = this.txtPD_INSPECTION_PEASANT_ADDR.Text; if (PublicDal.PageValidate.IsDecimal(this.txtPD_MONITOR_TOTAL_MONEY_PAY.Text)) { model.PD_MONITOR_TOTAL_MONEY_PAY = new decimal?(decimal.Parse(this.txtPD_MONITOR_TOTAL_MONEY_PAY.Text)); } this.GetQUOTA(model); }
private void AddImgMethod(PD_PROJECT_INSPECTION_Model model) { try { string str = this.txt_file.Text.ToString(); if (!string.IsNullOrEmpty(str)) { string str2 = ""; string str3 = ""; if (!string.IsNullOrEmpty(str)) { str2 = str.Substring(str.LastIndexOf("||")).Replace("||", ""); str3 = str2; str2 = str2.Substring(0, str2.LastIndexOf(".")); } str = "UserImages/" + str3; DbHelperOra.ExecuteSql("insert into t_photos (fkid, photoname, photopath, remarks, sortid) values ( 'bzCCXCMX_" + model.AUTO_NO + "', '" + str3 + "', '" + str + "', '" + str3 + "', 1)"); } } catch (Exception) { } }
private void getModel(PD_PROJECT_INSPECTION_Model model) { if (base.Request["UpdatePK"] != null) { model.PD_PROJECT_CODE = base.Request["UpdatePK"].ToString(); model.PD_INSPECTION_PROCESS = this.txtPD_INSPECTION_PROCESS.SelectedValue; model.PD_INSPECTION_MANS = this.txtPD_INSPECTION_MANS.Text; model.PD_INSPECTION_ADDR = this.txtPD_INSPECTION_ADDR.Text; model.PD_INSPECTION_CONTENT = this.txtPD_INSPECTION_CONTENT.Text; model.PD_INSPECTION_SUGGEST = this.txtPD_INSPECTION_SUGGEST.Text; model.PD_INSPECTION_CONCLUSION = this.txtPD_INSPECTION_CONCLUSION.Text; model.PD_YEAR = this.ddlPD_YEAR.SelectedValue; if (PublicDal.PageValidate.IsDateTime(this.txtPD_INSPECTION_DATE.Value)) { model.PD_INSPECTION_DATE = new DateTime?(DateTime.Parse(this.txtPD_INSPECTION_DATE.Value)); } else { model.PD_INSPECTION_DATE = new DateTime(); } if (PublicDal.PageValidate.IsDecimal(this.txtPD_MONITOR_PROCEED_WCL.Value)) { model.PD_MONITOR_PROCEED_WCL = new decimal?(decimal.Parse(this.txtPD_MONITOR_PROCEED_WCL.Value)); } if (PublicDal.PageValidate.IsDecimal(this.txtPD_PROJECT_TOTAL_MONEY.Value)) { model.PD_PROJECT_TOTAL_MONEY = new decimal?(decimal.Parse(this.txtPD_PROJECT_TOTAL_MONEY.Value)); } if (PublicDal.PageValidate.IsDecimal(this.txtPD_MONITOR_TOTAL_MONEY_PAY.Value)) { model.PD_MONITOR_TOTAL_MONEY_PAY = new decimal?(decimal.Parse(this.txtPD_MONITOR_TOTAL_MONEY_PAY.Value)); } if (PublicDal.PageValidate.IsDecimal(this.txtPD_MONITOR_TOTAL_MONEY_WCL.Value)) { model.PD_MONITOR_TOTAL_MONEY_WCL = new decimal?(decimal.Parse(this.txtPD_MONITOR_TOTAL_MONEY_WCL.Value)); } this.GetQUOTA(model); } }
public bool Add(PD_PROJECT_INSPECTION_Model model) { return this.dal.Add(model); }
public bool Update(PD_PROJECT_INSPECTION_Model model) { return this.dal.Update(model); }
public bool Update(PD_PROJECT_INSPECTION_Model model) { StringBuilder builder = new StringBuilder(); builder.Append("update PD_PROJECT_INSPECTION set "); builder.Append("PD_PROJECT_CODE=:PD_PROJECT_CODE,"); builder.Append("PD_INSPECTION_PROCESS=:PD_INSPECTION_PROCESS,"); builder.Append("PD_INSPECTION_DATE=:PD_INSPECTION_DATE,"); builder.Append("PD_INSPECTION_MANS=:PD_INSPECTION_MANS,"); builder.Append("PD_INSPECTION_ADDR=:PD_INSPECTION_ADDR,"); builder.Append("PD_INSPECTION_CONTENT=:PD_INSPECTION_CONTENT,"); builder.Append("PD_INSPECTION_SUGGEST=:PD_INSPECTION_SUGGEST,"); builder.Append("PD_INSPECTION_CONCLUSION=:PD_INSPECTION_CONCLUSION,"); builder.Append("PD_INSPECTION_FILENAME=:PD_INSPECTION_FILENAME,"); builder.Append("PD_INSPECTION_FILENAME_SYSTEM=:PD_INSPECTION_FILENAME_SYSTEM,"); builder.Append("PD_INSPECTION_PEASANT=:PD_INSPECTION_PEASANT,"); builder.Append("PD_INSPECTION_IDNO=:PD_INSPECTION_IDNO,"); builder.Append("PD_INSPECTION_FFNUM=:PD_INSPECTION_FFNUM,"); builder.Append("PD_INSPECTION_FFSTAND=:PD_INSPECTION_FFSTAND,"); builder.Append("PD_INSPECTION_FFMONEY=:PD_INSPECTION_FFMONEY,"); builder.Append("PD_INSPECTION_ACCOUNTNO=:PD_INSPECTION_ACCOUNTNO,"); builder.Append("PD_INSPECTION_PEASANT_ADDR=:PD_INSPECTION_PEASANT_ADDR,"); builder.Append("PD_MONITOR_PROCEED_WCL=:PD_MONITOR_PROCEED_WCL,"); builder.Append("PD_PROJECT_TOTAL_MONEY=:PD_PROJECT_TOTAL_MONEY,"); builder.Append("PD_MONITOR_TOTAL_MONEY_PAY=:PD_MONITOR_TOTAL_MONEY_PAY,"); builder.Append("PD_MONITOR_TOTAL_MONEY_WCL=:PD_MONITOR_TOTAL_MONEY_WCL,"); builder.Append("PD_INSPECTION_BTFFID=:PD_INSPECTION_BTFFID,"); builder.Append("PD_INSPECTION_BTFFNAME=:PD_INSPECTION_BTFFNAME,"); builder.Append("PD_BZFFLIST_DATE=:PD_BZFFLIST_DATE,"); builder.Append("PD_YEAR=:PD_YEAR"); builder.Append(" where AUTO_NO=:AUTO_NO "); OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 0x24), new OracleParameter(":PD_INSPECTION_PROCESS", OracleType.VarChar, 30), new OracleParameter(":PD_INSPECTION_DATE", OracleType.DateTime), new OracleParameter(":PD_INSPECTION_MANS", OracleType.VarChar, 100), new OracleParameter(":PD_INSPECTION_ADDR", OracleType.VarChar, 100), new OracleParameter(":PD_INSPECTION_CONTENT", OracleType.VarChar, 0x3e8), new OracleParameter(":PD_INSPECTION_SUGGEST", OracleType.VarChar, 0x3e8), new OracleParameter(":PD_INSPECTION_CONCLUSION", OracleType.VarChar, 0x3e8), new OracleParameter(":PD_INSPECTION_FILENAME", OracleType.VarChar, 50), new OracleParameter(":PD_INSPECTION_FILENAME_SYSTEM", OracleType.VarChar, 50), new OracleParameter(":PD_INSPECTION_PEASANT", OracleType.VarChar, 50), new OracleParameter(":PD_INSPECTION_IDNO", OracleType.VarChar, 50), new OracleParameter(":PD_INSPECTION_FFNUM", OracleType.Number, 4), new OracleParameter(":PD_INSPECTION_FFSTAND", OracleType.Number, 4), new OracleParameter(":PD_INSPECTION_FFMONEY", OracleType.Number, 4), new OracleParameter(":PD_INSPECTION_ACCOUNTNO", OracleType.VarChar, 100), new OracleParameter(":PD_INSPECTION_PEASANT_ADDR", OracleType.VarChar, 100), new OracleParameter(":PD_MONITOR_PROCEED_WCL", OracleType.Number, 4), new OracleParameter(":PD_PROJECT_TOTAL_MONEY", OracleType.Number, 4), new OracleParameter(":PD_MONITOR_TOTAL_MONEY_PAY", OracleType.Number, 4), new OracleParameter(":PD_MONITOR_TOTAL_MONEY_WCL", OracleType.Number, 4), new OracleParameter(":PD_INSPECTION_BTFFID", OracleType.Number, 20), new OracleParameter(":PD_INSPECTION_BTFFNAME", OracleType.VarChar, 100), new OracleParameter(":PD_BZFFLIST_DATE", OracleType.DateTime), new OracleParameter(":PD_YEAR", OracleType.VarChar, 4), new OracleParameter(":AUTO_NO", OracleType.Number, 20) }; cmdParms[0].Value = model.PD_PROJECT_CODE; cmdParms[1].Value = model.PD_INSPECTION_PROCESS; cmdParms[2].Value = model.PD_INSPECTION_DATE; cmdParms[3].Value = model.PD_INSPECTION_MANS; cmdParms[4].Value = model.PD_INSPECTION_ADDR; cmdParms[5].Value = model.PD_INSPECTION_CONTENT; cmdParms[6].Value = model.PD_INSPECTION_SUGGEST; cmdParms[7].Value = model.PD_INSPECTION_CONCLUSION; cmdParms[8].Value = model.PD_INSPECTION_FILENAME; cmdParms[9].Value = model.PD_INSPECTION_FILENAME_SYSTEM; cmdParms[10].Value = model.PD_INSPECTION_PEASANT; cmdParms[11].Value = model.PD_INSPECTION_IDNO; cmdParms[12].Value = model.PD_INSPECTION_FFNUM; cmdParms[13].Value = model.PD_INSPECTION_FFSTAND; cmdParms[14].Value = model.PD_INSPECTION_FFMONEY; cmdParms[15].Value = model.PD_INSPECTION_ACCOUNTNO; cmdParms[0x10].Value = model.PD_INSPECTION_PEASANT_ADDR; cmdParms[0x11].Value = model.PD_MONITOR_PROCEED_WCL; cmdParms[0x12].Value = model.PD_PROJECT_TOTAL_MONEY; cmdParms[0x13].Value = model.PD_MONITOR_TOTAL_MONEY_PAY; cmdParms[20].Value = model.PD_MONITOR_TOTAL_MONEY_WCL; cmdParms[0x15].Value = model.PD_INSPECTION_BTFFID; cmdParms[0x16].Value = model.PD_INSPECTION_BTFFNAME; cmdParms[0x17].Value = model.PD_BZFFLIST_DATE; cmdParms[0x18].Value = model.PD_YEAR; cmdParms[0x19].Value = model.AUTO_NO; return (DbHelperOra.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public PD_PROJECT_INSPECTION_Model GetModel(int AUTO_NO) { StringBuilder builder = new StringBuilder(); builder.Append("select AUTO_NO,PD_PROJECT_CODE,PD_INSPECTION_PROCESS,PD_INSPECTION_DATE,PD_INSPECTION_MANS,PD_INSPECTION_ADDR,PD_INSPECTION_CONTENT,PD_INSPECTION_SUGGEST,PD_INSPECTION_CONCLUSION,PD_INSPECTION_FILENAME,PD_INSPECTION_FILENAME_SYSTEM,PD_INSPECTION_PEASANT,PD_INSPECTION_IDNO,PD_INSPECTION_FFNUM,PD_INSPECTION_FFSTAND,PD_INSPECTION_FFMONEY,PD_INSPECTION_ACCOUNTNO,PD_INSPECTION_PEASANT_ADDR,PD_MONITOR_PROCEED_WCL,PD_PROJECT_TOTAL_MONEY,PD_MONITOR_TOTAL_MONEY_PAY,PD_MONITOR_TOTAL_MONEY_WCL,PD_DB_LOOP,PD_BZFFLIST_DATE,PD_INSPECTION_BTFFID,PD_INSPECTION_BTFFNAME,PD_YEAR from PD_PROJECT_INSPECTION "); builder.Append(" where AUTO_NO=:AUTO_NO "); OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":AUTO_NO", OracleType.Number, 20) }; cmdParms[0].Value = AUTO_NO; PD_PROJECT_INSPECTION_Model model = new PD_PROJECT_INSPECTION_Model(); DataSet set = DbHelperOra.Query(builder.ToString(), cmdParms); if (set.Tables[0].Rows.Count <= 0) { return null; } model.AUTO_NO = set.Tables[0].Rows[0]["AUTO_NO"].ToString(); model.PD_PROJECT_CODE = set.Tables[0].Rows[0]["PD_PROJECT_CODE"].ToString(); model.PD_INSPECTION_PROCESS = set.Tables[0].Rows[0]["PD_INSPECTION_PROCESS"].ToString(); if (set.Tables[0].Rows[0]["PD_INSPECTION_DATE"].ToString() != "") { model.PD_INSPECTION_DATE = new DateTime?(DateTime.Parse(set.Tables[0].Rows[0]["PD_INSPECTION_DATE"].ToString())); } model.PD_INSPECTION_MANS = set.Tables[0].Rows[0]["PD_INSPECTION_MANS"].ToString(); model.PD_INSPECTION_ADDR = set.Tables[0].Rows[0]["PD_INSPECTION_ADDR"].ToString(); model.PD_INSPECTION_CONTENT = set.Tables[0].Rows[0]["PD_INSPECTION_CONTENT"].ToString(); model.PD_INSPECTION_SUGGEST = set.Tables[0].Rows[0]["PD_INSPECTION_SUGGEST"].ToString(); model.PD_INSPECTION_CONCLUSION = set.Tables[0].Rows[0]["PD_INSPECTION_CONCLUSION"].ToString(); model.PD_INSPECTION_FILENAME = set.Tables[0].Rows[0]["PD_INSPECTION_FILENAME"].ToString(); model.PD_INSPECTION_FILENAME_SYSTEM = set.Tables[0].Rows[0]["PD_INSPECTION_FILENAME_SYSTEM"].ToString(); model.PD_INSPECTION_PEASANT = set.Tables[0].Rows[0]["PD_INSPECTION_PEASANT"].ToString(); model.PD_INSPECTION_IDNO = set.Tables[0].Rows[0]["PD_INSPECTION_IDNO"].ToString(); if (set.Tables[0].Rows[0]["PD_INSPECTION_FFNUM"].ToString() != "") { model.PD_INSPECTION_FFNUM = new int?(int.Parse(set.Tables[0].Rows[0]["PD_INSPECTION_FFNUM"].ToString())); } if (set.Tables[0].Rows[0]["PD_INSPECTION_FFSTAND"].ToString() != "") { model.PD_INSPECTION_FFSTAND = new decimal?(decimal.Parse(set.Tables[0].Rows[0]["PD_INSPECTION_FFSTAND"].ToString())); } if (set.Tables[0].Rows[0]["PD_INSPECTION_FFMONEY"].ToString() != "") { model.PD_INSPECTION_FFMONEY = new decimal?(decimal.Parse(set.Tables[0].Rows[0]["PD_INSPECTION_FFMONEY"].ToString())); } model.PD_INSPECTION_ACCOUNTNO = set.Tables[0].Rows[0]["PD_INSPECTION_ACCOUNTNO"].ToString(); model.PD_INSPECTION_PEASANT_ADDR = set.Tables[0].Rows[0]["PD_INSPECTION_PEASANT_ADDR"].ToString(); if (set.Tables[0].Rows[0]["PD_MONITOR_PROCEED_WCL"].ToString() != "") { model.PD_MONITOR_PROCEED_WCL = new decimal?(decimal.Parse(set.Tables[0].Rows[0]["PD_MONITOR_PROCEED_WCL"].ToString())); } if (set.Tables[0].Rows[0]["PD_PROJECT_TOTAL_MONEY"].ToString() != "") { model.PD_PROJECT_TOTAL_MONEY = new decimal?(decimal.Parse(set.Tables[0].Rows[0]["PD_PROJECT_TOTAL_MONEY"].ToString())); } if (set.Tables[0].Rows[0]["PD_MONITOR_TOTAL_MONEY_PAY"].ToString() != "") { model.PD_MONITOR_TOTAL_MONEY_PAY = new decimal?(decimal.Parse(set.Tables[0].Rows[0]["PD_MONITOR_TOTAL_MONEY_PAY"].ToString())); } if (set.Tables[0].Rows[0]["PD_MONITOR_TOTAL_MONEY_WCL"].ToString() != "") { model.PD_MONITOR_TOTAL_MONEY_WCL = new decimal?(decimal.Parse(set.Tables[0].Rows[0]["PD_MONITOR_TOTAL_MONEY_WCL"].ToString())); } model.PD_DB_LOOP = set.Tables[0].Rows[0]["PD_DB_LOOP"].ToString(); if (set.Tables[0].Rows[0]["PD_BZFFLIST_DATE"].ToString() != "") { model.PD_BZFFLIST_DATE = new DateTime?(DateTime.Parse(set.Tables[0].Rows[0]["PD_BZFFLIST_DATE"].ToString())); } model.PD_INSPECTION_BTFFID = set.Tables[0].Rows[0]["PD_INSPECTION_BTFFID"].ToString(); model.PD_INSPECTION_BTFFNAME = set.Tables[0].Rows[0]["PD_INSPECTION_BTFFNAME"].ToString(); model.PD_YEAR = set.Tables[0].Rows[0]["PD_YEAR"].ToString(); return model; }
private List<PD_PROJECT_INSPECTION_Model> GetInspectionModel(string PD_PROJECT_CODE) { List<PD_PROJECT_INSPECTION_Model> list = new List<PD_PROJECT_INSPECTION_Model>(); if (base.Request.Form["BzGGXX_PD_PROJECT_CODE"] != null) { string[] strArray = base.Request.Form["BzGGXX_PD_PROJECT_CODE"].Split(new char[] { ',' }); string[] strArray2 = base.Request.Form["BzGGXX_PD_INSPECTION_PROCESS"].Split(new char[] { ',' }); string[] strArray3 = base.Request.Form["BzGGXX_PD_INSPECTION_DATE"].Split(new char[] { ',' }); string[] strArray4 = base.Request.Form["BzGGXX_PD_INSPECTION_MANS"].Split(new char[] { ',' }); string[] strArray5 = base.Request.Form["BzGGXX_PD_INSPECTION_ADDR"].Split(new char[] { ',' }); string[] strArray6 = base.Request.Form["BzGGXX_PD_INSPECTION_CONTENT"].Split(new char[] { ',' }); string[] strArray7 = base.Request.Form["BzGGXX_PD_INSPECTION_SUGGEST"].Split(new char[] { ',' }); string[] strArray8 = base.Request.Form["BzGGXX_PD_INSPECTION_CONCLUSION"].Split(new char[] { ',' }); string[] strArray9 = base.Request.Form["BzGGXX_PD_INSPECTION_FILENAME"].Split(new char[] { ',' }); string[] strArray10 = base.Request.Form["BzGGXX_PD_INSPECTION_PEASANT"].Split(new char[] { ',' }); string[] strArray11 = base.Request.Form["BzGGXX_PD_INSPECTION_IDNO"].Split(new char[] { ',' }); string[] strArray12 = base.Request.Form["BzGGXX_PD_INSPECTION_FFNUM"].Split(new char[] { ',' }); string[] strArray13 = base.Request.Form["BzGGXX_PD_INSPECTION_FFSTAND"].Split(new char[] { ',' }); string[] strArray14 = base.Request.Form["BzGGXX_PD_INSPECTION_FFMONEY"].Split(new char[] { ',' }); string[] strArray15 = base.Request.Form["BzGGXX_PD_INSPECTION_ACCOUNTNO"].Split(new char[] { ',' }); string[] strArray16 = base.Request.Form["BzGGXX_PD_INSPECTION_PEASANT_ADDR"].Split(new char[] { ',' }); string[] strArray17 = base.Request.Form["Hidden_PD_INSPECTION_BTFFID"].Split(new char[] { ',' }); string[] strArray18 = base.Request.Form["BzGGXX_PD_INSPECTION_BTFFNAME"].Split(new char[] { ',' }); for (int i = 0; i < strArray.Length; i++) { PD_PROJECT_INSPECTION_Model item = new PD_PROJECT_INSPECTION_Model { PD_PROJECT_CODE = PD_PROJECT_CODE, PD_INSPECTION_PROCESS = strArray2[i] }; if (PublicDal.PageValidate.IsDateTime(strArray3[i])) { item.PD_INSPECTION_DATE = new DateTime?(DateTime.Parse(strArray3[i])); } item.PD_INSPECTION_MANS = strArray4[i]; item.PD_INSPECTION_ADDR = strArray5[i]; item.PD_INSPECTION_CONTENT = strArray6[i]; item.PD_INSPECTION_SUGGEST = strArray7[i]; item.PD_INSPECTION_CONCLUSION = strArray8[i]; item.PD_INSPECTION_FILENAME = strArray9[i]; item.PD_INSPECTION_PEASANT = strArray10[i]; item.PD_INSPECTION_IDNO = strArray11[i]; if (PublicDal.PageValidate.IsNumber(strArray12[i])) { item.PD_INSPECTION_FFNUM = new int?(int.Parse(strArray12[i])); } if (PublicDal.PageValidate.IsNumber(strArray12[i])) { item.PD_INSPECTION_FFSTAND = new decimal?(int.Parse(strArray13[i])); } if (PublicDal.PageValidate.IsNumber(strArray12[i])) { item.PD_INSPECTION_FFMONEY = new decimal?(int.Parse(strArray14[i])); } item.PD_INSPECTION_ACCOUNTNO = strArray15[i]; item.PD_INSPECTION_PEASANT_ADDR = strArray16[i]; item.PD_INSPECTION_BTFFID = strArray17[i]; item.PD_INSPECTION_BTFFNAME = strArray18[i]; list.Add(item); } } return list; }
private List<PD_PROJECT_INSPECTION_Model> GetInspectionModel(string PD_PROJECT_CODE, ref string strErr) { List<PD_PROJECT_INSPECTION_Model> list = new List<PD_PROJECT_INSPECTION_Model>(); if (base.Request.Form["xmccxc_PD_PROJECT_CODE"] != null) { string[] strArray = base.Request.Form["xmccxc_PD_PROJECT_CODE"].Split(new char[] { ',' }); string[] strArray2 = base.Request.Form["xmccxc_PD_INSPECTION_PROCESS"].Split(new char[] { ',' }); string[] strArray3 = base.Request.Form["xmccxc_PD_INSPECTION_DATE"].Split(new char[] { ',' }); string[] strArray4 = base.Request.Form["xmccxc_PD_INSPECTION_MANS"].Split(new char[] { ',' }); string[] strArray5 = base.Request.Form["xmccxc_PD_INSPECTION_ADDR"].Split(new char[] { ',' }); string[] strArray6 = base.Request.Form["xmccxc_PD_INSPECTION_CONTENT"].Split(new char[] { ',' }); string[] strArray7 = base.Request.Form["xmccxc_PD_INSPECTION_SUGGEST"].Split(new char[] { ',' }); string[] strArray8 = base.Request.Form["xmccxc_PD_INSPECTION_CONCLUSION"].Split(new char[] { ',' }); string[] strArray9 = base.Request.Form["xmccxc_PD_MONITOR_PROCEED_WCL"].Split(new char[] { ',' }); string[] strArray10 = base.Request.Form["xmccxc_PD_PROJECT_TOTAL_MONEY"].Split(new char[] { ',' }); string[] strArray11 = base.Request.Form["xmccxc_PD_MONITOR_TOTAL_MONEY_PAY"].Split(new char[] { ',' }); string[] strArray12 = base.Request.Form["xmccxc_PD_MONITOR_TOTAL_MONEY_WCL"].Split(new char[] { ',' }); DataSet set = null; DataView defaultView = null; string s = base.Server.UrlDecode(this.FilePostCtr1.getFileName); if ((s != null) && (s.Trim() != "")) { set = new DataSet(); XmlTextReader reader = new XmlTextReader(new StringReader(s)); set.ReadXml(reader); } if ((set != null) && (set.Tables.Count > 0)) { defaultView = set.Tables[0].DefaultView; } for (int i = 0; i < strArray.Length; i++) { PD_PROJECT_INSPECTION_Model item = new PD_PROJECT_INSPECTION_Model { PD_PROJECT_CODE = PD_PROJECT_CODE, AUTO_NO = i.ToString(), PD_INSPECTION_PROCESS = strArray2[i] }; if (PublicDal.PageValidate.IsDateTime(strArray3[i])) { item.PD_INSPECTION_DATE = new DateTime?(DateTime.Parse(strArray3[i])); } item.PD_INSPECTION_MANS = strArray4[i]; item.PD_INSPECTION_ADDR = strArray5[i]; item.PD_INSPECTION_CONTENT = strArray6[i]; item.PD_INSPECTION_SUGGEST = strArray7[i]; item.PD_INSPECTION_CONCLUSION = strArray8[i]; if (PublicDal.PageValidate.IsDecimal(strArray9[i])) { item.PD_MONITOR_PROCEED_WCL = new decimal?(decimal.Parse(strArray9[i])); } if (PublicDal.PageValidate.IsDecimal(strArray10[i])) { item.PD_PROJECT_TOTAL_MONEY = new decimal?(decimal.Parse(strArray10[i])); } if (PublicDal.PageValidate.IsDecimal(strArray11[i])) { item.PD_MONITOR_TOTAL_MONEY_PAY = new decimal?(decimal.Parse(strArray11[i])); } if (PublicDal.PageValidate.IsDecimal(strArray12[i])) { item.PD_MONITOR_TOTAL_MONEY_WCL = new decimal?(decimal.Parse(strArray12[i])); } if (defaultView != null) { defaultView.RowFilter = " tableID='table_xmccxc' and rowIndex=" + (i + 1); if (defaultView.Count > 0) { item.PD_INSPECTION_FILENAME = defaultView[0]["FileName"].ToString(); item.PD_INSPECTION_FILENAME_SYSTEM = defaultView[0]["FileSysName"].ToString(); } } list.Add(item); } } return list; }