public bool SaveBookAppointment(int appointmentId, AspxCommonInfo aspxCommonObj, BookAnAppointmentCoreInfo obj)
       {
           var isSuccess = false;
           try
           {
               AspxServiceProvider objService = new AspxServiceProvider();
               objService.SaveBookAppointment(appointmentId, aspxCommonObj, obj);
               isSuccess = true;
           }
           catch (Exception)
           {
               isSuccess = false;

           }
           return isSuccess;
       }
Exemplo n.º 2
0
        public bool SaveBookAppointment(int appointmentId, AspxCommonInfo aspxCommonObj, BookAnAppointmentCoreInfo obj)
        {
            var isSuccess = false;

            try
            {
                AspxServiceProvider objService = new AspxServiceProvider();
                objService.SaveBookAppointment(appointmentId, aspxCommonObj, obj);
                isSuccess = true;
            }
            catch (Exception)
            {
                isSuccess = false;
            }
            return(isSuccess);
        }
Exemplo n.º 3
0
        public void SendMailNotificatiion(int storeId, int portalId, string cultureName, BookAnAppointmentCoreInfo objInfo)
        {
            StoreSettingConfig ssc     = new StoreSettingConfig();
            string             logosrc = ssc.GetStoreSettingsByKey(StoreSetting.StoreLogoURL, storeId, portalId, cultureName);
            string             name    = "Appointment Approval - Email";
            List <KeyValuePair <string, object> > parameter = new List <KeyValuePair <string, object> >();

            parameter.Add(new KeyValuePair <string, object>("PortalID", portalId));
            parameter.Add(new KeyValuePair <string, object>("CultureName", cultureName));
            parameter.Add(new KeyValuePair <string, object>("MessageTemplateTypeName", name));
            OracleHandler sql = new OracleHandler();

            int messageTemplateTypeId = sql.ExecuteNonQuery("usp_Aspx_GetMessageTemplateTypeID", parameter, "MessageTemplateID");
            MessageManagementController msgController = new MessageManagementController();
            var template = msgController.GetMessageTemplate(messageTemplateTypeId, portalId);

            string messageTemplate = template.Body;
            string src             = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";

            string receiverEmailID = objInfo.Email;
            string subject         = template.Subject;
            string senderEmail     = template.MailFrom;
            var    headerMsg       = string.Empty;
            var    customMessage   = "";

            if (objInfo.AppointmentID > 0)
            {
                headerMsg = "status has been modified as follow.";
            }
            else if (objInfo.AppointmentID == 0)
            {
                headerMsg = "has been scheduled as following date and time.";
            }
            if (template != null)
            {
                string[] tokens = GetAllToken(messageTemplate);
                foreach (var token in tokens)
                {
                    switch (token)
                    {
                    case "%LogoSource%":
                        string imgSrc = src + logosrc;
                        messageTemplate = messageTemplate.Replace(token, imgSrc);
                        break;

                    case "%DateTime%":
                        messageTemplate = messageTemplate.Replace(token, DateTime.Now.ToString("MM/dd/yyyy"));
                        break;

                    case "%PreferredDate%":
                        messageTemplate = messageTemplate.Replace(token, objInfo.PreferredDate.ToString("MM/dd/yyyy"));
                        break;

                    case "%PreferredTime%":
                        messageTemplate = messageTemplate.Replace(token, objInfo.PreferredTime);
                        break;

                    case "%PreferredTimeInterval%":
                        messageTemplate = messageTemplate.Replace(token, objInfo.PreferredTimeInterval);
                        break;

                    case "%AppointmentStatus%":
                        messageTemplate = messageTemplate.Replace(token, objInfo.AppointmentStatusName);
                        break;

                    case "%ServerPath%":
                        messageTemplate = messageTemplate.Replace(token, src);
                        break;

                    case "%DateYear%":
                        messageTemplate = messageTemplate.Replace(token, System.DateTime.Now.Year.ToString());
                        break;

                    case "%AppointmentHeadingMessage%":
                        messageTemplate = messageTemplate.Replace(token, headerMsg);
                        break;

                    case "%AppointmentCustomMessage%":
                        messageTemplate = messageTemplate.Replace(token, customMessage);
                        break;

                    case "%ServiceProductName%":
                        messageTemplate = messageTemplate.Replace(token, objInfo.ServiceProductName);
                        break;
                    }
                }
            }

            SageFrameConfig pagebase        = new SageFrameConfig();
            string          emailSuperAdmin = pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserEmail);
            string          emailSiteAdmin  = pagebase.GetSettingsByKey(SageFrameSettingKeys.SiteAdminEmailAddress);

            MailHelper.SendMailNoAttachment(senderEmail, receiverEmailID, subject, messageTemplate, emailSiteAdmin, emailSuperAdmin);
        }
Exemplo n.º 4
0
        public bool SaveBookAppointment(int appointmentId, AspxCommonInfo aspxCommonObj, BookAnAppointmentCoreInfo obj)//upto this 1/13/2013
        {
            var isSuccess = false;

            try
            {
                List <KeyValuePair <string, object> > parameter = CommonParmBuilder.GetParamSPC(aspxCommonObj);
                parameter.Add(new KeyValuePair <string, object>("AppointmentID", appointmentId));
                parameter.Add(new KeyValuePair <string, object>("OrderID", obj.OrderID));
                parameter.Add(new KeyValuePair <string, object>("ServiceCategoryID", obj.ServiceCategoryID));
                parameter.Add(new KeyValuePair <string, object>("ServiceProductID", obj.ServiceProductID));
                parameter.Add(new KeyValuePair <string, object>("ServiceProductPrice", obj.ServiceProductPrice));
                parameter.Add(new KeyValuePair <string, object>("AppointmentStatusID", obj.AppointmentStatusID));
                parameter.Add(new KeyValuePair <string, object>("Title", obj.Title));
                parameter.Add(new KeyValuePair <string, object>("FirstName", obj.FirstName));
                parameter.Add(new KeyValuePair <string, object>("LastName", obj.LastName));
                parameter.Add(new KeyValuePair <string, object>("Gender", obj.Gender));
                parameter.Add(new KeyValuePair <string, object>("Mobile", obj.MobileNumber));
                parameter.Add(new KeyValuePair <string, object>("Phone", obj.PhoneNumber));
                parameter.Add(new KeyValuePair <string, object>("Email", obj.Email));
                parameter.Add(new KeyValuePair <string, object>("PreferredDateID", obj.ServiceDateId));
                parameter.Add(new KeyValuePair <string, object>("PreferredDate", obj.PreferredDate));
                parameter.Add(new KeyValuePair <string, object>("PreferredTime", obj.PreferredTime));
                parameter.Add(new KeyValuePair <string, object>("TypeOfTreatment", obj.TypeOfTreatment));
                parameter.Add(new KeyValuePair <string, object>("StoreLocation", obj.StoreLocation));
                parameter.Add(new KeyValuePair <string, object>("CustomerType", obj.TypeOfCustomer));
                parameter.Add(new KeyValuePair <string, object>("MembershipElite", obj.MembershipElite));
                parameter.Add(new KeyValuePair <string, object>("UserName", obj.UserName));
                parameter.Add(new KeyValuePair <string, object>("PaymentMethodID", obj.PaymentMethodID));
                parameter.Add(new KeyValuePair <string, object>("PreferredTimeInterval", obj.PreferredTimeInterval));
                parameter.Add(new KeyValuePair <string, object>("PreferredTimeID", obj.PreferredTimeId));
                parameter.Add(new KeyValuePair <string, object>("EmployeeID", obj.EmployeeID));
                OracleHandler sqlh = new OracleHandler();
                sqlh.ExecuteNonQuery("usp_Aspx_AddAppointment", parameter);

                if (appointmentId != 0 && obj.AppointmentStatusName.ToLower() == "completed")
                {
                    SendMailNotificatiion(aspxCommonObj.StoreID, aspxCommonObj.PortalID, aspxCommonObj.CultureName, obj);
                }
                else if (appointmentId == 0 && obj.AppointmentStatusName.ToLower() == "pending")
                {
                    SendMailNotificatiion(aspxCommonObj.StoreID, aspxCommonObj.PortalID, aspxCommonObj.CultureName, obj);
                }
                isSuccess = true;
            }
            catch (Exception)
            {
                isSuccess = false;
                // throw ex;
            }
            return(isSuccess);
        }
       public void SendMailNotificatiion(int storeId, int portalId, string cultureName, BookAnAppointmentCoreInfo objInfo)
       {
           StoreSettingConfig ssc = new StoreSettingConfig();
           string logosrc = ssc.GetStoreSettingsByKey(StoreSetting.StoreLogoURL, storeId, portalId, cultureName);
           string name = "Appointment Approval - Email";
           List<KeyValuePair<string, object>> parameter = new List<KeyValuePair<string, object>>();
           parameter.Add(new KeyValuePair<string, object>("@PortalID", portalId));
           parameter.Add(new KeyValuePair<string, object>("@CultureName", cultureName));
           parameter.Add(new KeyValuePair<string, object>("@MessageTemplateTypeName", name));
           SQLHandler sql = new SQLHandler();

           int messageTemplateTypeId = sql.ExecuteNonQuery("[dbo].[usp_Aspx_GetMessageTemplateTypeID]", parameter, "@MessageTemplateID");
           MessageManagementController msgController = new MessageManagementController();
           var template = msgController.GetMessageTemplate(messageTemplateTypeId, portalId);

           string messageTemplate = template.Body;
           string src = HttpContext.Current.Request.ServerVariables["SERVER_NAME"] + "/";

           string receiverEmailID = objInfo.Email;
           string subject = template.Subject;
           string senderEmail = template.MailFrom;
           var headerMsg = string.Empty;
           var customMessage = "";
           if (objInfo.AppointmentID > 0)
           {
               headerMsg = "status has been modified as follow.";
           }
           else if (objInfo.AppointmentID == 0)
           {
               headerMsg = "has been scheduled as following date and time.";
           }
           if (template != null)
           {
               string[] tokens = GetAllToken(messageTemplate);
               foreach (var token in tokens)
               {
                   switch (token)
                   {
                       case "%LogoSource%":
                           string imgSrc = src + logosrc;
                           messageTemplate = messageTemplate.Replace(token, imgSrc);
                           break;
                       case "%DateTime%":
                           messageTemplate = messageTemplate.Replace(token, DateTime.Now.ToString("MM/dd/yyyy"));
                           break;
                       case "%PreferredDate%":
                           messageTemplate = messageTemplate.Replace(token, objInfo.PreferredDate.ToString("MM/dd/yyyy"));
                           break;
                       case "%PreferredTime%":
                           messageTemplate = messageTemplate.Replace(token, objInfo.PreferredTime);
                           break;
                       case "%PreferredTimeInterval%":
                           messageTemplate = messageTemplate.Replace(token, objInfo.PreferredTimeInterval);
                           break;
                       case "%AppointmentStatus%":
                           messageTemplate = messageTemplate.Replace(token, objInfo.AppointmentStatusName);
                           break;
                       case "%ServerPath%":
                           messageTemplate = messageTemplate.Replace(token, src);
                           break;
                       case "%DateYear%":
                           messageTemplate = messageTemplate.Replace(token, System.DateTime.Now.Year.ToString());
                           break;
                       case "%AppointmentHeadingMessage%":
                           messageTemplate = messageTemplate.Replace(token, headerMsg);
                           break;
                       case "%AppointmentCustomMessage%":
                           messageTemplate = messageTemplate.Replace(token, customMessage);
                           break;
                       case "%ServiceProductName%":
                           messageTemplate = messageTemplate.Replace(token, objInfo.ServiceProductName);
                           break;
                   }
               }
           }

           SageFrameConfig pagebase = new SageFrameConfig();
           string emailSuperAdmin = pagebase.GetSettingsByKey(SageFrameSettingKeys.SuperUserEmail);
           string emailSiteAdmin = pagebase.GetSettingsByKey(SageFrameSettingKeys.SiteAdminEmailAddress);

           MailHelper.SendMailNoAttachment(senderEmail, receiverEmailID, subject, messageTemplate, emailSiteAdmin, emailSuperAdmin);
       }
       public bool SaveBookAppointment(int appointmentId, AspxCommonInfo aspxCommonObj, BookAnAppointmentCoreInfo obj)//upto this 1/13/2013
       {
           var isSuccess = false;
           try
           {
               List<KeyValuePair<string, object>> parameter = CommonParmBuilder.GetParamSPC(aspxCommonObj);
               parameter.Add(new KeyValuePair<string, object>("@AppointmentID", appointmentId));
               parameter.Add(new KeyValuePair<string, object>("@OrderID", obj.OrderID));
               parameter.Add(new KeyValuePair<string, object>("@ServiceCategoryID", obj.ServiceCategoryID));
               parameter.Add(new KeyValuePair<string, object>("@ServiceProductID", obj.ServiceProductID));
               parameter.Add(new KeyValuePair<string, object>("@ServiceProductPrice", obj.ServiceProductPrice));
               parameter.Add(new KeyValuePair<string, object>("@AppointmentStatusID", obj.AppointmentStatusID));
               parameter.Add(new KeyValuePair<string, object>("@Title", obj.Title));
               parameter.Add(new KeyValuePair<string, object>("@FirstName", obj.FirstName));
               parameter.Add(new KeyValuePair<string, object>("@LastName", obj.LastName));
               parameter.Add(new KeyValuePair<string, object>("@Gender", obj.Gender));
               parameter.Add(new KeyValuePair<string, object>("@Mobile", obj.MobileNumber));
               parameter.Add(new KeyValuePair<string, object>("@Phone", obj.PhoneNumber));
               parameter.Add(new KeyValuePair<string, object>("@Email", obj.Email));
               parameter.Add(new KeyValuePair<string, object>("@PreferredDateID", obj.ServiceDateId));
               parameter.Add(new KeyValuePair<string, object>("@PreferredDate", obj.PreferredDate));
               parameter.Add(new KeyValuePair<string, object>("@PreferredTime", obj.PreferredTime));
               parameter.Add(new KeyValuePair<string, object>("@TypeOfTreatment", obj.TypeOfTreatment));
               parameter.Add(new KeyValuePair<string, object>("@StoreLocation", obj.StoreLocation));
               parameter.Add(new KeyValuePair<string, object>("@CustomerType", obj.TypeOfCustomer));
               parameter.Add(new KeyValuePair<string, object>("@MembershipElite", obj.MembershipElite));
               parameter.Add(new KeyValuePair<string, object>("@UserName", obj.UserName));
               parameter.Add(new KeyValuePair<string, object>("@PaymentMethodID", obj.PaymentMethodID));
               parameter.Add(new KeyValuePair<string, object>("@PreferredTimeInterval", obj.PreferredTimeInterval));
               parameter.Add(new KeyValuePair<string, object>("@PreferredTimeID", obj.PreferredTimeId));
               parameter.Add(new KeyValuePair<string, object>("@EmployeeID", obj.EmployeeID));
               SQLHandler sqlh = new SQLHandler();
               sqlh.ExecuteNonQuery("[dbo].[usp_Aspx_AddAppointment]", parameter);

               if (appointmentId != 0 && obj.AppointmentStatusName.ToLower() == "completed")
               {
                   SendMailNotificatiion(aspxCommonObj.StoreID, aspxCommonObj.PortalID, aspxCommonObj.CultureName, obj);
               }
               else if (appointmentId == 0 && obj.AppointmentStatusName.ToLower() == "pending")
               {
                   SendMailNotificatiion(aspxCommonObj.StoreID, aspxCommonObj.PortalID, aspxCommonObj.CultureName, obj);
               }
               isSuccess = true;
           }
           catch (Exception)
           {
               isSuccess = false;
               // throw ex;

           }
           return isSuccess;
       }