public void Add(PD_PROJECT_REGULATE_DETAIL_Model model)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("insert into PD_PROJECT_REGULATE_DETAIL(");
     builder.Append("AUTO_NO,PD_PROJECT_CODE,FILENAME,FILESYSNAME,FILETYPE)");
     builder.Append(" values (");
     builder.Append(":AUTO_NO,:PD_PROJECT_CODE,:FILENAME,:FILESYSNAME,:FILETYPE)");
     OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":AUTO_NO", OracleType.Number, 20), new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 0x24), new OracleParameter(":FILENAME", OracleType.VarChar, 100), new OracleParameter(":FILESYSNAME", OracleType.VarChar, 50), new OracleParameter(":FILETYPE", OracleType.Char, 1) };
     cmdParms[0].Value = model.AUTO_NO;
     cmdParms[1].Value = model.PD_PROJECT_CODE;
     cmdParms[2].Value = model.FILENAME;
     cmdParms[3].Value = model.FILESYSNAME;
     cmdParms[4].Value = model.FILETYPE;
     DbHelperOra.ExecuteSql(builder.ToString(), cmdParms);
 }
 public List<PD_PROJECT_REGULATE_DETAIL_Model> DataTableToList(DataTable dt)
 {
     List<PD_PROJECT_REGULATE_DETAIL_Model> list = new List<PD_PROJECT_REGULATE_DETAIL_Model>();
     int count = dt.Rows.Count;
     if (count > 0)
     {
         for (int i = 0; i < count; i++)
         {
             PD_PROJECT_REGULATE_DETAIL_Model item = new PD_PROJECT_REGULATE_DETAIL_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.FILENAME = dt.Rows[i]["FILENAME"].ToString();
             item.FILESYSNAME = dt.Rows[i]["FILESYSNAME"].ToString();
             item.FILETYPE = dt.Rows[i]["FILETYPE"].ToString();
             list.Add(item);
         }
     }
     return list;
 }
 public PD_PROJECT_REGULATE_DETAIL_Model GetModel(string PD_PROJECT_CODE)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("select AUTO_NO,PD_PROJECT_CODE,FILENAME,FILESYSNAME,FILETYPE from PD_PROJECT_REGULATE_DETAIL ");
     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_REGULATE_DETAIL_Model model = new PD_PROJECT_REGULATE_DETAIL_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.FILENAME = set.Tables[0].Rows[0]["FILENAME"].ToString();
     model.FILESYSNAME = set.Tables[0].Rows[0]["FILESYSNAME"].ToString();
     model.FILETYPE = set.Tables[0].Rows[0]["FILETYPE"].ToString();
     return model;
 }
 public void Add(PD_PROJECT_REGULATE_DETAIL_Model model)
 {
     this.dal.Add(model);
 }
 public bool Update(PD_PROJECT_REGULATE_DETAIL_Model model)
 {
     return this.dal.Update(model);
 }
Пример #6
0
 public void addupdate()
 {
     news news = new news
     {
         newid = DateTime.Now.ToString("yyyyMMddHHmmssffff"),
         type = new int?(int.Parse(this.DropDownList1.SelectedValue)),
         subjects = this.txtPD_PROJECT_SUBJECTS.Text,
         contents = this.txtPD_PROJECT_CONTENTS.Value
     };
     if (news.contents.Length == 0)
     {
         news.contents = " ";
     }
     news.sysdate_ = new DateTime?(DateTime.Now);
     int count = 0;
     count = this.B_news.Add(news);
     if (count > 0)
     {
         PD_PROJECT_REGULATE_DETAIL_Bll bll = new PD_PROJECT_REGULATE_DETAIL_Bll();
         PD_PROJECT_REGULATE_DETAIL_Model model = new PD_PROJECT_REGULATE_DETAIL_Model
         {
             PD_PROJECT_CODE = news.newid
         };
         DataSet set = 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)) && ((set.Tables[0].Rows.Count > 0) && (set.Tables[0].Rows[0]["FileSysName"].ToString().Trim() != "")))
         {
             model.FILENAME = set.Tables[0].Rows[0]["FileName"].ToString();
             model.FILESYSNAME = set.Tables[0].Rows[0]["FileSysName"].ToString();
         }
         bll.Add(model);
     }
     if (base.Request["reload"] != null)
     {
         Const.AddSuccess(count, base.Request["reload"].ToString(), this.Page);
     }
     else
     {
         Const.AddSuccess(count, "", this.Page);
     }
 }
 public bool Update(PD_PROJECT_REGULATE_DETAIL_Model model)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("update PD_PROJECT_REGULATE_DETAIL set ");
     builder.Append("PD_PROJECT_CODE=:PD_PROJECT_CODE,");
     builder.Append("FILENAME=:FILENAME,");
     builder.Append("FILESYSNAME=:FILESYSNAME,");
     builder.Append("FILETYPE=:FILETYPE");
     builder.Append(" where PD_PROJECT_CODE=:PD_PROJECT_CODE ");
     OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 0x24), new OracleParameter(":FILENAME", OracleType.VarChar, 100), new OracleParameter(":FILESYSNAME", OracleType.VarChar, 50), new OracleParameter(":FILETYPE", OracleType.Char, 1), new OracleParameter(":AUTO_NO", OracleType.Number, 20) };
     cmdParms[0].Value = model.PD_PROJECT_CODE;
     cmdParms[1].Value = model.FILENAME;
     cmdParms[2].Value = model.FILESYSNAME;
     cmdParms[3].Value = model.FILETYPE;
     cmdParms[4].Value = model.AUTO_NO;
     return (DbHelperOra.ExecuteSql(builder.ToString(), cmdParms) > 0);
 }