/// <summary>
        /// Insert/ Update HSTimeSlotMaster
        /// </summary>
        /// <param name="StoreTimeSlotInsertUpdate"></param>
        /// <returns></returns>
        ///
        public int InsertUpdateTimeSlotMaster(StoreTimeSlotInsertUpdate Slot)
        {
            int Result = 0;

            try
            {
                if (conn != null && conn.State == ConnectionState.Closed)
                {
                    conn.Open();
                }


                MySqlCommand cmd = new MySqlCommand("SP_HSInsertUpdateHSStoreTimeSlotMaster", conn);
                cmd.Connection = conn;
                cmd.Parameters.AddWithValue("@_SlotId", Slot.SlotId);
                cmd.Parameters.AddWithValue("@_TenantId", Slot.TenantId);
                cmd.Parameters.AddWithValue("@_StoreId", Slot.StoreId);
                cmd.Parameters.AddWithValue("@_ProgramCode", Slot.ProgramCode);
                cmd.Parameters.AddWithValue("@_TimeSlot", string.IsNullOrEmpty(Slot.TimeSlot) ? "" :Slot.TimeSlot);
                cmd.Parameters.AddWithValue("@_MaxCapacity", Slot.MaxCapacity);
                cmd.Parameters.AddWithValue("@_OrderNo", Slot.OrderNumber);
                cmd.Parameters.AddWithValue("@_CreatedBy", Slot.CreatedBy);
                cmd.Parameters.AddWithValue("@_ModifyBy", Slot.ModifyBy);

                cmd.CommandType = CommandType.StoredProcedure;
                Result          = Convert.ToInt32(cmd.ExecuteScalar());
                conn.Close();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                if (conn != null)
                {
                    conn.Close();
                }
            }

            return(Result);
        }
Пример #2
0
        public ResponseModel InsertUpdateTimeSlotMaster([FromBody] StoreTimeSlotInsertUpdate Slot)
        {
            List <AlreadyScheduleDetail> alreadyScheduleDetails = new List <AlreadyScheduleDetail>();
            ResponseModel objResponseModel = new ResponseModel();
            int           statusCode = 0; int ResultCount = 0;
            string        statusMessage = "";

            try
            {
                string       token        = Convert.ToString(Request.Headers["X-Authorized-Token"]);
                Authenticate authenticate = new Authenticate();
                authenticate = SecurityService.GetAuthenticateDataFromToken(_radisCacheServerAddress, SecurityService.DecryptStringAES(token));

                Slot.TenantId    = authenticate.TenantId;
                Slot.ProgramCode = authenticate.ProgramCode;
                Slot.CreatedBy   = authenticate.UserMasterID;
                Slot.ModifyBy    = authenticate.UserMasterID;

                AppointmentCaller newAppointment = new AppointmentCaller();

                ResultCount = newAppointment.InsertUpdateTimeSlotMaster(new AppointmentServices(_connectioSting), Slot);

                statusCode = ResultCount.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 = ResultCount;
            }
            catch (Exception)
            {
                throw;
            }
            return(objResponseModel);
        }
Пример #3
0
 public int InsertUpdateTimeSlotMaster(IAppointment appointment, StoreTimeSlotInsertUpdate Slot)
 {
     _AppointmentRepository = appointment;
     return(_AppointmentRepository.InsertUpdateTimeSlotMaster(Slot));
 }