Csla.Data.ConnectionManager.GetManager(string, bool, string)

Here are the examples of the csharp api Csla.Data.ConnectionManager.GetManager(string, bool, string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2391 Examples 7

19 View Source File : G12Level111111.Designer.cs
License : MIT License
Project Creator : CslaGenFork

[Transactional(TransactionalTypes.TransactionScope)]
        private void Child_Insert(G10Level11111 parent)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("DeepLoad"))
            {
                using (var cmd = new SqlCommand("AddG12Level111111", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_ID", parent.Level_1_1_1_1_1_ID).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_1_ID", ReadProperty(Level_1_1_1_1_1_1_IDProperty)).Direction = ParameterDirection.Output;
                    cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_1_Name", ReadProperty(Level_1_1_1_1_1_1_NameProperty)).DbType = DbType.String;
                    var args = new DataPortalHookArgs(cmd);
                    OnInsertPre(args);
                    cmd.ExecuteNonQuery();
                    OnInsertPost(args);
                    LoadProperty(Level_1_1_1_1_1_1_IDProperty, (int) cmd.Parameters["@Level_1_1_1_1_1_1_ID"].Value);
                }
            }
        }

19 View Source File : G12Level111111.Designer.cs
License : MIT License
Project Creator : CslaGenFork

[Transactional(TransactionalTypes.TransactionScope)]
        private void Child_Update()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("DeepLoad"))
            {
                using (var cmd = new SqlCommand("UpdateG12Level111111", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_1_ID", ReadProperty(Level_1_1_1_1_1_1_IDProperty)).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_1_Name", ReadProperty(Level_1_1_1_1_1_1_NameProperty)).DbType = DbType.String;
                    var args = new DataPortalHookArgs(cmd);
                    OnUpdatePre(args);
                    cmd.ExecuteNonQuery();
                    OnUpdatePost(args);
                }
            }
        }

19 View Source File : G12Level111111.Designer.cs
License : MIT License
Project Creator : CslaGenFork

[Transactional(TransactionalTypes.TransactionScope)]
        private void Child_DeleteSelf()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("DeepLoad"))
            {
                using (var cmd = new SqlCommand("DeleteG12Level111111", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Level_1_1_1_1_1_1_ID", ReadProperty(Level_1_1_1_1_1_1_IDProperty)).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd);
                    OnDeletePre(args);
                    cmd.ExecuteNonQuery();
                    OnDeletePost(args);
                }
            }
        }

19 View Source File : Role.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(int roleID)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetRole", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RoleID", roleID).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, roleID);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : CircList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(CriteriaGetByObject crit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetCircList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@DocID", crit.DocID == null ? (object)DBNull.Value : crit.DocID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@FolderID", crit.FolderID == null ? (object)DBNull.Value : crit.FolderID.Value).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, crit);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : RoleList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            if (IsCached)
            {
                LoadCachedList();
                return;
            }

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetRoleList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
            _list = this;
        }

19 View Source File : User.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(int userID)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetUser", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@UserID", userID).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, userID);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : UserList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            if (IsCached)
            {
                LoadCachedList();
                return;
            }

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetUserList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
            _list = this;
        }

19 View Source File : UserList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(FilteredCriteria crit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetUserList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Name", crit.Name == null ? (object)DBNull.Value : crit.Name).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Login", crit.Login == null ? (object)DBNull.Value : crit.Login).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Email", crit.Email == null ? (object)DBNull.Value : crit.Email).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@IsActive", crit.IsActive == null ? (object)DBNull.Value : crit.IsActive.Value).DbType = DbType.Boolean;
                    var args = new DataPortalHookArgs(cmd, crit);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : UserList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(CriteriaInactive crit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetUserList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@Name", crit.Name).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@IsActive", crit.IsActive).DbType = DbType.Boolean;
                    var args = new DataPortalHookArgs(cmd, crit);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : CircTypeTagEditColl.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetCircTypeTagEditColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : CircTypeTagEditDynaColl.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetCircTypeTagEditDynaColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : Doc.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(int docID)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDoc", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@DocID", docID).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, docID);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : DocClassEditDynaColl.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocClreplacedEditDynaColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DocClassList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            if (IsCached)
            {
                LoadCachedList();
                return;
            }

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocClreplacedList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
            _list = this;
        }

19 View Source File : DocClassList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(string docClreplacedName)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocClreplacedList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@DocClreplacedName", docClreplacedName).DbType = DbType.String;
                    var args = new DataPortalHookArgs(cmd, docClreplacedName);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DocTypeEditDynaColl.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocTypeEditDynaColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DocTypeList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(string docTypeName)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocTypeList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@DocTypeName", docTypeName).DbType = DbType.String;
                    var args = new DataPortalHookArgs(cmd, docTypeName);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DocList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                GetQueryGetDocList();
                using (var cmd = new SqlCommand(getDocListInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DocList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(DocListFilteredCriteria crit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                GetQueryGetDocList(crit);
                using (var cmd = new SqlCommand(getDocListInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@DocID", crit.DocID == null ? (object)DBNull.Value : crit.DocID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@DocClreplacedID", crit.DocClreplacedID == null ? (object)DBNull.Value : crit.DocClreplacedID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@DocTypeID", crit.DocTypeID == null ? (object)DBNull.Value : crit.DocTypeID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@SenderID", crit.SenderID == null ? (object)DBNull.Value : crit.SenderID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@RecipientID", crit.RecipientID == null ? (object)DBNull.Value : crit.RecipientID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@DocRef", crit.DocRef == null ? (object)DBNull.Value : crit.DocRef).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DocDate", crit.DocDate == null ? (object)DBNull.Value : crit.DocDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@Subject", crit.Subject == null ? (object)DBNull.Value : crit.Subject).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DocStatusID", crit.DocStatusID == null ? (object)DBNull.Value : crit.DocStatusID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@CreateDate", crit.CreateDate == null ? (object)DBNull.Value : crit.CreateDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@CreateUserID", crit.CreateUserID == null ? (object)DBNull.Value : crit.CreateUserID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@ChangeDate", crit.ChangeDate == null ? (object)DBNull.Value : crit.ChangeDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@ChangeUserID", crit.ChangeUserID == null ? (object)DBNull.Value : crit.ChangeUserID.Value).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, crit);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DocStatusColl.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocStatusColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DocType.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(int docTypeID)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocType", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@DocTypeID", docTypeID).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, docTypeID);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : DocTypeEditColl.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocTypeEditColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DocTypeList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            if (IsCached)
            {
                LoadCachedList();
                return;
            }

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocTypeList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
            _list = this;
        }

19 View Source File : Folder.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(int folderID)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetFolder", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@FolderID", folderID).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, folderID);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : FolderDocColl.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(int folderID)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetFolderDocColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@FolderID", folderID).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, folderID);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : FolderList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            if (IsCached)
            {
                LoadCachedList();
                return;
            }

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetFolderList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
            _list = this;
        }

19 View Source File : FolderList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(FilteredCriteria crit)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetFolderList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@FolderTypeID", crit.FolderTypeID == null ? (object)DBNull.Value : crit.FolderTypeID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@FolderRef", crit.FolderRef == null ? (object)DBNull.Value : crit.FolderRef).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Year", crit.Year == null ? (object)DBNull.Value : crit.Year.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@Subject", crit.Subject == null ? (object)DBNull.Value : crit.Subject).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@FolderStatusID", crit.FolderStatusID == null ? (object)DBNull.Value : crit.FolderStatusID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@CreateDate", crit.CreateDate == null ? (object)DBNull.Value : crit.CreateDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@CreateUserID", crit.CreateUserID == null ? (object)DBNull.Value : crit.CreateUserID.Value).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@ChangeDate", crit.ChangeDate == null ? (object)DBNull.Value : crit.ChangeDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@ChangeUserID", crit.ChangeUserID == null ? (object)DBNull.Value : crit.ChangeUserID.Value).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, crit);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : FolderType.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(int folderTypeID)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetFolderType", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@FolderTypeID", folderTypeID).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, folderTypeID);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : FolderTypeList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            if (IsCached)
            {
                LoadCachedList();
                return;
            }

            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetFolderTypeList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
            _list = this;
        }

19 View Source File : FolderTypeList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(string folderTypeName)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetFolderTypeList", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@FolderTypeName", folderTypeName).DbType = DbType.String;
                    var args = new DataPortalHookArgs(cmd, folderTypeName);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : CustomerEdit.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(string customerId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                GetQueryGetCustomerEdit(customerId);
                using (var cmd = new SqlCommand(getCustomerEditInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@CustomerId", customerId).DbType = DbType.StringFixedLength;
                    var args = new DataPortalHookArgs(cmd, customerId);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : CustomerEdit.Designer.cs
License : MIT License
Project Creator : CslaGenFork

[Transactional(TransactionalTypes.TransactionScope)]
        protected void DataPortal_Delete(string customerId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                GetQueryDeleteCustomerEdit(customerId);
                using (var cmd = new SqlCommand(deleteCustomerEditInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@CustomerId", customerId).DbType = DbType.StringFixedLength;
                    var args = new DataPortalHookArgs(cmd, customerId);
                    OnDeletePre(args);
                    cmd.ExecuteNonQuery();
                    OnDeletePost(args);
                }
            }
        }

19 View Source File : CustomerList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                GetQueryGetCustomerList();
                using (var cmd = new SqlCommand(getCustomerListInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : CustomerList.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(string name)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                GetQueryGetCustomerList(name);
                using (var cmd = new SqlCommand(getCustomerListInlineQuery, ctx.Connection))
                {
                    cmd.CommandType = CommandType.Text;
                    cmd.Parameters.AddWithValue("@Name", name).DbType = DbType.String;
                    var args = new DataPortalHookArgs(cmd, name);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : InvoiceEdit.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(Guid invoiceId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.GetInvoiceEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceId).DbType = DbType.Guid;
                    var args = new DataPortalHookArgs(cmd, invoiceId);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : InvoiceEdit.Designer.cs
License : MIT License
Project Creator : CslaGenFork

[Transactional(TransactionalTypes.TransactionScope)]
        protected override void DataPortal_Insert()
        {
            SimpleAuditTrail();
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.AddInvoiceEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", ReadProperty(InvoiceIdProperty)).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@InvoiceNumber", ReadProperty(InvoiceNumberProperty)).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@CustomerId", ReadProperty(CustomerIdProperty)).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@InvoiceDate", ReadProperty(InvoiceDateProperty).DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@CreateDate", ReadProperty(CreateDateProperty).DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@CreateUser", ReadProperty(CreateUserProperty)).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@ChangeDate", ReadProperty(ChangeDateProperty).DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@ChangeUser", ReadProperty(ChangeUserProperty)).DbType = DbType.Int32;
                    cmd.Parameters.Add("@NewRowVersion", SqlDbType.Timestamp).Direction = ParameterDirection.Output;
                    var args = new DataPortalHookArgs(cmd);
                    OnInsertPre(args);
                    cmd.ExecuteNonQuery();
                    OnInsertPost(args);
                    LoadProperty(RowVersionProperty, (byte[]) cmd.Parameters["@NewRowVersion"].Value);
                }
                // flushes all pending data operations
                FieldManager.UpdateChildren(this);
            }
        }

19 View Source File : InvoiceEdit.Designer.cs
License : MIT License
Project Creator : CslaGenFork

[Transactional(TransactionalTypes.TransactionScope)]
        protected override void DataPortal_Update()
        {
            SimpleAuditTrail();
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateInvoiceEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", ReadProperty(InvoiceIdProperty)).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@InvoiceNumber", ReadProperty(InvoiceNumberProperty)).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@CustomerId", ReadProperty(CustomerIdProperty)).DbType = DbType.StringFixedLength;
                    cmd.Parameters.AddWithValue("@InvoiceDate", ReadProperty(InvoiceDateProperty).DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@ChangeDate", ReadProperty(ChangeDateProperty).DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@ChangeUser", ReadProperty(ChangeUserProperty)).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@RowVersion", ReadProperty(RowVersionProperty)).DbType = DbType.Binary;
                    cmd.Parameters.Add("@NewRowVersion", SqlDbType.Timestamp).Direction = ParameterDirection.Output;
                    var args = new DataPortalHookArgs(cmd);
                    OnUpdatePre(args);
                    cmd.ExecuteNonQuery();
                    OnUpdatePost(args);
                    LoadProperty(RowVersionProperty, (byte[]) cmd.Parameters["@NewRowVersion"].Value);
                }
                // flushes all pending data operations
                FieldManager.UpdateChildren(this);
            }
        }

19 View Source File : InvoiceEdit.Designer.cs
License : MIT License
Project Creator : CslaGenFork

[Transactional(TransactionalTypes.TransactionScope)]
        protected void DataPortal_Delete(Guid invoiceId)
        {
            // audit the object, just in case soft delete is used on this object
            SimpleAuditTrail();
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                // flushes all pending data operations
                FieldManager.UpdateChildren(this);
                using (var cmd = new SqlCommand("dbo.DeleteInvoiceEdit", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", invoiceId).DbType = DbType.Guid;
                    var args = new DataPortalHookArgs(cmd, invoiceId);
                    OnDeletePre(args);
                    cmd.ExecuteNonQuery();
                    OnDeletePost(args);
                }
            }
            // removes all previous references to children
            LoadProperty(InvoiceLinesProperty, DataPortal.CreateChild<InvoiceLineCollection>());
        }

19 View Source File : InvoiceLineItem.Designer.cs
License : MIT License
Project Creator : CslaGenFork

[Transactional(TransactionalTypes.TransactionScope)]
        private void Child_Insert(InvoiceEdit parent)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("Invoices"))
            {
                using (var cmd = new SqlCommand("dbo.AddInvoiceLineItem", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@InvoiceId", parent.InvoiceId).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@InvoiceLineId", ReadProperty(InvoiceLineIdProperty)).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@ProductId", ReadProperty(ProductIdProperty)).DbType = DbType.Guid;
                    cmd.Parameters.AddWithValue("@Cost", ReadProperty(CostProperty)).DbType = DbType.Decimal;
                    cmd.Parameters.AddWithValue("@PercentDiscount", ReadProperty(PercentDiscountProperty)).DbType = DbType.Byte;
                    var args = new DataPortalHookArgs(cmd);
                    OnInsertPre(args);
                    cmd.ExecuteNonQuery();
                    OnInsertPost(args);
                }
            }
        }

19 View Source File : DocClassEditColl.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch()
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocClreplacedEditColl", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    var args = new DataPortalHookArgs(cmd);
                    OnFetchPre(args);
                    LoadCollection(cmd);
                    OnFetchPost(args);
                }
            }
        }

19 View Source File : DeliveryRegisterDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public void Insert(out int registerId, SmartDate registerDate, string doreplacedentType, string doreplacedentReference, string doreplacedentEnreplacedy, string doreplacedentDept, string doreplacedentClreplaced, SmartDate doreplacedentDate, string recipientName, string expeditorName, string receptionName, SmartDate receptionDate, SmartDate createDate, SmartDate changeDate)
        {
            registerId = -1;
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("InterwayDocs"))
            {
                using (var cmd = new SqlCommand("dbo.AddDeliveryRegister", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RegisterId", registerId).Direction = ParameterDirection.Output;
                    cmd.Parameters.AddWithValue("@RegisterDate", registerDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@DoreplacedentType", doreplacedentType).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentReference", doreplacedentReference).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentEnreplacedy", doreplacedentEnreplacedy).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDept", doreplacedentDept).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentClreplaced", doreplacedentClreplaced).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDate", doreplacedentDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@RecipientName", recipientName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ExpeditorName", expeditorName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ReceptionName", receptionName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ReceptionDate", receptionDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@CreateDate", createDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@ChangeDate", changeDate.DBValue).DbType = DbType.DateTime2;
                    cmd.ExecuteNonQuery();
                    registerId = (int)cmd.Parameters["@RegisterId"].Value;
                }
            }
        }

19 View Source File : DeliveryRegisterDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public void Update(int registerId, SmartDate registerDate, string doreplacedentType, string doreplacedentReference, string doreplacedentEnreplacedy, string doreplacedentDept, string doreplacedentClreplaced, SmartDate doreplacedentDate, string recipientName, string expeditorName, string receptionName, SmartDate receptionDate, SmartDate changeDate)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("InterwayDocs"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateDeliveryRegister", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RegisterId", registerId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@RegisterDate", registerDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@DoreplacedentType", doreplacedentType).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentReference", doreplacedentReference).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentEnreplacedy", doreplacedentEnreplacedy).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDept", doreplacedentDept).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentClreplaced", doreplacedentClreplaced).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDate", doreplacedentDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@RecipientName", recipientName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ExpeditorName", expeditorName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ReceptionName", receptionName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ReceptionDate", receptionDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@ChangeDate", changeDate.DBValue).DbType = DbType.DateTime2;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("DeliveryRegister");
                }
            }
        }

19 View Source File : IncomingRegisterDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public IDataReader Fetch(int registerId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("InterwayDocs"))
            {
                using (var cmd = new SqlCommand("dbo.GetIncomingRegister", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RegisterId", registerId).DbType = DbType.Int32;
                    return cmd.ExecuteReader();
                }
            }
        }

19 View Source File : IncomingRegisterDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public void Update(int registerId, SmartDate registerDate, string doreplacedentType, string doreplacedentReference, string doreplacedentEnreplacedy, string doreplacedentDept, string doreplacedentClreplaced, SmartDate doreplacedentDate, string subject, string senderName, SmartDate receptionDate, string routedTo, string notes, string archiveLocation, SmartDate changeDate)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("InterwayDocs"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateIncomingRegister", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RegisterId", registerId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@RegisterDate", registerDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@DoreplacedentType", doreplacedentType).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentReference", doreplacedentReference).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentEnreplacedy", doreplacedentEnreplacedy).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDept", doreplacedentDept).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentClreplaced", doreplacedentClreplaced).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDate", doreplacedentDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@Subject", subject).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@SenderName", senderName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ReceptionDate", receptionDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@RoutedTo", routedTo).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Notes", notes).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ArchiveLocation", archiveLocation).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ChangeDate", changeDate.DBValue).DbType = DbType.DateTime2;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("IncomingRegister");
                }
            }
        }

19 View Source File : OutgoingRegisterDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public void Update(int registerId, SmartDate registerDate, string doreplacedentType, string doreplacedentReference, string doreplacedentEnreplacedy, string doreplacedentDept, string doreplacedentClreplaced, SmartDate doreplacedentDate, string subject, SmartDate sendDate, string recipientName, string recipientTown, string notes, string archiveLocation, SmartDate changeDate)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("InterwayDocs"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateOutgoingRegister", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RegisterId", registerId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@RegisterDate", registerDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@DoreplacedentType", doreplacedentType).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentReference", doreplacedentReference).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentEnreplacedy", doreplacedentEnreplacedy).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDept", doreplacedentDept).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentClreplaced", doreplacedentClreplaced).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDate", doreplacedentDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@Subject", subject).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@SendDate", sendDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@RecipientName", recipientName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@RecipientTown", recipientTown).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Notes", notes).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ArchiveLocation", archiveLocation).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ChangeDate", changeDate.DBValue).DbType = DbType.DateTime2;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("OutgoingRegister");
                }
            }
        }

19 View Source File : DocClass.Designer.cs
License : MIT License
Project Creator : CslaGenFork

protected void DataPortal_Fetch(int docClreplacedID)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager(Database.DocStoreConnection, false))
            {
                using (var cmd = new SqlCommand("GetDocClreplaced", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@DocClreplacedID", docClreplacedID).DbType = DbType.Int32;
                    var args = new DataPortalHookArgs(cmd, docClreplacedID);
                    OnFetchPre(args);
                    Fetch(cmd);
                    OnFetchPost(args);
                }
            }
            // check all object rules and property rules
            BusinessRules.CheckRules();
        }

19 View Source File : DeliveryRegisterDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public DeliveryRegisterDto Insert(DeliveryRegisterDto deliveryRegister)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("InterwayDocs"))
            {
                using (var cmd = new SqlCommand("dbo.AddDeliveryRegister", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RegisterId", deliveryRegister.RegisterId).Direction = ParameterDirection.Output;
                    cmd.Parameters.AddWithValue("@RegisterDate", deliveryRegister.RegisterDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@DoreplacedentType", deliveryRegister.DoreplacedentType).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentReference", deliveryRegister.DoreplacedentReference).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentEnreplacedy", deliveryRegister.DoreplacedentEnreplacedy).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDept", deliveryRegister.DoreplacedentDept).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentClreplaced", deliveryRegister.DoreplacedentClreplaced).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDate", deliveryRegister.DoreplacedentDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@RecipientName", deliveryRegister.RecipientName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ExpeditorName", deliveryRegister.ExpeditorName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ReceptionName", deliveryRegister.ReceptionName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ReceptionDate", deliveryRegister.ReceptionDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@CreateDate", deliveryRegister.CreateDate.DBValue).DbType = DbType.DateTime2;
                    cmd.Parameters.AddWithValue("@ChangeDate", deliveryRegister.ChangeDate.DBValue).DbType = DbType.DateTime2;
                    cmd.ExecuteNonQuery();
                    deliveryRegister.RegisterId = (int)cmd.Parameters["@RegisterId"].Value;
                }
            }
            return deliveryRegister;
        }

19 View Source File : IncomingRegisterDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public IncomingRegisterDto Fetch(int registerId)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("InterwayDocs"))
            {
                using (var cmd = new SqlCommand("dbo.GetIncomingRegister", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RegisterId", registerId).DbType = DbType.Int32;
                    var dr = cmd.ExecuteReader();
                    return Fetch(dr);
                }
            }
        }

19 View Source File : IncomingRegisterDal.Designer.cs
License : MIT License
Project Creator : CslaGenFork

public IncomingRegisterDto Update(IncomingRegisterDto incomingRegister)
        {
            using (var ctx = ConnectionManager<SqlConnection>.GetManager("InterwayDocs"))
            {
                using (var cmd = new SqlCommand("dbo.UpdateIncomingRegister", ctx.Connection))
                {
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@RegisterId", incomingRegister.RegisterId).DbType = DbType.Int32;
                    cmd.Parameters.AddWithValue("@RegisterDate", incomingRegister.RegisterDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@DoreplacedentType", incomingRegister.DoreplacedentType).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentReference", incomingRegister.DoreplacedentReference).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentEnreplacedy", incomingRegister.DoreplacedentEnreplacedy).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDept", incomingRegister.DoreplacedentDept).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentClreplaced", incomingRegister.DoreplacedentClreplaced).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@DoreplacedentDate", incomingRegister.DoreplacedentDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@Subject", incomingRegister.Subject).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@SenderName", incomingRegister.SenderName).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ReceptionDate", incomingRegister.ReceptionDate.DBValue).DbType = DbType.Date;
                    cmd.Parameters.AddWithValue("@RoutedTo", incomingRegister.RoutedTo).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@Notes", incomingRegister.Notes).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ArchiveLocation", incomingRegister.ArchiveLocation).DbType = DbType.String;
                    cmd.Parameters.AddWithValue("@ChangeDate", incomingRegister.ChangeDate.DBValue).DbType = DbType.DateTime2;
                    var rowsAffected = cmd.ExecuteNonQuery();
                    if (rowsAffected == 0)
                        throw new DataNotFoundException("IncomingRegister");
                }
            }
            return incomingRegister;
        }

See More Examples