Exemplo n.º 1
0
 public void addupdate()
 {
     try
     {
         this.dbo = new DB_OPT();
         this.dbo.Open();
         if ((this.txtZWName.Text.Trim() == "") || (this.txtYWName.Text.Trim() == ""))
         {
             Const.ShowMessage("带*号的数据必须填写!", this.Page);
         }
         else
         {
             this.model = new DataTableModel();
             this.sd = new DataTableDal();
             this.model.TABLEREMARK = this.txtZWName.Text.Trim();
             this.model.TABLENAME = this.txtYWName.Text.Trim();
             this.model.REMARK = this.txtRemark.Text.Trim();
             int count = 0;
             if ((base.Request["PK"] != null) && (base.Request["PK"].ToString() != ""))
             {
                 this.model.PK = base.Request["PK"].ToString();
                 Const.UpdateSuccess(this.sd.Update(this.model, this.dbo), this.Page);
             }
             else
             {
                 count = this.sd.Add(this.model, this.dbo);
                 if (base.Request["reload"] != null)
                 {
                     Const.AddSuccess(count, base.Request["reload"].ToString(), this.Page);
                 }
                 else
                 {
                     Const.AddSuccess(count, "", this.Page);
                 }
             }
         }
     }
     catch (Exception exception)
     {
         this.el = new ExceptionLog.ExceptionLog();
         this.el.ErrClassName = base.GetType().ToString();
         this.el.ErrMessage = exception.Message.ToString();
         this.el.ErrMethod = "addupdate()";
         this.el.WriteExceptionLog(true);
         Const.OpenErrorPage("操作失败,请联系管理员!", this.Page);
     }
     finally
     {
         if (this.dbo != null)
         {
             this.dbo.Close();
         }
     }
 }
Exemplo n.º 2
0
 public int Add(DataTableModel model, DB_OPT dbo)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("insert into DB_DATATABLE(");
     builder.Append("TABLEREMARK,TABLENAME,REMARK");
     builder.Append(")");
     builder.Append(" values (");
     builder.Append("'" + model.TABLEREMARK + "',");
     builder.Append("'" + model.TABLENAME + "',");
     builder.Append("'" + model.REMARK + "'");
     builder.Append(")");
     return dbo.ExecutionIsSucess(builder.ToString(), null);
 }
Exemplo n.º 3
0
 public DataTableModel[] GetModels(string strWhere, DB_OPT dbo)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append(this.GetSql());
     if (strWhere != "")
     {
         builder.Append(" where " + strWhere);
     }
     OracleParameter[] parameters = null;
     DataSet set = dbo.BackDataSet(builder.ToString(), parameters, "");
     DataTableModel[] modelArray = null;
     if (set.Tables[0].Rows.Count <= 0)
     {
         return null;
     }
     modelArray = new DataTableModel[set.Tables[0].Rows.Count];
     for (int i = 0; i < set.Tables[0].Rows.Count; i++)
     {
         modelArray[i] = new DataTableModel();
         modelArray[i] = this.GetModel(set.Tables[0].Rows[i]);
     }
     return modelArray;
 }
Exemplo n.º 4
0
 public int Update(DataTableModel model, DB_OPT dbo)
 {
     StringBuilder builder = new StringBuilder();
     builder.Append("update DB_DATATABLE set ");
     builder.Append("TABLEREMARK='" + model.TABLEREMARK + "',");
     builder.Append("TABLENAME='" + model.TABLENAME + "',");
     builder.Append("REMARK='" + model.REMARK + "'");
     builder.Append(" where PK='" + model.PK + "' ");
     return dbo.ExecutionIsSucess(builder.ToString(), null);
 }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.Session["user"] == null)
     {
         Const.GoLoginPath_OpenWindow(this.Page);
     }
     else
     {
         this.Master.ButtonsPushDown = new ButtonsHandler(this.Buttons);
         if (!base.IsPostBack)
         {
             string userName = ((UserModel)this.Session["User"]).UserName;
             string power = ((UserModel)this.Session["User"]).Power;
             ButtonsModel model = new ButtonsModel(userName)
             {
                 IfAdd = false,
                 IfUpdate = false,
                 IfDelete = false,
                 IfLook = false,
                 IfSearch = false,
                 IfRefresh = true,
                 IfHuiZong = false,
                 IfPutOut = false,
                 IfSet = false,
                 IfSave = true,
                 IfExit = true
             };
             if ((base.Request["PK"] != null) && (base.Request["PK"] != ""))
             {
                 try
                 {
                     this.dbo = new DB_OPT();
                     this.dbo.Open();
                     this.sd = new DataTableDal();
                     this.model = this.sd.GetModel(base.Request.QueryString["PK"].ToString(), this.dbo);
                 }
                 catch (Exception exception)
                 {
                     this.el = new ExceptionLog.ExceptionLog();
                     this.el.ErrClassName = base.GetType().ToString();
                     this.el.ErrMessage = exception.Message.ToString();
                     this.el.ErrMethod = "Page_Load()";
                     this.el.WriteExceptionLog(true);
                     Const.OpenErrorPage("获取数据失败,请联系管理员!", this.Page);
                 }
                 finally
                 {
                     if (this.dbo != null)
                     {
                         this.dbo.Close();
                     }
                 }
             }
             this.Master.btModel = model;
         }
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     this.Master.ButtonsPushDown = new ButtonsHandler(this.Buttons);
     if (base.IsPostBack)
     {
         return;
     }
     if (this.Session["user"] == null)
     {
         Const.GoLoginPath_OpenWindow(this.Page);
         return;
     }
     string userName = ((UserModel)this.Session["User"]).UserName;
     string power = ((UserModel)this.Session["User"]).Power;
     ButtonsModel model = new ButtonsModel(userName)
     {
         IfAdd = false,
         IfUpdate = false,
         IfDelete = false,
         IfLook = false,
         IfSearch = false,
         IfRefresh = true,
         IfHuiZong = false,
         IfPutOut = false,
         IfSet = false,
         IfSave = true,
         IfExit = true
     };
     if ((base.Request["PK"] != null) && (base.Request["PK"] != ""))
     {
         try
         {
             try
             {
                 this.Master.LBTitle = "字典设置 - 修改数据字典——表信息";
                 this.Master.TitlePic = "~/images/页标题/修改税费项目.jpg";
                 this.dbo = new DB_OPT();
                 this.dbo.Open();
                 this.sd = new DataTableDal();
                 this.model = this.sd.GetModel(base.Request.QueryString["PK"].ToString(), this.dbo);
                 this.txtZWName.Text = this.model.TABLEREMARK.Trim();
                 this.txtYWName.Text = this.model.TABLENAME.Trim();
                 this.txtRemark.Text = this.model.REMARK.Trim();
             }
             catch (Exception exception)
             {
                 this.el = new ExceptionLog.ExceptionLog();
                 this.el.ErrClassName = base.GetType().ToString();
                 this.el.ErrMessage = exception.Message.ToString();
                 this.el.ErrMethod = "Page_Load()";
                 this.el.WriteExceptionLog(true);
                 Const.OpenErrorPage("获取数据失败,请联系管理员!", this.Page);
             }
             goto Label_025D;
         }
         finally
         {
             if (this.dbo != null)
             {
                 this.dbo.Close();
             }
         }
     }
     this.Master.LBTitle = "字典设置 - 新增数据字典——表信息";
     this.Master.TitlePic = "~/images/页标题/修改税费项目.jpg";
     Label_025D:
     this.Master.btModel = model;
 }