public ResponseModel UpdateAppointmentConfiguration([FromBody] StoreAppointmentConfiguration storeAppointmentConfiguration) { int UpdateCount = 0; StoreCampaignCaller storecampaigncaller = new StoreCampaignCaller(); 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.GetAuthenticateDataFromToken(_radisCacheServerAddress, SecurityService.DecryptStringAES(token)); UpdateCount = storecampaigncaller.UpdateAppointmentConfiguration(new StoreCampaignService(_connectioSting), storeAppointmentConfiguration, authenticate.UserMasterID); statusCode = UpdateCount.Equals(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 = UpdateCount; } catch (Exception) { throw; } return(objResponseModel); }
/// <summary> /// Update Appointment Configuration /// </summary> /// <param name="storeAppointmentConfiguration"></param> /// <param name="modifiedBy"></param> /// <returns></returns> public int UpdateAppointmentConfiguration(StoreAppointmentConfiguration storeAppointmentConfiguration, int modifiedBy) { int UpdateCount = 0; try { conn.Open(); MySqlCommand cmd = new MySqlCommand("SP_HSUpdateAppointmentConfiguration", conn) { Connection = conn }; cmd.Parameters.AddWithValue("@_ID", storeAppointmentConfiguration.ID); cmd.Parameters.AddWithValue("@_GenerateOTP", Convert.ToInt16(storeAppointmentConfiguration.GenerateOTP)); cmd.Parameters.AddWithValue("@_CardQRcode", Convert.ToInt16(storeAppointmentConfiguration.CardQRcode)); cmd.Parameters.AddWithValue("@_CardBarcode", Convert.ToInt16(storeAppointmentConfiguration.CardBarcode)); cmd.Parameters.AddWithValue("@_OnlyCard", Convert.ToInt16(storeAppointmentConfiguration.OnlyCard)); cmd.Parameters.AddWithValue("@_ModifiedBy", modifiedBy); cmd.CommandType = CommandType.StoredProcedure; UpdateCount = Convert.ToInt32(cmd.ExecuteNonQuery()); } catch (Exception) { throw; } finally { if (conn != null) { conn.Close(); } } return(UpdateCount); }
/// <summary> /// GetAppointmentConfiguration /// </summary> /// <param name="TenantId"></param> /// <param name="UserId"></param> /// <param name="ProgramCode"></param> /// <returns></returns> public StoreAppointmentConfiguration GetAppointmentConfiguration(int tenantId, int userId, string programCode) { DataSet ds = new DataSet(); StoreAppointmentConfiguration storeAppointmentConfiguration = new StoreAppointmentConfiguration(); try { conn.Open(); MySqlCommand cmd = new MySqlCommand("SP_HSGetAppointmentConfigurationList", conn) { CommandType = CommandType.StoredProcedure }; cmd.Parameters.AddWithValue("@_tenantID", tenantId); cmd.Parameters.AddWithValue("@UserID", userId); cmd.Parameters.AddWithValue("@_prgramCode", programCode); MySqlDataAdapter da = new MySqlDataAdapter { SelectCommand = cmd }; da.Fill(ds); if (ds != null && ds.Tables[0] != null) { if (ds.Tables[0].Rows.Count > 0) { storeAppointmentConfiguration.ID = Convert.ToInt32(ds.Tables[0].Rows[0]["ID"]); storeAppointmentConfiguration.GenerateOTP = ds.Tables[0].Rows[0]["GenerateOTP"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["GenerateOTP"]); storeAppointmentConfiguration.CardQRcode = ds.Tables[0].Rows[0]["CardQRcode"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["CardQRcode"]); storeAppointmentConfiguration.CardBarcode = ds.Tables[0].Rows[0]["CardBarcode"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["CardBarcode"]); storeAppointmentConfiguration.OnlyCard = ds.Tables[0].Rows[0]["OnlyCard"] == DBNull.Value ? false : Convert.ToBoolean(ds.Tables[0].Rows[0]["OnlyCard"]); storeAppointmentConfiguration.Programcode = ds.Tables[0].Rows[0]["Programcode"] == DBNull.Value ? string.Empty : Convert.ToString(ds.Tables[0].Rows[0]["Programcode"]); } } } catch (Exception) { throw; } finally { if (conn != null) { conn.Close(); } if (ds != null) { ds.Dispose(); } } return(storeAppointmentConfiguration); }
public int UpdateAppointmentConfiguration(IStoreCampaign Campaign, StoreAppointmentConfiguration storeAppointmentConfiguration, int modifiedBy) { _CampaignRepository = Campaign; return(_CampaignRepository.UpdateAppointmentConfiguration(storeAppointmentConfiguration, modifiedBy)); }