public PD_PROJECT_TZJGC_Model DataRowToModel(DataRow row)
 {
     PD_PROJECT_TZJGC_Model model = new PD_PROJECT_TZJGC_Model();
     if (row != null)
     {
         if (row["ID"] != null)
         {
             model.ID = row["ID"].ToString();
         }
         if ((row["PD_BASE_TZJGC"] != null) && (row["PD_BASE_TZJGC"].ToString() != ""))
         {
             model.PD_BASE_TZJGC = new decimal?(decimal.Parse(row["PD_BASE_TZJGC"].ToString()));
         }
         if (row["TB_QUOTA_ZBWH"] != null)
         {
             model.TB_QUOTA_ZBWH = row["TB_QUOTA_ZBWH"].ToString();
         }
         if ((row["PD_PROJECT_MONEY_CZ_SJ"] != null) && (row["PD_PROJECT_MONEY_CZ_SJ"].ToString() != ""))
         {
             model.PD_PROJECT_MONEY_CZ_SJ = new decimal?(decimal.Parse(row["PD_PROJECT_MONEY_CZ_SJ"].ToString()));
         }
         if (row["PD_PROJECT_CODE"] != null)
         {
             model.PD_PROJECT_CODE = row["PD_PROJECT_CODE"].ToString();
         }
         if (row["TB_QUOTA_CODE"] != null)
         {
             model.TB_QUOTA_CODE = row["TB_QUOTA_CODE"].ToString();
         }
     }
     return model;
 }
 public bool Add(PD_PROJECT_TZJGC_Model model)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("insert into PD_PROJECT_TZJGC(");
     builder.Append("ID,PD_BASE_TZJGC,TB_QUOTA_ZBWH,PD_PROJECT_MONEY_CZ_SJ,PD_PROJECT_CODE,TB_QUOTA_CODE)");
     builder.Append(" values (");
     builder.Append(":ID,:PD_BASE_TZJGC,:TB_QUOTA_ZBWH,:PD_PROJECT_MONEY_CZ_SJ,:PD_PROJECT_CODE,:TB_QUOTA_CODE)");
     OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":ID", OracleType.VarChar, 30), new OracleParameter(":PD_BASE_TZJGC", OracleType.Number, 2), new OracleParameter(":TB_QUOTA_ZBWH", OracleType.VarChar, 30), new OracleParameter(":PD_PROJECT_MONEY_CZ_SJ", OracleType.Number, 0x10), new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 30), new OracleParameter(":TB_QUOTA_CODE", OracleType.VarChar, 30) };
     cmdParms[0].Value = model.ID;
     cmdParms[1].Value = model.PD_BASE_TZJGC;
     cmdParms[2].Value = model.TB_QUOTA_ZBWH;
     cmdParms[3].Value = model.PD_PROJECT_MONEY_CZ_SJ;
     cmdParms[4].Value = model.PD_PROJECT_CODE;
     cmdParms[5].Value = model.TB_QUOTA_CODE;
     return (DbHelperOra.ExecuteSql(builder.ToString(), cmdParms) > 0);
 }
 public bool Update(PD_PROJECT_TZJGC_Model model)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("update PD_PROJECT_TZJGC set ");
     builder.Append("PD_BASE_TZJGC=:PD_BASE_TZJGC,");
     builder.Append("TB_QUOTA_ZBWH=:TB_QUOTA_ZBWH,");
     builder.Append("PD_PROJECT_MONEY_CZ_SJ=:PD_PROJECT_MONEY_CZ_SJ,");
     builder.Append("PD_PROJECT_CODE=:PD_PROJECT_CODE,");
     builder.Append("TB_QUOTA_CODE=:TB_QUOTA_CODE");
     builder.Append(" where ID=:ID ");
     OracleParameter[] cmdParms = new OracleParameter[] { new OracleParameter(":PD_BASE_TZJGC", OracleType.Number, 2), new OracleParameter(":TB_QUOTA_ZBWH", OracleType.VarChar, 30), new OracleParameter(":PD_PROJECT_MONEY_CZ_SJ", OracleType.Number, 0x10), new OracleParameter(":PD_PROJECT_CODE", OracleType.VarChar, 30), new OracleParameter(":TB_QUOTA_CODE", OracleType.VarChar, 30), new OracleParameter(":ID", OracleType.VarChar, 30) };
     cmdParms[0].Value = model.PD_BASE_TZJGC;
     cmdParms[1].Value = model.TB_QUOTA_ZBWH;
     cmdParms[2].Value = model.PD_PROJECT_MONEY_CZ_SJ;
     cmdParms[3].Value = model.PD_PROJECT_CODE;
     cmdParms[4].Value = model.TB_QUOTA_CODE;
     cmdParms[5].Value = model.ID;
     return (DbHelperOra.ExecuteSql(builder.ToString(), cmdParms) > 0);
 }
 public bool Add(PD_PROJECT_TZJGC_Model model)
 {
     return this.dal.Add(model);
 }
 public bool Update(PD_PROJECT_TZJGC_Model model)
 {
     return this.dal.Update(model);
 }
Example #6
0
 private List<PD_PROJECT_TZJGC_Model> getTZJGCModel(string PD_PROJECT_CODE)
 {
     List<PD_PROJECT_TZJGC_Model> list = new List<PD_PROJECT_TZJGC_Model>();
     if (base.Request["PD_BASE_TZJGC"] != null)
     {
         string[] strArray = base.Request["PD_BASE_TZJGC"].Split(new char[] { ',' });
         string[] strArray2 = base.Request["PD_PROJECT_MONEY_CZ_SJ"].Split(new char[] { ',' });
         for (int i = 0; i < strArray.Length; i++)
         {
             PD_PROJECT_TZJGC_Model item = new PD_PROJECT_TZJGC_Model
             {
                 PD_PROJECT_CODE = PD_PROJECT_CODE
             };
             if (PublicDal.PageValidate.IsInt(strArray[i]))
             {
                 item.PD_BASE_TZJGC = new decimal?(int.Parse(strArray[i]));
             }
             if (PublicDal.PageValidate.IsDecimal(strArray2[i]))
             {
                 item.PD_PROJECT_MONEY_CZ_SJ = new decimal?(decimal.Parse(strArray2[i]));
             }
             list.Add(item);
         }
     }
     return list;
 }