public ActionResult Delete(int id)
        {
            CustomerSupport cs = db.CustomerSupports.Find(id);

            db.CustomerSupports.Remove(cs);
            db.SaveChangesAsync();
            return(RedirectToAction("Index", "CustSupport"));
        }
示例#2
0
        public static IUser Generate(int userType)
        {
            IUser _user;
            if (userType == 1)
                _user = new Administrator();
            else if (userType == 2)
                _user = new CustomerSupport();
            else
                _user = null;

            return _user;
        }
        public ActionResult AddCustomerSupp(CustomerSupport model)
        {
            if (ModelState.IsValid)
            {
                //

                db.CustomerSupports.Add(model);
                db.SaveChanges();
                return(RedirectToAction("CustomerSuppSuccess", new { name = model.Cs_Name, custEmail = model.Cs_Email }));
            }

            return(View(model));
        }
示例#4
0
        public void TracerMobileCustomerSupportEmail(CustomerSupport customerSupport)
        {
            //Insert record to database
            int rowCount = InsertCustomerSupport(customerSupport);


            //Load Email Template
            string TMobileCustomerSupportEmailTo   = ConfigurationManager.AppSettings["TracerMobileCustomerSupportEmailTo"].ToString();
            string TMobileCustomerSupportEmailFrom = ConfigurationManager.AppSettings["TracerMobileCustomerSupportEmailFrom"].ToString();
            string smtpServer = ConfigurationManager.AppSettings["TracerSMTPserver"];
            string subject    = "Customer Support Request From Tracers Mobile App";
            var    nvc        = new NameValueCollection(6);

            nvc["USEREMAIL"]    = customerSupport.Email;
            nvc["USERFULLNAME"] = customerSupport.UserName;
            nvc["USERID"]       = customerSupport.UserID;
            nvc["SITEID"]       = customerSupport.SiteID;
            nvc["HCOID"]        = (customerSupport.HCOID == 0) ? "n/a" : customerSupport.HCOID.ToString();
            nvc["SUBMITTIME"]   = DateTime.Now.ToString(); //customerSupport.SubmitTime;
            nvc["SUBJECT"]      = customerSupport.Subject;
            nvc["PROGRAM"]      = customerSupport.ProgramName;
            nvc["BODY"]         = customerSupport.Body;

            //Create body from template
            string body = EmailServices.LoadEmailTemplate("Support.htm", nvc);

            //Send Email
            //(string to, string cc, string bcc, string replyTo,
            //string subject, string body, string attachment, bool isError, string sMTPServer,
            //string emailUserName, string emailPassword, string emailErrorTo,
            //string emailTestsTo, string emailFrom, int userId, int siteId)

            EmailHelpers.SendSMTPEmail(
                TMobileCustomerSupportEmailTo,
                string.Empty,
                string.Empty,
                customerSupport.Email,
                subject,
                body,
                string.Empty,
                false,
                smtpServer,
                string.Empty,
                string.Empty,
                string.Empty,
                string.Empty,
                TMobileCustomerSupportEmailFrom,
                Convert.ToInt32(customerSupport.UserID),
                Convert.ToInt32(customerSupport.SiteID)
                );
        }
示例#5
0
        public static IUser Generate(int userType)
        {
            IUser _user;

            if (userType == 1)
            {
                _user = new Administrator();
            }
            else if (userType == 2)
            {
                _user = new CustomerSupport();
            }
            else
            {
                _user = null;
            }

            return(_user);
        }
示例#6
0
        public int InsertCustomerSupport(CustomerSupport customerSupport)
        {
            ExceptionLogServices exceptionLog = new ExceptionLogServices();
            int      _result;
            DateTime submitTime = DateTime.Now;
            //=============User for Expection Log=======
            string userId    = customerSupport.UserID;
            string siteId    = customerSupport.SiteID;
            string HCOID     = (customerSupport.HCOID == 0) ? "null" : customerSupport.HCOID.ToString();
            string subject   = customerSupport.Subject;
            string body      = customerSupport.Body;
            string productId = customerSupport.EProductID.ToString();
            string programId = customerSupport.ProgramID.ToString();

            //==========================================
            using (var db = new DBAMPContext())
            {
                try
                {
                    _result = db.ApiInsertCustomerSupport(Convert.ToInt32(customerSupport.UserID),
                                                          Convert.ToInt32(customerSupport.SiteID),
                                                          (customerSupport.HCOID == 0) ? null : customerSupport.HCOID,
                                                          submitTime,
                                                          customerSupport.Subject,
                                                          customerSupport.Body,
                                                          customerSupport.EProductID,
                                                          customerSupport.ProgramID);
                }
                catch (Exception ex)
                {
                    string sqlParam   = "ApiInsertCustomerSupport(" + userId + "," + siteId + "," + HCOID + "," + submitTime.ToString() + "," + subject + "," + body + "," + productId + "," + programId + ")";
                    string methodName = "JCRAPI/Business/CustomerSupportEmailServices/InsertCustomerSupport";
                    exceptionLog.ExceptionLogInsert(ex.Message.ToString(), "", methodName, Convert.ToInt32(userId), Convert.ToInt32(siteId), sqlParam, string.Empty);

                    return(0);
                }
            }

            return(_result);
        }
 public void SetEscalation(CustomerSupport escalatedSupport)
 {
     this._escalatedSupport = escalatedSupport;
 }
 public void SolveBy(CustomerSupport customerSupport)
 {
     this.SolvedBy = customerSupport;
 }