public void Add(PD_PROJECT_ATTACH_SB_Model model)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("insert into PD_PROJECT_ATTACH_SB(");
     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, 30), new OracleParameter(":PD_PROJECT_ATTACH_TYPE", OracleType.VarChar, 50), new OracleParameter(":PD_PROJECT_ATTACH_NAME", OracleType.VarChar, 0xff), new OracleParameter(":PD_PROJECT_ATTACH_NAME_SYSTEM", OracleType.VarChar, 50) };
     cmdParms[0].Value = model.AUTO_NO;
     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 List<PD_PROJECT_ATTACH_SB_Model> DataTableToList(DataTable dt)
 {
     List<PD_PROJECT_ATTACH_SB_Model> list = new List<PD_PROJECT_ATTACH_SB_Model>();
     int count = dt.Rows.Count;
     if (count > 0)
     {
         for (int i = 0; i < count; i++)
         {
             PD_PROJECT_ATTACH_SB_Model item = new PD_PROJECT_ATTACH_SB_Model();
             if (dt.Rows[i]["AUTO_NO"].ToString() != "")
             {
                 item.AUTO_NO = int.Parse(dt.Rows[i]["AUTO_NO"].ToString());
             }
             item.PD_PROJECT_CODE = dt.Rows[i]["PD_PROJECT_CODE"].ToString();
             item.PD_PROJECT_ATTACH_TYPE = dt.Rows[i]["PD_PROJECT_ATTACH_TYPE"].ToString();
             item.PD_PROJECT_ATTACH_NAME = dt.Rows[i]["PD_PROJECT_ATTACH_NAME"].ToString();
             item.PD_PROJECT_ATTACH_NAME_SYSTEM = dt.Rows[i]["PD_PROJECT_ATTACH_NAME_SYSTEM"].ToString();
             list.Add(item);
         }
     }
     return list;
 }
 public PD_PROJECT_ATTACH_SB_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_SB ");
     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_SB_Model model = new PD_PROJECT_ATTACH_SB_Model();
     DataSet set = DbHelperOra.Query(builder.ToString(), cmdParms);
     if (set.Tables[0].Rows.Count <= 0)
     {
         return null;
     }
     if (set.Tables[0].Rows[0]["AUTO_NO"].ToString() != "")
     {
         model.AUTO_NO = int.Parse(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;
 }
 public bool Update(PD_PROJECT_ATTACH_SB_Model model)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("update PD_PROJECT_ATTACH_SB set ");
     builder.Append("PD_PROJECT_CODE=:PD_PROJECT_CODE,");
     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(":PD_PROJECT_CODE", OracleType.VarChar, 30), new OracleParameter(":PD_PROJECT_ATTACH_TYPE", OracleType.VarChar, 50), new OracleParameter(":PD_PROJECT_ATTACH_NAME", OracleType.VarChar, 0xff), new OracleParameter(":PD_PROJECT_ATTACH_NAME_SYSTEM", OracleType.VarChar, 50), new OracleParameter(":AUTO_NO", OracleType.Number, 4) };
     cmdParms[0].Value = model.PD_PROJECT_CODE;
     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.AUTO_NO;
     return (DbHelperOra.ExecuteSql(builder.ToString(), cmdParms) > 0);
 }
 public void Add(PD_PROJECT_ATTACH_SB_Model model)
 {
     this.dal.Add(model);
 }
 public bool Update(PD_PROJECT_ATTACH_SB_Model model)
 {
     return this.dal.Update(model);
 }
Esempio n. 7
0
 private List<PD_PROJECT_ATTACH_SB_Model> GetAttach_SBModel(string PD_PROJECT_CODE)
 {
     List<PD_PROJECT_ATTACH_SB_Model> list = new List<PD_PROJECT_ATTACH_SB_Model>();
     if (base.Request.Form["table_xmsbzl_PD_PROJECT_CODE"] != null)
     {
         string[] strArray = base.Request.Form["table_xmsbzl_PD_PROJECT_CODE"].Split(new char[] { ',' });
         int length = strArray.Length;
         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)
         {
             return list;
         }
         for (int i = 0; i < strArray.Length; i++)
         {
             defaultView.RowFilter = " tableID='table_xmsbzl' and rowIndex=" + (i + 1);
             if (defaultView.Count > 0)
             {
                 PD_PROJECT_ATTACH_SB_Model item = new PD_PROJECT_ATTACH_SB_Model
                 {
                     PD_PROJECT_CODE = PD_PROJECT_CODE,
                     PD_PROJECT_ATTACH_NAME = defaultView[0]["FileName"].ToString(),
                     PD_PROJECT_ATTACH_NAME_SYSTEM = defaultView[0]["FileSysName"].ToString()
                 };
                 list.Add(item);
             }
         }
     }
     return list;
 }