예제 #1
0
        public ActionResult Edit(int id)
        {
            try
            {
                ViewBag.Saved = false;
                Models.StayCategoryModels mStayCategory = new StayCategoryModels()
                {
                    CategoryId = 0
                };


                CLayer.StayCategory staycategory = BLayer.StayCategory.Get(id);

                if (staycategory != null)
                {
                    mStayCategory = new StayCategoryModels()
                    {
                        CategoryId = staycategory.CategoryId, Title = staycategory.Title
                    }
                }
                ;

                return(PartialView("_Edit", mStayCategory));
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
                return(Redirect("~/Admin/ErrorPage"));
            }
        }
예제 #2
0
 public static CLayer.StayCategory Get(int CategoryID)
 {
     DataLayer.StayCategory staycategoryG = new DataLayer.StayCategory();
     CLayer.StayCategory    staycategory  = new CLayer.StayCategory();
     staycategory = staycategoryG.Get(CategoryID);
     return(staycategory);
 }
예제 #3
0
        public ActionResult Edit(Models.StayCategoryModels data)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    CLayer.StayCategory staycategory = new CLayer.StayCategory()
                    {
                        CategoryId = data.CategoryId,
                        Title      = data.Title
                    };
                    BLayer.StayCategory.Save(staycategory);

                    ViewBag.Saved = true;
                }
                else
                {
                    ViewBag.Saved = false;
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
                return(Redirect("~/Admin/ErrorPage"));
            }
        }
예제 #4
0
        public static int Save(CLayer.StayCategory staycategory)
        {
            DataLayer.StayCategory staycategoryS = new DataLayer.StayCategory();
            staycategory.Validate();
            int result = staycategoryS.Save(staycategory);

            return(result);
        }
예제 #5
0
        public int Save(CLayer.StayCategory staycategory)
        {
            List <DataPlug.Parameter> param = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pCategoryId", DataPlug.DataType._BigInt, staycategory.CategoryId));
            param.Add(Connection.GetParameter("pTitle", DataPlug.DataType._Varchar, staycategory.Title));
            int result = Connection.ExecuteQuery("staycategory_Save", param);

            return(result);
        }
예제 #6
0
        public CLayer.StayCategory Get(int CategoryID)
        {
            CLayer.StayCategory       staycategory = null;
            List <DataPlug.Parameter> param        = new List <DataPlug.Parameter>();

            param.Add(Connection.GetParameter("pCategoryId", DataPlug.DataType._BigInt, CategoryID));
            DataTable dt = Connection.GetTable("staycategory_Get", param);

            if (dt.Rows.Count > 0)
            {
                staycategory            = new CLayer.StayCategory();
                staycategory.CategoryId = Connection.ToLong(dt.Rows[0]["CategoryId"]);
                staycategory.Title      = Connection.ToString(dt.Rows[0]["Title"]);
            }
            return(staycategory);
        }
예제 #7
0
        public async Task <bool> ResendemailSGST(long OfflineBookingId, long BookingDetailsId, string key)
        {
            try
            {
                string lck = BLayer.Settings.GetValue(CLayer.Settings.PUBLIC_PAGE_LOCK);
                if (key != lck)
                {
                    return(true);
                }



                if (OfflineBookingId < 1)
                {
                    return(false);
                }
                CLayer.OfflineBooking Offlinedata         = BLayer.OfflineBooking.GetAllDetailsById(OfflineBookingId);
                CLayer.OfflineBooking OfflinePropertydata = BLayer.OfflineBooking.GetAllpropertyDetails(OfflineBookingId);
                CLayer.OfflineBooking CustomerDetails     = BLayer.OfflineBooking.GetAllCustomerDetails(OfflineBookingId);

                if (CustomerDetails == null)
                {
                    return(false);
                }
                if (OfflinePropertydata == null)
                {
                    return(false);
                }

                CLayer.StayCategory      Staycategorydetails      = BLayer.StayCategory.Get(Convert.ToInt32(Offlinedata.StayCategoryid));
                CLayer.AccommodationType AccommodationTypedetails = BLayer.AccommodationType.Get(Convert.ToInt32(Offlinedata.Accommodationtypeid));

                CLayer.Role.Roles rle = BLayer.User.GetRole(Offlinedata.CustomerId);

                string        message = "";
                Common.Mailer ml      = new Common.Mailer();

                if (OfflineBookingId < 1)
                {
                    return(false);
                }
                try
                {
                    if (OfflinePropertydata.PropertyEmail != "")
                    {
                        message = await Common.Mailer.MessageFromHtml(System.Configuration.ConfigurationManager.AppSettings.Get("SupplierIntemationOfflineBookGST") + OfflineBookingId.ToString() + "&key=" + BLayer.Settings.GetValue(CLayer.Settings.PUBLIC_PAGE_LOCK) + "&BookingDetailsId=" + BookingDetailsId);

                        System.Net.Mail.MailMessage supplierMsg = new System.Net.Mail.MailMessage();

                        string BccEmailsforsupp = BLayer.Settings.GetValue(CLayer.Settings.CC_SUPPLIERCOMMUNICATION);
                        if (BccEmailsforsupp != "")
                        {
                            string[] emails = BccEmailsforsupp.Split(',');
                            for (int i = 0; i < emails.Length; ++i)
                            {
                                supplierMsg.Bcc.Add(emails[i]);
                            }
                        }

                        supplierMsg.Subject = "Booking Confirmation";
                        supplierMsg.Body    = message;

                        if (OfflinePropertydata.PropertyEmail != "")
                        {
                            supplierMsg.To.Add(OfflinePropertydata.PropertyEmail);
                        }
                        supplierMsg.IsBodyHtml = true;

                        try
                        {
                            await ml.SendMailAsync(supplierMsg, Common.Mailer.MailType.Reservation);
                        }
                        catch (Exception ex)
                        {
                            Common.LogHandler.HandleError(ex);
                        }
                    }
                }
                catch (Exception ex)
                {
                    Common.LogHandler.HandleError(ex);
                }
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
            }
            return(true);
        }
예제 #8
0
        public async Task <bool> ResendemailC(long OfflineBookingId)
        {
            return(true);

            try
            {
                if (OfflineBookingId < 1)
                {
                    return(false);
                }
                CLayer.OfflineBooking Offlinedata         = BLayer.OfflineBooking.GetAllDetailsById(OfflineBookingId);
                CLayer.OfflineBooking OfflinePropertydata = BLayer.OfflineBooking.GetAllpropertyDetails(OfflineBookingId);
                CLayer.OfflineBooking CustomerDetails     = BLayer.OfflineBooking.GetAllCustomerDetails(OfflineBookingId);

                if (CustomerDetails == null)
                {
                    return(false);
                }
                if (OfflinePropertydata == null)
                {
                    return(false);
                }

                CLayer.StayCategory      Staycategorydetails      = BLayer.StayCategory.Get(Convert.ToInt32(Offlinedata.StayCategoryid));
                CLayer.AccommodationType AccommodationTypedetails = BLayer.AccommodationType.Get(Convert.ToInt32(Offlinedata.Accommodationtypeid));

                CLayer.Role.Roles rle = BLayer.User.GetRole(Offlinedata.CustomerId);

                string        message = "";
                Common.Mailer ml      = new Common.Mailer();

                string link = System.Configuration.ConfigurationManager.AppSettings.Get("OfflineBookingConfirmation") + OfflineBookingId.ToString() + "&key=" + BLayer.Settings.GetValue(CLayer.Settings.PUBLIC_PAGE_LOCK);
                //for normal user mail body
                message = await Common.Mailer.MessageFromHtml(link);

                System.Net.Mail.MailMessage customerMsg = new System.Net.Mail.MailMessage();
                //guest mail added
                customerMsg.To.Add(CustomerDetails.CustomerEmail);

                string BccEmailsforcususer = BLayer.Settings.GetValue(CLayer.Settings.CC_CUSTOMERCOMMUNICATION);
                if (BccEmailsforcususer != "")
                {
                    string[] emails = BccEmailsforcususer.Split(',');
                    for (int i = 0; i < emails.Length; ++i)
                    {
                        customerMsg.Bcc.Add(emails[i]);
                    }
                }
                customerMsg.Subject = "Booking Confirmation";
                customerMsg.Body    = message;

                customerMsg.IsBodyHtml = true;
                try
                {
                    await ml.SendMailAsync(customerMsg, Common.Mailer.MailType.Reservation);
                }
                catch (Exception ex)
                {
                    Common.LogHandler.HandleError(ex);
                }
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
            }
            return(true);
        }
예제 #9
0
        public async Task <bool> OfflineBookingConfirmGST(long OfflineBookId, long BookingDetailsId, string GuestEmail)
        {
            try
            {
                if (OfflineBookId < 1)
                {
                    return(false);
                }
                if (BookingDetailsId < 1)
                {
                    return(false);
                }
                CLayer.OfflineBooking Offlinedata = BLayer.OfflineBooking.GetAllDetailsById(OfflineBookId);

                CLayer.OfflineBooking OfflinePropertydata = BLayer.OfflineBooking.GetAllpropertyDetails(OfflineBookId);

                CLayer.OfflineBooking CustomerDetails = BLayer.OfflineBooking.GetAllCustomerDetails(OfflineBookId);

                if (CustomerDetails == null)
                {
                    return(false);
                }
                if (OfflinePropertydata == null)
                {
                    return(false);
                }

                CLayer.StayCategory      Staycategorydetails      = BLayer.StayCategory.Get(Convert.ToInt32(Offlinedata.StayCategoryid));
                CLayer.AccommodationType AccommodationTypedetails = BLayer.AccommodationType.Get(Convert.ToInt32(Offlinedata.Accommodationtypeid));

                CLayer.Role.Roles rle = BLayer.User.GetRole(Offlinedata.CustomerId);

                string        message = "";
                Common.Mailer ml      = new Common.Mailer();

                try
                {
                    #region Repeat portion

                    //List<CLayer.OfflineBooking> BListGST = BLayer.OfflineBooking.GetMultipleBookingDetailsGST(OfflineBookId);
                    //foreach (CLayer.OfflineBooking dt in BListGST)
                    //{

                    System.Net.Mail.MailMessage customerMsg = new System.Net.Mail.MailMessage();
                    //customerMsg.To.Add(CustomerDetails.CustomerEmail);
                    string BccEmailsforcususer = BLayer.Settings.GetValue(CLayer.Settings.CC_CUSTOMERCOMMUNICATION);
                    if (BccEmailsforcususer.Trim() != "")
                    {
                        string[] emails = Common.Utils.SplitEmails(BccEmailsforcususer);
                        //BccEmailsforcususer.Split(',');
                        for (int i = 0; i < emails.Length; ++i)
                        {
                            customerMsg.CC.Add(emails[i]);
                        }
                    }


                    customerMsg.Subject    = "CHECK-IN REMINDER";
                    customerMsg.IsBodyHtml = true;

                    if (GuestEmail != null)
                    {
                        if (GuestEmail != null && GuestEmail != "")
                        {
                            string[] emails = Common.Utils.SplitEmails(GuestEmail);
                            for (int i = 0; i < emails.Length; ++i)
                            {
                                customerMsg.To.Add(emails[i]);
                            }
                        }
                    }

                    string link = System.Configuration.ConfigurationManager.AppSettings.Get("OfflineBookingConfirmationBeforeCheckin") + OfflineBookId.ToString() + "&BookingDetailsId=" + BookingDetailsId + "&key=" + BLayer.Settings.GetValue(CLayer.Settings.PUBLIC_PAGE_LOCK);
                    message = await Common.Mailer.MessageFromHtml(link);

                    customerMsg.Body = message;



                    //Select Distinct Mail address in To mails

                    System.Net.Mail.MailAddress[] DistinctTo = customerMsg.To.Distinct().ToArray();
                    customerMsg.To.Clear();
                    for (int i = 0; i < DistinctTo.Length; ++i)
                    {
                        customerMsg.To.Add(DistinctTo[i]);
                    }

                    //Select Distinct Mail address in CC mails

                    System.Net.Mail.MailAddress[] DistinctCC = customerMsg.CC.Distinct().Except(DistinctTo).ToArray();
                    customerMsg.CC.Clear();
                    for (int i = 0; i < DistinctCC.Length; ++i)
                    {
                        customerMsg.CC.Add(DistinctCC[i]);
                    }



                    try
                    {
                        await ml.SendMailAsync(customerMsg, Common.Mailer.MailType.Reservation);
                    }
                    catch (Exception ex)
                    {
                        Common.LogHandler.HandleError(ex);
                    }

                    //}
                    #endregion
                }
                catch (Exception ex)
                {
                    Common.LogHandler.HandleError(ex);
                }
            }
            catch (Exception ex)
            {
                Common.LogHandler.HandleError(ex);
            }

            return(true);
        }