Beispiel #1
0
        public SmsResponseModel SendOneToOneSingleSms(string sendTo, string smsText)
        {
            if (!IsEnabledSmsFeature)
            {
                return(null);
            }

            SmsResponseModel smsResponse = null;

            try
            {
                var sms      = new SendSms();
                var response = sms.OneToOne(_smsUserName, _smsUserPassword, sendTo, smsText, _smsTypeText, _smsMaskName,
                                            _smsCampaignName);

                smsResponse = new SmsResponseModel(response);

                SendLowBalanceAlertToManagement(sms);
            }
            catch (Exception ex)
            {
                // ignored
            }

            return(smsResponse);
        }
Beispiel #2
0
        private void SendLowBalanceAlertToManagement(SendSms sms)
        {
            var balance = sms.GetBalance(_smsUserName, _smsUserPassword);

            if (double.Parse(balance) <= 2)
            {
                sms.OneToOne(_smsUserName, _smsUserPassword, SmsEmergencyContact, SmsEmergencyMessage,
                             _smsTypeText, _smsMaskName, _smsCampaignName);
            }
        }
Beispiel #3
0
 private void SendOneToOneSingleSms(Customer RT)
 {
     try
     {
         var    sms         = new SendSms();
         string returnValue = sms.OneToOne("01676688381", "65c5f73cff",
                                           RT.MobileNo, "Your Mortgage Account Has Been Created! User Id:" + RT.UserId + " Password:"******".  Mortgage System, Chittagong ", "1", "", "");
     }
     catch (Exception e)
     {
     }
 }
 void SendOneToOneSingleSms(string mobileno, string text)
 {
     try
     {
         var    sms         = new SendSms();
         string returnValue = sms.OneToOne("01711432258", "Rashed$1245492$", mobileno, text,
                                           "OneToOne", "Reminder", "Purchase Ticket");
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Beispiel #5
0
        public ActionResult CustomerInfo(Buyer buyer)
        {
            if (ModelState.IsValid)
            {
                buyer.Date          = DateTime.Now;
                buyer.IsDelivered   = false;
                buyer.PaymentStatus = false;

                db.Buyers.Add(buyer);
                db.SaveChanges();



                //Product Add
                if (Session["products"] != null)
                {
                    List <Order>   orders   = new List <Order>();
                    List <Product> products = (List <Product>)Session["products"];

                    foreach (Product P in products)
                    {
                        Product product = db.Products.Find(P.Id);

                        if ((product.Quantity - P.Quantity) >= 0)
                        {
                            Order ord = new Order();

                            ord.BuyerId   = buyer.Id;
                            ord.ProductId = P.Id;
                            ord.Quantity  = P.Quantity;

                            db.Orders.Add(ord);
                            db.SaveChanges();
                        }
                    }
                }

                //Buyer Update
                buyer.PaymentId       = "GM-" + DateTime.Now.Year + buyer.Id;
                db.Entry(buyer).State = EntityState.Modified;
                db.SaveChanges();
                Session["products"] = null;
                @Session["Count"]   = null;
                //Send Sms
                try
                {
                    var    sms         = new SendSms();
                    string returnValue = sms.OneToOne("01839507129", "88e288845f",
                                                      buyer.MobileNo, "To Complete Your Order Please Pay through The following Link: XYZ/OrderStatus ! Payment Id:" + buyer.PaymentId + ".  Mortgage System, Chittagong ", "Text", "", "");
                    ViewBag.Message = "Message has been sent to your mobile no.";
                }
                catch (Exception e)
                {
                }
                ViewBag.LocationId = new SelectList(db.Locations, "Id", "Name");
                return(View());
            }
            ViewBag.LocationId = new SelectList(db.Locations, "Id", "Name");

            return(View(buyer));
        }