Exemple #1
0
 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 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;
     }
 }
Exemple #3
0
 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;
     }
 }
Exemple #5
0
 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;
     }
 }
Exemple #7
0
 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;
     }
 }