public int Update(PageList _PageList) { try { DbCommand oDbCommand = DbProviderHelper.CreateCommand("PageList_Update", CommandType.StoredProcedure); AddParameter(oDbCommand, "@PageTitle", DbType.String, _PageList.PageTitle); AddParameter(oDbCommand, "@PageName", DbType.String, _PageList.PageName); AddParameter(oDbCommand, "@Description", DbType.String, _PageList.Description); AddParameter(oDbCommand, "@PageUrl", DbType.String, _PageList.PageUrl); if (_PageList.ImageUrl != null) { AddParameter(oDbCommand, "@ImageUrl", DbType.String, _PageList.ImageUrl); } else { AddParameter(oDbCommand, "@ImageUrl", DbType.String, DBNull.Value); } AddParameter(oDbCommand, "@ModuleId", DbType.Int32, _PageList.ModuleId); AddParameter(oDbCommand, "@IsPage", DbType.Boolean, _PageList.IsPage); AddParameter(oDbCommand, "@IsRemoved", DbType.Boolean, _PageList.IsRemoved); AddParameter(oDbCommand, "@CreateDate", DbType.DateTime, _PageList.CreateDate); AddParameter(oDbCommand, "@CreatorId", DbType.Int32, _PageList.CreatorId); AddParameter(oDbCommand, "@PageId", DbType.Int32, _PageList.PageId); return(DbProviderHelper.ExecuteNonQuery(oDbCommand)); } catch (Exception ex) { throw ex; } }
public List <RoleWisePermission> RoleWisePermission_GetAll() { DbDataReader oDbDataReader = null; try { List <RoleWisePermission> lstRoleWisePermission = new List <RoleWisePermission>(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_GetAll", CommandType.StoredProcedure); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { RoleWisePermission oRoleWisePermission = new RoleWisePermission(); BuildEntity(oDbDataReader, oRoleWisePermission); lstRoleWisePermission.Add(oRoleWisePermission); } return(lstRoleWisePermission); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public RoleWisePermission RoleWisePermission_GetById(Int64 PermissionId) { DbDataReader oDbDataReader = null; try { RoleWisePermission oRoleWisePermission = new RoleWisePermission(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_GetById", CommandType.StoredProcedure); AddParameter(oDbCommand, "@PermissionId", DbType.Int64, PermissionId); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { BuildEntity(oDbDataReader, oRoleWisePermission); } return(oRoleWisePermission); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public List <RoleWisePermission> RoleWisePermission_GetDynamic(string WhereCondition, string OrderByExpression) { DbDataReader oDbDataReader = null; try { List <RoleWisePermission> lstRoleWisePermission = new List <RoleWisePermission>(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_GetDynamic", CommandType.StoredProcedure); AddParameter(oDbCommand, "@WhereCondition", DbType.String, WhereCondition); AddParameter(oDbCommand, "@OrderByExpression", DbType.String, OrderByExpression); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { RoleWisePermission oRoleWisePermission = new RoleWisePermission(); BuildEntity(oDbDataReader, oRoleWisePermission); lstRoleWisePermission.Add(oRoleWisePermission); } return(lstRoleWisePermission); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public PageList PageList_GetById(Int32 PageId) { DbDataReader oDbDataReader = null; try { PageList oPageList = new PageList(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("PageList_GetById", CommandType.StoredProcedure); AddParameter(oDbCommand, "@PageId", DbType.Int32, PageId); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { BuildEntity(oDbDataReader, oPageList); } return(oPageList); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public List <PageList> PageList_GetAll() { DbDataReader oDbDataReader = null; try { List <PageList> lstPageList = new List <PageList>(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("PageList_GetAll", CommandType.StoredProcedure); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { PageList oPageList = new PageList(); BuildEntity(oDbDataReader, oPageList); lstPageList.Add(oPageList); } return(lstPageList); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public List <Roles> Roles_GetByCompanyId(Int32 CompanyId) { DbDataReader oDbDataReader = null; try { List <Roles> lstRoless = new List <Roles>(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("Roles_GetByCompanyId", CommandType.StoredProcedure); AddParameter(oDbCommand, "@CompanyId", DbType.Int32, CompanyId); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { Roles oRoles = new Roles(); BuildEntity(oDbDataReader, oRoles); lstRoless.Add(oRoles); } return(lstRoless); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public Store Store_GetById(int StoreId) { DbDataReader oDbDataReader = null; try { Store oStore = new Store(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("Store_GetById", CommandType.StoredProcedure); AddParameter(oDbCommand, "@StoreId", DbType.Int32, StoreId); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { BuildEntity(oDbDataReader, oStore); } return(oStore); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public List <Store> Store_GetAll() { DbDataReader oDbDataReader = null; try { List <Store> lstStore = new List <Store>(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("Store_GetAll", CommandType.StoredProcedure); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { Store oStore = new Store(); BuildEntity(oDbDataReader, oStore); lstStore.Add(oStore); } return(lstStore); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public DataTable Store_GetById(int storeId) { DbDataReader oDbDataReader = null; DataTable dt = new DataTable(); try { DbCommand oDbCommand = DbProviderHelper.CreateCommand("Store_GetById", CommandType.StoredProcedure); AddParameter(oDbCommand, "@StoreId", DbType.Int32, storeId); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); dt.Load(oDbDataReader); return(dt); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public int Delete(Int64 PermissionId) { try { DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_DeleteById", CommandType.StoredProcedure); AddParameter(oDbCommand, "@PermissionId", DbType.Int64, PermissionId); return(DbProviderHelper.ExecuteNonQuery(oDbCommand)); } catch (Exception ex) { throw ex; } }
public int Delete(Int32 PageId) { try { DbCommand oDbCommand = DbProviderHelper.CreateCommand("PageList_DeleteById", CommandType.StoredProcedure); AddParameter(oDbCommand, "@PageId", DbType.Int32, PageId); return(DbProviderHelper.ExecuteNonQuery(oDbCommand)); } catch (Exception ex) { throw ex; } }
public int Update(RoleWisePermission _RoleWisePermission) { try { DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_Update", CommandType.StoredProcedure); AddParameter(oDbCommand, "@RoleId", DbType.Int32, _RoleWisePermission.RoleId); AddParameter(oDbCommand, "@PageId", DbType.Int32, _RoleWisePermission.PageId); AddParameter(oDbCommand, "@CanCreate", DbType.Boolean, _RoleWisePermission.CanCreate); AddParameter(oDbCommand, "@CanDelete", DbType.Boolean, _RoleWisePermission.CanDelete); AddParameter(oDbCommand, "@CanUpdate", DbType.Boolean, _RoleWisePermission.CanUpdate); AddParameter(oDbCommand, "@CanSelect", DbType.Boolean, _RoleWisePermission.CanSelect); AddParameter(oDbCommand, "@AssignedBy", DbType.Int32, _RoleWisePermission.AssignedBy); AddParameter(oDbCommand, "@CompanyId", DbType.Int32, _RoleWisePermission.CompanyId); AddParameter(oDbCommand, "@PermissionId", DbType.Int64, _RoleWisePermission.PermissionId); return(DbProviderHelper.ExecuteNonQuery(oDbCommand)); } catch (Exception ex) { throw ex; } }
public List <RoleWisePermission> RoleWisePermission_GetPaged(int StartRowIndex, int RowPerPage, string WhereClause, string SortColumn, string SortOrder, ref int rows) { DbDataReader oDbDataReader = null; try { List <RoleWisePermission> lstRoleWisePermission = new List <RoleWisePermission>(); DbCommand oDbCommand = DbProviderHelper.CreateCommand("RoleWisePermission_GetPaged", CommandType.StoredProcedure); AddParameter(oDbCommand, "@StartRowIndex", DbType.Int32, StartRowIndex); AddParameter(oDbCommand, "@RowPerPage", DbType.Int32, RowPerPage); AddParameter(oDbCommand, "@WhereClause", DbType.String, WhereClause); AddParameter(oDbCommand, "@SortColumn", DbType.String, SortColumn); AddParameter(oDbCommand, "@SortOrder", DbType.String, SortOrder); oDbDataReader = DbProviderHelper.ExecuteReader(oDbCommand); while (oDbDataReader.Read()) { RoleWisePermission oRoleWisePermission = new RoleWisePermission(); BuildEntity(oDbDataReader, oRoleWisePermission); lstRoleWisePermission.Add(oRoleWisePermission); } if ((oDbDataReader.NextResult()) && (oDbDataReader.Read())) { rows = oDbDataReader.GetInt32(0); } return(lstRoleWisePermission); } catch (Exception ex) { throw ex; } finally { if (!oDbDataReader.IsClosed) { oDbDataReader.Close(); oDbDataReader.Dispose(); } } }
public int Update(Roles _Roles) { try { DbCommand oDbCommand = DbProviderHelper.CreateCommand("Roles_Update", CommandType.StoredProcedure); AddParameter(oDbCommand, "@RoleName", DbType.String, _Roles.RoleName); AddParameter(oDbCommand, "@LoweredRoleName", DbType.String, _Roles.LoweredRoleName); if (_Roles.Description != null) { AddParameter(oDbCommand, "@Description", DbType.String, _Roles.Description); } else { AddParameter(oDbCommand, "@Description", DbType.String, DBNull.Value); } AddParameter(oDbCommand, "@CompanyId", DbType.Int32, _Roles.CompanyId); AddParameter(oDbCommand, "@RoleId", DbType.Int32, _Roles.RoleId); return(DbProviderHelper.ExecuteNonQuery(oDbCommand)); } catch (Exception ex) { throw ex; } }
public int Update(Store _Store) { try { DbCommand oDbCommand = DbProviderHelper.CreateCommand("Store_Update", CommandType.StoredProcedure); if (_Store.StoreName != null) { AddParameter(oDbCommand, "@StoreName", DbType.String, _Store.StoreName); } else { AddParameter(oDbCommand, "@StoreName", DbType.String, DBNull.Value); } if (_Store.StoreAddress != null) { AddParameter(oDbCommand, "@StoreAddress", DbType.String, _Store.StoreAddress); } else { AddParameter(oDbCommand, "@StoreAddress", DbType.String, DBNull.Value); } if (_Store.PhoneNo != null) { AddParameter(oDbCommand, "@PhoneNo", DbType.String, _Store.PhoneNo); } else { AddParameter(oDbCommand, "@PhoneNo", DbType.String, DBNull.Value); } if (_Store.Email != null) { AddParameter(oDbCommand, "@Email", DbType.String, _Store.Email); } else { AddParameter(oDbCommand, "@Email", DbType.String, DBNull.Value); } AddParameter(oDbCommand, "@ProjectId", DbType.Int32, _Store.ProjectId); AddParameter(oDbCommand, "@CompanyId", DbType.Int32, _Store.CompanyId); if (_Store.Mobile != null) { AddParameter(oDbCommand, "@Mobile", DbType.String, _Store.Mobile); } else { AddParameter(oDbCommand, "@Mobile", DbType.String, DBNull.Value); } if (_Store.ContactPerson != null) { AddParameter(oDbCommand, "@ContactPerson", DbType.String, _Store.ContactPerson); } else { AddParameter(oDbCommand, "@ContactPerson", DbType.String, DBNull.Value); } if (_Store.StoreCF1 != null) { AddParameter(oDbCommand, "@StoreCF1", DbType.String, _Store.StoreCF1); } else { AddParameter(oDbCommand, "@StoreCF1", DbType.String, DBNull.Value); } if (_Store.StoreCF2 != null) { AddParameter(oDbCommand, "@StoreCF2", DbType.String, _Store.StoreCF2); } else { AddParameter(oDbCommand, "@StoreCF2", DbType.String, DBNull.Value); } if (_Store.StoreCF3 != null) { AddParameter(oDbCommand, "@StoreCF3", DbType.String, _Store.StoreCF3); } else { AddParameter(oDbCommand, "@StoreCF3", DbType.String, DBNull.Value); } AddParameter(oDbCommand, "@StoreId", DbType.Int32, _Store.StoreId); return(DbProviderHelper.ExecuteNonQuery(oDbCommand)); } catch (Exception ex) { throw ex; } }
public int Update(Users _Users) { try { DbCommand oDbCommand = DbProviderHelper.CreateCommand("Users_Update", CommandType.StoredProcedure); AddParameter(oDbCommand, "@Name", DbType.String, _Users.Name); AddParameter(oDbCommand, "@Password", DbType.String, _Users.Password); if (_Users.FirstName != null) { AddParameter(oDbCommand, "@FirstName", DbType.String, _Users.FirstName); } else { AddParameter(oDbCommand, "@FirstName", DbType.String, DBNull.Value); } if (_Users.LastName != null) { AddParameter(oDbCommand, "@LastName", DbType.String, _Users.LastName); } else { AddParameter(oDbCommand, "@LastName", DbType.String, DBNull.Value); } if (_Users.Email != null) { AddParameter(oDbCommand, "@Email", DbType.String, _Users.Email); } else { AddParameter(oDbCommand, "@Email", DbType.String, DBNull.Value); } AddParameter(oDbCommand, "@IsLoggedIn", DbType.Boolean, _Users.IsLoggedIn); if (_Users.HasAdminRight.HasValue) { AddParameter(oDbCommand, "@HasAdminRight", DbType.Boolean, _Users.HasAdminRight); } else { AddParameter(oDbCommand, "@HasAdminRight", DbType.Boolean, DBNull.Value); } if (_Users.HasRefundright.HasValue) { AddParameter(oDbCommand, "@HasRefundright", DbType.Boolean, _Users.HasRefundright); } else { AddParameter(oDbCommand, "@HasRefundright", DbType.Boolean, DBNull.Value); } if (_Users.HasDiscountRight.HasValue) { AddParameter(oDbCommand, "@HasDiscountRight", DbType.Boolean, _Users.HasDiscountRight); } else { AddParameter(oDbCommand, "@HasDiscountRight", DbType.Boolean, DBNull.Value); } if (_Users.EnteredBy.HasValue) { AddParameter(oDbCommand, "@EnteredBy", DbType.Int32, _Users.EnteredBy); } else { AddParameter(oDbCommand, "@EnteredBy", DbType.Int32, DBNull.Value); } AddParameter(oDbCommand, "@EnteredTime", DbType.DateTime, _Users.EnteredTime); if (_Users.UpdatedBy.HasValue) { AddParameter(oDbCommand, "@UpdatedBy", DbType.Int32, _Users.UpdatedBy); } else { AddParameter(oDbCommand, "@UpdatedBy", DbType.Int32, DBNull.Value); } if (_Users.UpdatedTime.HasValue) { AddParameter(oDbCommand, "@UpdatedTime", DbType.DateTime, _Users.UpdatedTime); } else { AddParameter(oDbCommand, "@UpdatedTime", DbType.DateTime, DBNull.Value); } if (_Users.DeactivatedTime.HasValue) { AddParameter(oDbCommand, "@DeactivatedTime", DbType.DateTime, _Users.DeactivatedTime); } else { AddParameter(oDbCommand, "@DeactivatedTime", DbType.DateTime, DBNull.Value); } AddParameter(oDbCommand, "@UserId", DbType.Int32, _Users.UserId); return(DbProviderHelper.ExecuteNonQuery(oDbCommand)); } catch (Exception ex) { throw ex; } }