public ISPProductViewModel()
 {
     ISP         = new ISP();
     ISPs        = new List <ISP>();
     ISPProduct  = new ISPProduct();
     ISPProducts = new List <ISPProduct>();
 }
示例#2
0
        public static void SendISPOrderReminderEmail(ISP isp, int newOrders)
        {
            var smtp = NewClient();

            string ffEmail = ConfigurationManager.AppSettings["FrogfootEmail"];

            var body = string.Format("Hi {0} team, <br/><br/>You have {1} new fibre order(s) on the Frogfoot Fibre portal that need attending to.." +
                                     "<br/><br/>Please log on to the Frogfoot Fibre portal <strong><a href=\"" + "http://www.frogfootfibre.com/Account/Login" + "\">here</strong> to tend to the orders." +
                                     "<br/><br/>Regards," +
                                     "<br/><br/>The Frogfoot Fibre team", isp.Name, newOrders);

            string subject = "New orders reminder";

            MailMessage message = new MailMessage()
            {
                IsBodyHtml = true,
                Body       = body,
                Subject    = subject,
            };

            message.From = new MailAddress(ffEmail, "Frogfoot Fibre");
            message.To.Add(new MailAddress(isp.EmailAddress));

            smtp.Send(message);
        }
示例#3
0
        public ISPViewModel SaveISP(ISP model)
        {
            var hasError = ispRepo.SaveISP(model);

            return(new ISPViewModel
            {
                Message = hasError ? "There was an error saving the ISP" : "ISP saved successfully"
            });
        }
        private void EditISP(int ISPId)
        {
            this.ISP = this.srvISP.GetById(ISPId);

            this.ClearDetailControls();
            this.LoadFormFromEntity();
            this.frmISP.HiddenDetail(false);
            this.ShowDetail(true);
        }
示例#5
0
 public void Do()
 {
     if (SG.CanGenerate())
     {
         ISP.Print(SG.Result);
     }
     else
     {
         IFP.Print();
     }
 }
 private void DeleteEntity(int ISPId)
 {
     if (MessageBox.Show("¿Esta seguro de eliminar el ISP?", "Advertencia",
                         MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
     {
         return;
     }
     this.ISP           = this.srvISP.GetById(ISPId);
     this.ISP.Activated = false;
     this.ISP.Deleted   = true;
     this.srvISP.SaveOrUpdate(this.ISP);
     this.Search();
 }
示例#7
0
        public override ISP GetSearchResult()
        {
            ISP          ISP       = null;
            UltraGridRow activeRow = this.grdSchSearch.ActiveRow;

            if (activeRow != null)
            {
                int ISPId = Convert.ToInt32(activeRow.Cells[0].Value);
                ISP = this.srvISP.GetById(ISPId);
            }

            return(ISP);
        }
示例#8
0
 private void Run()
 {
     try
     {
         // Creating new instance of SP.
         TraceOut.Put("Creating new ISP instance...");
         this.SPHandle = ((ISP)(Activator.CreateInstance(this.SPType)));
         this.SPHandle.SPStatusEvent += new SPStatusEventHandler(this.ServiceProviderStatusEventHandler);
         TraceOut.Put("Event handler added...");
         // Creating control class.
         TraceOut.Put("Creating APCControl...");
         this.APCStCtrl = new APCStates.APCStateControl(this.SPHandle);
         this.APCStCtrl.APCControlEvent += new SPStatusEventHandler(this.ServiceProviderStatusEventHandler);
         TraceOut.Put("APCControl created...");
         // Adding states.
         TraceOut.Put("Added APC service states folders: " + this.opt.APCServiceStatesFolders + ".");
         this.APCStCtrl.AddStates(this.opt.APCServiceStatesFolders);
         // Adding script.
         this.APCStCtrl.AddScript(this.ScriptFileName);
         TraceOut.Put("Main script file defined...");
         // Check if where is no connection.
         if (this.SPHandle.Status() == Diacom.SPStatus.DISCONNECTED)
         {
             TraceOut.Put("Main did not connect to the Server - Connecting ...");
             // No connection means the script uses default service provider.
             if (!LoginToServer())
             {
                 TraceOut.Put("Connection failed.");
                 return;
             }
             TraceOut.Put("Connected.");
         }
         // Adding lines.
         TraceOut.Put("Adding lines...");
         foreach (SPLine line in this.SPHandle.GetLines())
         {
             this.APCStCtrl.AddLine(line);
         }
         TraceOut.Put("Lines added.");
         // Initializating lines.
         this.APCStCtrl.InitLines();
         TraceOut.Put("Lines initialization complete.");
     }
     catch (Exception x)
     {
         TraceOut.Put("Exception during creating class");
         TraceOut.Put(x);
     }
 }
示例#9
0
        public bool SaveISP(ISP isp)
        {
            ISP entity = isp;

            if (isp.ISPId == null)
            {
                db.ISPs.Add(entity);
            }
            else
            {
                db.ISPs.Attach(entity);
                db.Entry(entity).State = EntityState.Modified;
            }

            db.SaveChanges();
            return(true);
        }
示例#10
0
        public static void SendISPNewOrderNotification(Order order, ISP isp, User user, string orderUrl)
        {
            if (!isp.ImmediateOrderEmailNotification)
            {
                return;
            }

            var orderUrlWithOrderId = orderUrl + "/" + order.OrderId;
            var smtp = NewClient();
            var body =
                string.Format(
                    "This is an automated email from the Frogfoot Fibre portal with details of a new order for Fibre Broadband " +
                    "which has been captured on the portal and needs to be actioned by {0}." +
                    "<br/><br/>If this mail is processed by a Service Representative, you can follow the link below, use your Frogfoot Fibre " +
                    "portal credentials to log into the portal and if all is in order and you are ready, place the order for a fibre link with Frogfoot." +
                    "<br/><br/>If this mail is to be processed by your provisioning system, we assume that the order info supplied below will be automatically " +
                    "captured and at a later date a Service Representative will place the order for a fibre link with Frogfoot. " +
                    "<br/><br/><a href=\'" + orderUrlWithOrderId + "\'>Fibre Order</a>" +
                    "<br/><br/><h2>Service Order</h2>" +
                    "<br/><br/><h3>Client Details</h3>" +
                    "Suburb: {1} <br/>First name: {2}<br/> Last name: {3}<br/> Email: {4}<br/> Phone number: {5}<br/> Landline: {6}<br/> Created date: {7}<br/> Latitude: {8}" +
                    "<br/> Longitude: {9}<br/> Address: {10}<br/> ISP Order no: {11}<br/> Status: {12}" +
                    "<h3>Product</h3>" +
                    "<br/> Product name: {13}<br/> Line speed: {14}<br/> Up speed: {15}<br/> Is Capped: {16}" +
                    "<br/> Cap: {17}<br/> Monthly cost: {18}<br/> Setup cost: {19}",
                    isp.Name, user.Location.Name, user.FirstName, user.LastName, user.Email, user.PhoneNumber,
                    user.Landline, order.CreatedDate, user.Latitude, user.Longitude, user.Address, order.ISPOrderNo,
                    order.Status, order.ISPProduct.ProductName, order.ISPProduct.LineSpeed, order.ISPProduct.UpSpeed,
                    order.ISPProduct.IsCapped, order.ISPProduct.Cap, order.ISPProduct.MonthlyCost, order.ISPProduct.SetupCost);

            string subject = "New order notification";

            MailMessage message = new MailMessage()
            {
                IsBodyHtml = true,
                Body       = body,
                Subject    = subject,
            };

            string ffEmail = ConfigurationManager.AppSettings["FrogfootEmail"];

            message.From = new MailAddress(ffEmail, "Frogfoot Fibre");
            message.To.Add(new MailAddress(isp.EmailAddress));
            smtp.Send(message);
        }
示例#11
0
        public DBResult SP_Login(Models.Database.StoredProcedures.SP_Login.Inputs inputs,
                                 ISP <Models.Database.StoredProcedures.SP_Login.Inputs> sp = null)
        {
            if (inputs == null)
            {
                throw new ArgumentNullException("Invalid inputs data.");
            }

            if (string.IsNullOrEmpty(inputs.Email) || string.IsNullOrEmpty(inputs.Password))
            {
                throw new ArgumentNullException("Email and Password could not be empty.");
            }

            if (sp == null)
            {
                sp = new FTSS.DP.DapperORM.StoredProcedure.SP_Login(GetConnectionString());
            }
            var rst = sp.Call(inputs);

            return(rst);
        }
示例#12
0
        public DBResult SP_APILog_Insert(Models.Database.StoredProcedures.SP_APILog_Insert.Inputs inputs,
                                         ISP <Models.Database.StoredProcedures.SP_APILog_Insert.Inputs> sp = null)
        {
            if (inputs == null)
            {
                throw new ArgumentNullException("Invalid inputs data.");
            }

            if (string.IsNullOrEmpty(inputs.APIAddress))
            {
                throw new ArgumentNullException("APIAddress could not be empty.");
            }

            if (sp == null)
            {
                sp = new FTSS.DP.DapperORM.StoredProcedure.SP_APILog_Insert(GetConnectionString());
            }
            var rst = sp.Call(inputs);

            return(rst);
        }
示例#13
0
        public DBResult SP_User_Insert(Models.Database.StoredProcedures.SP_User_Insert.Inputs inputs,
                                       ISP <Models.Database.StoredProcedures.SP_User_Insert.Inputs> sp = null)
        {
            if (inputs == null)
            {
                throw new ArgumentNullException("Invalid inputs data.");
            }

            if (!inputs.IsValid())
            {
                throw new ArgumentException("Invalid input data.");
            }

            if (sp == null)
            {
                sp = new FTSS.DP.DapperORM.StoredProcedure.SP_User_Insert(GetConnectionString());
            }
            var rst = sp.Call(inputs);

            return(rst);
        }
 private void btnSchCreate_Click(object sender, EventArgs e)
 {
     this.ISP = new ISP();
     this.ClearDetailControls();
     this.ShowDetail(true);
 }
 public DN(IWM vm, ISP sp)
 {
     this.vm = vm;
     this.sp = sp;
     CS      = new BS();
 }
示例#16
0
		public DN(IWM vm, ISP sp)
		{
			_vm = vm;
			_sp = sp;
			_s = new BS();
		}
 public OrderResultViewModel()
 {
     User = new User();
     ISP  = new ISP();
 }
 public ISPViewModel()
 {
     ISP  = new ISP();
     ISPs = new List <ISP>();
 }
示例#19
0
		public DN(IWM vm, ISP sp)
		{
			this.vm = vm;
			this.sp = sp;
			CS = new BS();
		}