コード例 #1
0
        public bool IsAllowedActionOnEntity(string actionCode, EntityTypeGUIDRecordUIDPair entityTypeUID)
        {
            if (_isSystemAdmin)
            {
                return(true);
            }

            int allow  = 0;
            int retVal = ActionProcedures.CanUserExecActionOnEntity(entityTypeUID.EntityTypeGUID, entityTypeUID.RecordUID, _uid, actionCode, ref allow);

            if (allow == 1)
            {
                return(true);
            }

            //TODO, Make this a global settable flag.
            bool NotSetWillAllow = true;

            //If the value returned is not set, we chekc the gloabl flag to find out if user is allowed or not
            if (allow == -1)
            {
                if (NotSetWillAllow)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }

            return(false);
        }
コード例 #2
0
 public int AddSeason(MvSeason season)
 {
     seasonId = 0;
     ActionProcedures.SpSeasonIns(JsonConvert.SerializeObject(season, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }), ref seasonId);
     return(seasonId);
 }
コード例 #3
0
 public int AddRoom(MvRoom room)
 {
     roomId = 0;
     ActionProcedures.SpRoomIns(JsonConvert.SerializeObject(room, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }), ref roomId);
     return(roomId);
 }
コード例 #4
0
 public int AddReservation(MvReservation reservation)
 {
     reservationId = 0;
     ActionProcedures.SpReservationIns(JsonConvert.SerializeObject(reservation, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }), ref reservationId);
     return(reservationId);
 }
コード例 #5
0
 public int AddServiceCategory(MvServiceCategory serviceCategory)
 {
     serviceCategoryId = 0;
     ActionProcedures.SpServiceCategoryIns(JsonConvert.SerializeObject(serviceCategory, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }), ref serviceCategoryId);
     return(serviceCategoryId);
 }
コード例 #6
0
 public int AddHotel(MvHotel hotel)
 {
     hotelId = 0;
     ActionProcedures.SpHotelIns(JsonConvert.SerializeObject(hotel, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }), ref hotelId);
     return(hotelId);
 }
コード例 #7
0
        public bool SaveEventAffiliate(long eventCustomerId, long?callId)
        {
            long returnParameter = 0;
            var  returnValue     =
                ActionProcedures.SaveEventAffiliate(eventCustomerId, callId.HasValue ? callId.Value : 0,
                                                    ref returnParameter);

            return(true);
        }
コード例 #8
0
        public string AddCustomer(MvCustomer customer)
        {
            string json = string.Empty;

            ActionProcedures.SpCustomerIns(JsonConvert.SerializeObject(customer, new JsonSerializerSettings {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            }), ref json);
            return(json);
        }
コード例 #9
0
        public string AddBooking(MvBooking booking)
        {
            string json = string.Empty;

            ActionProcedures.SpBookingIns(JsonConvert.SerializeObject(booking, new JsonSerializerSettings {
                ContractResolver = new CamelCasePropertyNamesContractResolver()
            }), ref json);
            return(json);
        }
コード例 #10
0
ファイル: SystemManager.cs プロジェクト: alanschrank/HnD
        /// <summary>
        /// Initializes the system, by running a stored procedure passing in the new admin password.
        /// </summary>
        /// <param name="newAdminPassword"></param>
        /// <param name="emailAddress"></param>
        /// <returns></returns>
        public static async Task Initialize(string newAdminPassword, string emailAddress)
        {
            if (string.IsNullOrWhiteSpace(newAdminPassword))
            {
                return;
            }

            var passwordHashed = HnDGeneralUtils.HashPassword(newAdminPassword, performPreMD5Hashing: true);

            using (var adapter = new DataAccessAdapter())
            {
                await ActionProcedures.InstallAsync(emailAddress, passwordHashed, adapter, CancellationToken.None);

                CacheController.PurgeResultsets(CacheKeys.AnonymousUserQueryResultset);
            }
        }
コード例 #11
0
 public void EditServiceCategory(MvServiceCategory serviceCategory)
 {
     ActionProcedures.SpServiceCategoryUpd(JsonConvert.SerializeObject(serviceCategory, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }));
 }
コード例 #12
0
 public void EditCustomer(MvCustomer customer)
 {
     ActionProcedures.SpCustomerUpd(JsonConvert.SerializeObject(customer, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }));
 }
コード例 #13
0
 public void DeleteServiceCategory(int serviceCategoryId)
 {
     ActionProcedures.SpServiceCategoryDel(serviceCategoryId);
 }
コード例 #14
0
 public void DeleteHotel(int hotelId)
 {
     ActionProcedures.SpHotelDel(hotelId);
 }
コード例 #15
0
 public void EditReservation(MvReservation reservation)
 {
     ActionProcedures.SpReservationUpd(JsonConvert.SerializeObject(reservation, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }));
 }
コード例 #16
0
 public void DeleteSeason(int seasonId)
 {
     ActionProcedures.SpSeasonDel(seasonId);
 }
コード例 #17
0
 public void DeleteService(int serviceId)
 {
     ActionProcedures.SpServiceDel(serviceId);
 }
コード例 #18
0
 public void DeleteCustomer(int customerId)
 {
     ActionProcedures.SpCustomerDel(customerId);
 }
コード例 #19
0
 public void DeleteRoom(int roomId)
 {
     ActionProcedures.SpRoomDel(roomId);
 }
コード例 #20
0
 public void EditRoom(MvRoom room)
 {
     ActionProcedures.SpRoomUpd(JsonConvert.SerializeObject(room, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }));
 }
コード例 #21
0
 public void EditBranch(MvBranch branch)
 {
     ActionProcedures.SpBranchUpd(JsonConvert.SerializeObject(branch, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }));
 }
コード例 #22
0
 public void DeleteBranch(int branchId)
 {
     ActionProcedures.SpBranchDel(branchId);
 }
コード例 #23
0
 public void DeleteBooking(int bookingId)
 {
     ActionProcedures.SpBookingDel(bookingId);
 }
コード例 #24
0
 public void DeleteReservation(int reservationId)
 {
     ActionProcedures.SpReservationDel(reservationId);
 }
コード例 #25
0
 public void EditBooking(MvBooking booking)
 {
     ActionProcedures.SpBookingUpd(JsonConvert.SerializeObject(booking, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }));
 }
コード例 #26
0
 public void EditHotel(MvHotel hotel)
 {
     ActionProcedures.SpHotelUpd(JsonConvert.SerializeObject(hotel, new JsonSerializerSettings {
         ContractResolver = new CamelCasePropertyNamesContractResolver()
     }));
 }