public void Add(PD_PROJECT_ATTACH_SS_Model model) { StringBuilder builder = new StringBuilder(); builder.Append("insert into PD_PROJECT_ATTACH_SS("); builder.Append("AUTO_NO,PD_PROJECT_CODE,PD_PROJECT_ATTACH_TYPE,PD_PROJECT_ATTACH_NAME,PD_PROJECT_ATTACH_NAME_SYSTEM)"); builder.Append(" values ("); builder.Append(":AUTO_NO,:PD_PROJECT_CODE,:PD_PROJECT_ATTACH_TYPE,:PD_PROJECT_ATTACH_NAME,:PD_PROJECT_ATTACH_NAME_SYSTEM)"); OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":AUTO_NO", OracleType.Number, 8), new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 0x24), new OracleParameter(":PD_PROJECT_ATTACH_TYPE", OracleType.VarChar, 50), new OracleParameter(":PD_PROJECT_ATTACH_NAME", OracleType.VarChar, 50), new OracleParameter(":PD_PROJECT_ATTACH_NAME_SYSTEM", OracleType.VarChar, 50) }; cmdParms[0].Value = 0; cmdParms[1].Value = model.PD_PROJECT_CODE; cmdParms[2].Value = model.PD_PROJECT_ATTACH_TYPE; cmdParms[3].Value = model.PD_PROJECT_ATTACH_NAME; cmdParms[4].Value = model.PD_PROJECT_ATTACH_NAME_SYSTEM; DbHelperOra.ExecuteSql(builder.ToString(), cmdParms); }
public PD_PROJECT_ATTACH_SS_Model GetModel(string PD_PROJECT_CODE) { StringBuilder builder = new StringBuilder(); builder.Append("select AUTO_NO,PD_PROJECT_CODE,PD_PROJECT_ATTACH_TYPE,PD_PROJECT_ATTACH_NAME,PD_PROJECT_ATTACH_NAME_SYSTEM from PD_PROJECT_ATTACH_SS "); builder.Append(" where PD_PROJECT_CODE=:PD_PROJECT_CODE "); OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 50) }; cmdParms[0].Value = PD_PROJECT_CODE; PD_PROJECT_ATTACH_SS_Model model = new PD_PROJECT_ATTACH_SS_Model(); DataSet set = DbHelperOra.Query(builder.ToString(), cmdParms); if (set.Tables[0].Rows.Count > 0) { 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_PROJECT_ATTACH_TYPE = set.Tables[0].Rows[0]["PD_PROJECT_ATTACH_TYPE"].ToString(); model.PD_PROJECT_ATTACH_NAME = set.Tables[0].Rows[0]["PD_PROJECT_ATTACH_NAME"].ToString(); model.PD_PROJECT_ATTACH_NAME_SYSTEM = set.Tables[0].Rows[0]["PD_PROJECT_ATTACH_NAME_SYSTEM"].ToString(); return model; } return null; }
public List<PD_PROJECT_ATTACH_SS_Model> DataTableToList(DataTable dt) { List<PD_PROJECT_ATTACH_SS_Model> list = new List<PD_PROJECT_ATTACH_SS_Model>(); int count = dt.Rows.Count; if (count > 0) { for (int i = 0; i < count; i++) { PD_PROJECT_ATTACH_SS_Model item = new PD_PROJECT_ATTACH_SS_Model { AUTO_NO = dt.Rows[i]["AUTO_NO"].ToString(), PD_PROJECT_CODE = dt.Rows[i]["PD_PROJECT_CODE"].ToString(), PD_PROJECT_ATTACH_TYPE = dt.Rows[i]["PD_PROJECT_ATTACH_TYPE"].ToString(), PD_PROJECT_ATTACH_NAME = dt.Rows[i]["PD_PROJECT_ATTACH_NAME"].ToString(), PD_PROJECT_ATTACH_NAME_SYSTEM = dt.Rows[i]["PD_PROJECT_ATTACH_NAME_SYSTEM"].ToString() }; list.Add(item); } } return list; }
public bool Update(PD_PROJECT_ATTACH_SS_Model model) { StringBuilder builder = new StringBuilder(); builder.Append("update PD_PROJECT_ATTACH_SS set "); builder.Append("AUTO_NO=:AUTO_NO,"); builder.Append("PD_PROJECT_ATTACH_TYPE=:PD_PROJECT_ATTACH_TYPE,"); builder.Append("PD_PROJECT_ATTACH_NAME=:PD_PROJECT_ATTACH_NAME,"); builder.Append("PD_PROJECT_ATTACH_NAME_SYSTEM=:PD_PROJECT_ATTACH_NAME_SYSTEM"); builder.Append(" where PD_PROJECT_CODE=:PD_PROJECT_CODE "); OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":AUTO_NO", OracleType.Number, 8), new OracleParameter(":PD_PROJECT_ATTACH_TYPE", OracleType.VarChar, 50), new OracleParameter(":PD_PROJECT_ATTACH_NAME", OracleType.VarChar, 50), new OracleParameter(":PD_PROJECT_ATTACH_NAME_SYSTEM", OracleType.VarChar, 50), new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 30) }; cmdParms[0].Value = model.AUTO_NO; cmdParms[1].Value = model.PD_PROJECT_ATTACH_TYPE; cmdParms[2].Value = model.PD_PROJECT_ATTACH_NAME; cmdParms[3].Value = model.PD_PROJECT_ATTACH_NAME_SYSTEM; cmdParms[4].Value = model.PD_PROJECT_CODE; return (DbHelperOra.ExecuteSql(builder.ToString(), cmdParms) > 0); }
public void Add(PD_PROJECT_ATTACH_SS_Model model) { this.dal.Add(model); }
public bool Update(PD_PROJECT_ATTACH_SS_Model model) { return this.dal.Update(model); }
private List<PD_PROJECT_ATTACH_SS_Model> GetAttach_SSModel(string PD_PROJECT_CODE, ref string strErr) { List<PD_PROJECT_ATTACH_SS_Model> list = new List<PD_PROJECT_ATTACH_SS_Model>(); if (base.Request.Form["table_xmsszl_PD_PROJECT_CODE"] != null) { string[] strArray = base.Request.Form["table_xmsszl_PD_PROJECT_CODE"].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_ATTACH_SS_Model item = new PD_PROJECT_ATTACH_SS_Model { PD_PROJECT_CODE = strArray[i] }; if (defaultView != null) { defaultView.RowFilter = " tableID='table_xmsszl' and rowIndex=" + (i + 1); if (defaultView.Count > 0) { item.PD_PROJECT_ATTACH_NAME = defaultView[0]["FileName"].ToString(); item.PD_PROJECT_ATTACH_NAME_SYSTEM = defaultView[0]["FileSysName"].ToString(); } } list.Add(item); } } return list; }