Esempio n. 1
0
        public override void Run()
        {
            if (this.IsShuttingDown || this.Pause)
            {
                return;
            }
            try
            {
                string         userName     = WebConfigurationManager.AppSettings["UserNameSMS"];
                string         password     = WebConfigurationManager.AppSettings["PasswordSMS"];
                string         NumberSMS    = WebConfigurationManager.AppSettings["NumberSMS"];
                string         PhoneManager = WebConfigurationManager.AppSettings["PhoneManager"];
                SendSoapClient client       = new SendSoapClient();

                var address = HostingEnvironment.MapPath("~/App_Data/ErrorsLog/");

                int fxmlCount = Directory.GetFiles(address, @"*.xml",
                                                   SearchOption.TopDirectoryOnly).Length;

                if (fxmlCount > 30)
                {
                    string resultSMS = client.SendSimpleSMS2(userName, password, PhoneManager, NumberSMS, string.Format("فناوران اطلاعات ارم وب / {0} خطا در سیستم ثبت شده است نسبت به رفع آن و حذف خطا اقدام نماید", fxmlCount.ToString()), false);
                }
                else if (fxmlCount > 40)
                {
                    string resultSMS = client.SendSimpleSMS2(userName, password, PhoneManager, NumberSMS, string.Format(" فناوران اطلاعات ارم وب / {0} خطا در سیتم ثبت شده در صورت پاک نکردن خطا ها سیستم با هنگی مواجه می شود", fxmlCount.ToString()), false);
                }
            }
            catch
            {
            }
        }
Esempio n. 2
0
        public virtual ActionResult SendMessage(SendSMSProfileViewModel model)
        {
            try
            {
                string userName  = WebConfigurationManager.AppSettings["UserNameSMS"];
                string password  = WebConfigurationManager.AppSettings["PasswordSMS"];
                string NumberSMS = WebConfigurationManager.AppSettings["NumberSMS"];

                SendSoapClient client = new SendSoapClient();
                string         result = client.SendSimpleSMS2(userName, password, model.Phone, NumberSMS, model.Explain, false);
                return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                {
                    Alert = AlertOperation.SurveyOperation(StatusOperation.SuccessSend),
                    Status = AlertMode.success
                }));
            }
            catch
            {
                return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                {
                    Alert = AlertOperation.SurveyOperation(StatusOperation.FailSend),
                    Status = AlertMode.warning
                }));
            }
        }
Esempio n. 3
0
        public override void Run()
        {
            if (this.IsShuttingDown || this.Pause)
            {
                return;
            }
            try
            {
                string         userName     = WebConfigurationManager.AppSettings["UserNameSMS"];
                string         password     = WebConfigurationManager.AppSettings["PasswordSMS"];
                string         NumberSMS    = WebConfigurationManager.AppSettings["NumberSMS"];
                string         PhoneManager = WebConfigurationManager.AppSettings["PhoneManager"];
                SendSoapClient client       = new SendSoapClient();

                var resultNotConfirmed = new CalculatedSale().CountNotConfirmed();

                if (resultNotConfirmed > 20)
                {
                    string resultSMS = client.SendSimpleSMS2(userName, password, PhoneManager, NumberSMS, string.Format("فناوران اطلاعات ارم وب / {0} سفارش در سیستم ثبت شده است.", resultNotConfirmed.ToString()), false);
                }
            }
            catch
            {
            }
        }
Esempio n. 4
0
        public async virtual Task <ActionResult> ResultConfirmSale(ConfirmSaleViewModel model)
        {
            try
            {
                var user = await _userManager.FindUserById(model.Usder_Id);

                string userName  = WebConfigurationManager.AppSettings["UserNameSMS"];
                string password  = WebConfigurationManager.AppSettings["PasswordSMS"];
                string NumberSMS = WebConfigurationManager.AppSettings["NumberSMS"];


                SendSoapClient client = new SendSoapClient();

                string result = client.SendSimpleSMS2(userName, password, user.Phone, NumberSMS, "کاربر گرامی سفارش شما مورد تائید قرار گرفت بعد از تحویل مرسوله به پست کد رهگیری برای شما ارسال می شود", false);

                var sale = _saleService.GetById(model.Sale_Id);
                sale.StatusUltimate = true;

                _saleService.Update(sale);

                if (_unitOfWork.SaveAllChanges() > 0)
                {
                    return(Json(new { Result = "تائید سفارش با موفقیت صورت گرفت" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { Result = "عدم موفقیت در تائید سفارش" }, JsonRequestBehavior.AllowGet));
                }
            }
            catch
            {
                return(Json(new { Result = "عدم موفقیت در تائید سفارش" }, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 5
0
        public virtual async Task <ActionResult> ResultAnswerContact(AnswerContactViewModel model)
        {
            try
            {
                var user = await _userManager.FindUserById(model.User_Id);

                string userName  = WebConfigurationManager.AppSettings["UserNameSMS"];
                string password  = WebConfigurationManager.AppSettings["PasswordSMS"];
                string NumberSMS = WebConfigurationManager.AppSettings["NumberSMS"];


                SendSoapClient client = new SendSoapClient();

                string result = client.SendSimpleSMS2(userName, password, user.Phone, NumberSMS, model.Message, false);

                var contact = _contactService.GetById(model.Contact_Id);
                contact.StatusAnswer = true;
                contact.StatusRead   = true;

                _contactService.Update(contact);

                if (_unitOfWork.SaveAllChanges() > 0)
                {
                    return(Json(new { Result = "ارسال  پیام کوتاه با موفقیت صورت گرفت" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { Result = "عدم موفقیت در ارسال  پیام کوتاه" }, JsonRequestBehavior.AllowGet));
                }
            }
            catch
            {
                return(Json(new { Result = "عدم موفقیت در ارسال پیام کوتاه" }, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 6
0
 protected void onSoapClick(object sender, EventArgs e)
 {
     const string   username   = "******";
     const string   password   = "******";
     const string   from       = "5000...";
     const string   to         = "09123456789";
     const string   text       = "تست وب سرویس ملی پیامک";
     const bool     isFlash    = false;
     SendSoapClient soapClient = new SendSoapClient();
     var            result     = soapClient.SendSimpleSMS2(username, password, to, from, text, isFlash);
 }
Esempio n. 7
0
        public ActionResult Soap()
        {
            const string   username   = "******";
            const string   password   = "******";
            const string   from       = "5000...";
            const string   to         = "09123456789";
            const string   text       = "تست وب سرویس ملی پیامک";
            const bool     isFlash    = false;
            SendSoapClient soapClient = new SendSoapClient();
            var            result     = soapClient.SendSimpleSMS2(username, password, to, from, text, isFlash);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Esempio n. 8
0
        public virtual async Task <ActionResult> ResultSendTrackingNumber(ConfirmSaleViewModel model)
        {
            try
            {
                var user = await _userManager.FindUserById(model.Usder_Id);

                string userName  = WebConfigurationManager.AppSettings["UserNameSMS"];
                string password  = WebConfigurationManager.AppSettings["PasswordSMS"];
                string NumberSMS = WebConfigurationManager.AppSettings["NumberSMS"];


                SendSoapClient client = new SendSoapClient();

                string result = client.SendSimpleSMS2(userName, password, user.Phone, NumberSMS, string.Format("شرکت فناوران اطلاعات ارم وب / کد رهگیری پستی / {0} ", model.TrackingNumber.ToString()), false);

                var sale = _saleService.GetById(model.Sale_Id);
                sale.StatusSend     = true;
                sale.TrackingNumber = model.TrackingNumber.ToString();


                _saleService.Update(sale);


                if (_unitOfWork.SaveAllChanges() > 0)
                {
                    return(Json(new { Result = "ارسال و صحیح کردن کد رهگیری با موفقیت صورت گرفت" }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(Json(new { Result = "عدم موفقیت در ارسال و صحیح کردن کد رهگیری" }, JsonRequestBehavior.AllowGet));
                }
            }
            catch
            {
                return(Json(new { Result = "عدم موفقیت در تائید سفارش" }, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 9
0
        public virtual ActionResult SendSimpleSMS2(SndSMSViewModel model)
        {
            try
            {
                string userName  = WebConfigurationManager.AppSettings["UserNameSMS"];
                string password  = WebConfigurationManager.AppSettings["PasswordSMS"];
                string NumberSMS = WebConfigurationManager.AppSettings["NumberSMS"];


                SendSoapClient client = new SendSoapClient();

                string result = client.SendSimpleSMS2(userName, password, model.Phone, NumberSMS, model.Body, false);

                switch (result)
                {
                case "0":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.InvalidUserNameOrPassword),
                        Status = AlertMode.warning
                    }));

                case "1":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.SuccessOperation),
                        Status = AlertMode.success
                    }));

                case "2":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.NotEnoghCreadit),
                        Status = AlertMode.warning
                    }));

                case "3":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.DailySendLimit),
                        Status = AlertMode.warning
                    }));

                case "4":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.WightSendLimit),
                        Status = AlertMode.warning
                    }));

                case "5":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.NotValidNumber),
                        Status = AlertMode.warning
                    }));

                case "6":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.UpgradeSoftwer),
                        Status = AlertMode.warning
                    }));

                case "7":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.FilterWord),
                        Status = AlertMode.warning
                    }));

                case "10":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.NotActiveUser),
                        Status = AlertMode.warning
                    }));

                case "11":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.NotSend),
                        Status = AlertMode.warning
                    }));

                case "12":
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.NotCompleteRegistrationPaper),
                        Status = AlertMode.warning
                    }));

                default:
                    return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                    {
                        Alert = AlertOperationSendSMS.SurveyOperation(StatusOperationSendMessage.RecId),
                        Status = AlertMode.success
                    }));
                }
            }
            catch
            {
                return(PartialView(MVC.admin.Shared.Views._alert, new AlertViewModel
                {
                    Alert = AlertOperation.SurveyOperation(StatusOperation.FailSend),
                    Status = AlertMode.warning
                }));
            }
        }