/// <summary> /// Deletes a record based on primary key(s) /// </summary> internal static void Delete(int roleId) { ThirdTempdbContext context = new ThirdTempdbContext(); var objRoleMaster = context.RoleMaster.Where(r => r.RoleId == roleId).FirstOrDefault(); if (objRoleMaster != null) { context.RoleMaster.Remove(objRoleMaster); context.SaveChanges(); } }
/// <summary> /// Deletes a record based on primary key(s) /// </summary> internal static void Delete(int userId) { ThirdTempdbContext context = new ThirdTempdbContext(); var objUserMaster = context.UserMaster.Where(u => u.UserId == userId).FirstOrDefault(); if (objUserMaster != null) { context.UserMaster.Remove(objUserMaster); context.SaveChanges(); } }
/// <summary> /// Deletes a record based on primary key(s) /// </summary> internal static void Delete(int workflowId) { ThirdTempdbContext context = new ThirdTempdbContext(); var objWorkflowMaster = context.WorkflowMaster.Where(w => w.WorkflowId == workflowId).FirstOrDefault(); if (objWorkflowMaster != null) { context.WorkflowMaster.Remove(objWorkflowMaster); context.SaveChanges(); } }
/// <summary> /// Updates a record /// </summary> internal static void Update(UserRoles objUserRoles) { ThirdTempdbContext context = new ThirdTempdbContext(); UserRoles entUserRoles = context.UserRoles.Where(u => u.UserRoleId == objUserRoles.UserRoleId).FirstOrDefault(); if (entUserRoles != null) { entUserRoles.UserId = objUserRoles.UserId; entUserRoles.RoleId = objUserRoles.RoleId; entUserRoles.Status = objUserRoles.Status; context.SaveChanges(); } }
/// <summary> /// Inserts a record /// </summary> internal static int Insert(UserRoles objUserRoles) { ThirdTempdbContext context = new ThirdTempdbContext(); UserRoles entUserRoles = new UserRoles(); entUserRoles.UserId = objUserRoles.UserId; entUserRoles.RoleId = objUserRoles.RoleId; entUserRoles.Status = objUserRoles.Status; context.UserRoles.Add(entUserRoles); context.SaveChanges(); return(entUserRoles.UserRoleId); }
/// <summary> /// Updates a record /// </summary> internal static void Update(RoleMaster objRoleMaster) { ThirdTempdbContext context = new ThirdTempdbContext(); RoleMaster entRoleMaster = context.RoleMaster.Where(r => r.RoleId == objRoleMaster.RoleId).FirstOrDefault(); if (entRoleMaster != null) { entRoleMaster.RoleDescription = objRoleMaster.RoleDescription; entRoleMaster.CreatedOn = objRoleMaster.CreatedOn; entRoleMaster.CreatedBy = objRoleMaster.CreatedBy; entRoleMaster.ModifiedOn = objRoleMaster.ModifiedOn; entRoleMaster.ModifiedBy = objRoleMaster.ModifiedBy; context.SaveChanges(); } }
/// <summary> /// Inserts a record /// </summary> internal static int Insert(RoleMaster objRoleMaster) { ThirdTempdbContext context = new ThirdTempdbContext(); RoleMaster entRoleMaster = new RoleMaster(); entRoleMaster.RoleDescription = objRoleMaster.RoleDescription; entRoleMaster.CreatedOn = objRoleMaster.CreatedOn; entRoleMaster.CreatedBy = objRoleMaster.CreatedBy; entRoleMaster.ModifiedOn = objRoleMaster.ModifiedOn; entRoleMaster.ModifiedBy = objRoleMaster.ModifiedBy; context.RoleMaster.Add(entRoleMaster); context.SaveChanges(); return(entRoleMaster.RoleId); }
/// <summary> /// Updates a record /// </summary> internal static void Update(WorkflowMaster objWorkflowMaster) { ThirdTempdbContext context = new ThirdTempdbContext(); WorkflowMaster entWorkflowMaster = context.WorkflowMaster.Where(w => w.WorkflowId == objWorkflowMaster.WorkflowId).FirstOrDefault(); if (entWorkflowMaster != null) { entWorkflowMaster.WorkflowName = objWorkflowMaster.WorkflowName; entWorkflowMaster.LevelOfApprovals = objWorkflowMaster.LevelOfApprovals; entWorkflowMaster.CreatedBy = objWorkflowMaster.CreatedBy; entWorkflowMaster.CreatedOn = objWorkflowMaster.CreatedOn; entWorkflowMaster.Updatedby = objWorkflowMaster.Updatedby; entWorkflowMaster.Updatedon = objWorkflowMaster.Updatedon; context.SaveChanges(); } }
/// <summary> /// Inserts a record /// </summary> internal static int Insert(WorkflowMaster objWorkflowMaster) { ThirdTempdbContext context = new ThirdTempdbContext(); WorkflowMaster entWorkflowMaster = new WorkflowMaster(); entWorkflowMaster.WorkflowName = objWorkflowMaster.WorkflowName; entWorkflowMaster.LevelOfApprovals = objWorkflowMaster.LevelOfApprovals; entWorkflowMaster.CreatedBy = objWorkflowMaster.CreatedBy; entWorkflowMaster.CreatedOn = objWorkflowMaster.CreatedOn; entWorkflowMaster.Updatedby = objWorkflowMaster.Updatedby; entWorkflowMaster.Updatedon = objWorkflowMaster.Updatedon; context.WorkflowMaster.Add(entWorkflowMaster); context.SaveChanges(); return(entWorkflowMaster.WorkflowId); }
/// <summary> /// Updates a record /// </summary> internal static void Update(UserMaster objUserMaster) { ThirdTempdbContext context = new ThirdTempdbContext(); UserMaster entUserMaster = context.UserMaster.Where(u => u.UserId == objUserMaster.UserId).FirstOrDefault(); if (entUserMaster != null) { entUserMaster.UserName = objUserMaster.UserName; entUserMaster.Password = objUserMaster.Password; entUserMaster.Email = objUserMaster.Email; entUserMaster.CreatedOn = objUserMaster.CreatedOn; entUserMaster.CreatedBy = objUserMaster.CreatedBy; entUserMaster.ModifiedOn = objUserMaster.ModifiedOn; entUserMaster.ModifiedBy = objUserMaster.ModifiedBy; context.SaveChanges(); } }
/// <summary> /// Inserts a record /// </summary> internal static int Insert(UserMaster objUserMaster) { ThirdTempdbContext context = new ThirdTempdbContext(); UserMaster entUserMaster = new UserMaster(); entUserMaster.UserName = objUserMaster.UserName; entUserMaster.Password = objUserMaster.Password; entUserMaster.Email = objUserMaster.Email; entUserMaster.CreatedOn = objUserMaster.CreatedOn; entUserMaster.CreatedBy = objUserMaster.CreatedBy; entUserMaster.ModifiedOn = objUserMaster.ModifiedOn; entUserMaster.ModifiedBy = objUserMaster.ModifiedBy; context.UserMaster.Add(entUserMaster); context.SaveChanges(); return(entUserMaster.UserId); }