public void Add(PD_PROJECT_ATTACH_BZ_Model model)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("insert into PD_PROJECT_ATTACH_BZ(");
     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.Char, 0x24), 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 = Guid.NewGuid().ToString();
     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_BZ_Model> DataTableToList(DataTable dt)
 {
     List<PD_PROJECT_ATTACH_BZ_Model> list = new List<PD_PROJECT_ATTACH_BZ_Model>();
     int count = dt.Rows.Count;
     if (count > 0)
     {
         for (int i = 0; i < count; i++)
         {
             PD_PROJECT_ATTACH_BZ_Model item = new PD_PROJECT_ATTACH_BZ_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 PD_PROJECT_ATTACH_BZ_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_BZ ");
     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_BZ_Model model = new PD_PROJECT_ATTACH_BZ_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 bool Update(PD_PROJECT_ATTACH_BZ_Model model)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("update PD_PROJECT_ATTACH_BZ 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.Char, 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), 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);
 }
Example #5
0
 private List<PD_PROJECT_ATTACH_BZ_Model> GetATTACH_BZ_Model(string PD_PROJECT_CODE)
 {
     List<PD_PROJECT_ATTACH_BZ_Model> list = new List<PD_PROJECT_ATTACH_BZ_Model>();
     if (base.Request.Form["table_BzXmzl_file_type"] != null)
     {
         string[] strArray = base.Request.Form["table_BzXmzl_file_type"].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_BZ_Model item = new PD_PROJECT_ATTACH_BZ_Model
             {
                 PD_PROJECT_CODE = PD_PROJECT_CODE
             };
             if (defaultView != null)
             {
                 defaultView.RowFilter = " tableID='table_BzXmzl' 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;
 }
 public void Add(PD_PROJECT_ATTACH_BZ_Model model)
 {
     this.dal.Add(model);
 }
 public bool Update(PD_PROJECT_ATTACH_BZ_Model model)
 {
     return this.dal.Update(model);
 }