Esempio n. 1
0
        public static bool Delete(VersionMode model)
        {
            var command = _dbBaseProvider.CreateCommandStruct("ContractVersion", CommandMode.Delete);

            command.Filter           = _dbBaseProvider.CreateCommandFilter();
            command.Filter.Condition = _dbBaseProvider.FormatFilterParam("ID");
            command.Filter.AddParam("ID", model.ID);
            command.Parser();
            return(_dbBaseProvider.ExecuteQuery(CommandType.Text, command.Sql, command.Parameters) > 0);
        }
Esempio n. 2
0
        public static int Add(VersionMode model)
        {
            var command = _dbBaseProvider.CreateCommandStruct("ContractVersion", CommandMode.Insert);

            command.AddParameter("SlnID", model.SlnID);
            command.AddParameter("Title", model.Title);
            command.ReturnIdentity = true;
            command.Parser();
            return(_dbBaseProvider.ExecuteQuery(CommandType.Text, command.Sql, command.Parameters));
        }
Esempio n. 3
0
 protected void butSubmit_Click(object sender, EventArgs e)
 {
     try
     {
         VersionMode model = new VersionMode();
         model.Title = txtTitle.Text.Trim();
         model.SlnID = SlnId;
         if (DbDataLoader.Add(model) > 0)
         {
             BindData();
             Page.RegisterStartupScript("", "<script language=javascript>alert('添加成功!')</script>");
         }
     }
     catch (Exception ex)
     {
         TraceLog.WriteError("AgreementAdd:{0}", ex);
         Page.RegisterStartupScript("", "<script language=javascript>alert('添加失败,填写重复!')</script>");
     }
 }
Esempio n. 4
0
        protected void GridView1_RowUpdating(object sender, GridViewUpdateEventArgs e)
        {
            try
            {
                int    id    = Convert.ToInt32((string)GridView1.DataKeys[e.RowIndex].Values[0].ToString());
                string title = ((TextBox)GridView1.Rows[e.RowIndex].FindControl("itTitle")).Text;

                VersionMode model = new VersionMode();
                model.ID    = id;
                model.Title = title;
                model.SlnID = SlnId;
                if (DbDataLoader.Update(model))
                {
                    GridView1.EditIndex = -1;
                    BindData();
                }
            }

            catch (Exception erro)
            {
                Response.Write("错误信息:" + erro.Message);
            }
        }
 /// <summary>
 ///   Initializes a new instance of this class.
 /// </summary>
 /// <param name="mode">The version check mode.</param>
 public VersionAttribute(VersionMode mode)
 {
     Mode = mode;
 }
Esempio n. 6
0
 public static string BuildXtensiveType(VersionMode enumValue)
 {
     return(BuildXtensiveType(OrmNamespace.Orm, ENUM_TYPE_VERSION_MODE, enumValue));
 }