public ResponseModel EditStoreUser([FromBody] CustomStoreUserEdit editStoreUser) { ResponseModel objResponseModel = new ResponseModel(); int statusCode = 0; string statusMessage = ""; try { string token = Convert.ToString(Request.Headers["X-Authorized-Token"]); Authenticate authenticate = new Authenticate(); authenticate = SecurityService.GetAuthenticateDataFromTokenCache(Cache, SecurityService.DecryptStringAES(token)); StoreUserCaller userCaller = new StoreUserCaller(); editStoreUser.CreatedBy = authenticate.UserMasterID; editStoreUser.TenantID = authenticate.TenantId; int Result = userCaller.EditStoreUser(new StoreUserService(Cache, Db), editStoreUser); statusCode = Result == 0 ? (int)EnumMaster.StatusCode.RecordNotFound : (int)EnumMaster.StatusCode.Success; statusMessage = CommonFunction.GetEnumDescription((EnumMaster.StatusCode)statusCode); objResponseModel.Status = true; objResponseModel.StatusCode = statusCode; objResponseModel.Message = statusMessage; objResponseModel.ResponseData = Result; } catch (Exception) { throw; } return(objResponseModel); }
/// <summary> /// Edit Store User /// </summary> /// <param name="CustomStoreUserEdit"></param> public int EditStoreUser(CustomStoreUserEdit customStoreUserEdit) { int success = 0; try { conn = Db.Connection; MySqlCommand cmd = new MySqlCommand("SP_UpdateStoreUser", conn); cmd.Connection = conn; cmd.Parameters.AddWithValue("@User_ID", customStoreUserEdit.UserID); cmd.Parameters.AddWithValue("@StoreBrand_IDs", customStoreUserEdit.StoreBrandIDs); cmd.Parameters.AddWithValue("@Store_IDs", customStoreUserEdit.StoreIDs); cmd.Parameters.AddWithValue("@Department_ID", customStoreUserEdit.DepartmentID); cmd.Parameters.AddWithValue("@Function_ID", customStoreUserEdit.FunctionID); cmd.Parameters.AddWithValue("@Designation_ID", customStoreUserEdit.DesignationID); cmd.Parameters.AddWithValue("@Reportee_ID", customStoreUserEdit.ReporteeID); cmd.Parameters.AddWithValue("@User_Name", customStoreUserEdit.UserName); cmd.Parameters.AddWithValue("@Email_ID", customStoreUserEdit.EmailID); cmd.Parameters.AddWithValue("@Mobile_No", customStoreUserEdit.MobileNo); cmd.Parameters.AddWithValue("@First_Name", customStoreUserEdit.FirstName); cmd.Parameters.AddWithValue("@Last_Name", customStoreUserEdit.LastName); cmd.Parameters.AddWithValue("@Brand_Ids", customStoreUserEdit.BrandIds); cmd.Parameters.AddWithValue("@Category_Ids", customStoreUserEdit.CategoryIds); cmd.Parameters.AddWithValue("@SubCategory_Ids", customStoreUserEdit.SubCategoryIds); cmd.Parameters.AddWithValue("@Issuetype_Ids", customStoreUserEdit.IssuetypeIds); cmd.Parameters.AddWithValue("@CRMRole_ID", customStoreUserEdit.CRMRoleID); cmd.Parameters.AddWithValue("@Is_ClaimApprove", customStoreUserEdit.IsClaimApprove); cmd.Parameters.AddWithValue("@Is_Active", customStoreUserEdit.IsActive); cmd.Parameters.AddWithValue("@Created_By", customStoreUserEdit.CreatedBy); cmd.Parameters.AddWithValue("@Tenant_ID", customStoreUserEdit.TenantID); cmd.Parameters.AddWithValue("@Is_StoreUser", customStoreUserEdit.IsStoreUser); cmd.CommandType = CommandType.StoredProcedure; success = Convert.ToInt32(cmd.ExecuteNonQuery()); } catch (Exception ex) { throw ex; } return(success); }
public int EditStoreUser(IStoreUser Users, CustomStoreUserEdit storeUser) { _StoreUserRepository = Users; return(_StoreUserRepository.EditStoreUser(storeUser)); }