Пример #1
0
        public ActionResult Edit(Int64 id)
        {
            AD_DefinationBL db = new AD_DefinationBL();

            ViewBag.UETypes = db.SelectedList("byDefinationType", "UE Type", "-select Device-");
            AD_UserEquipmentsBL ueb = new AD_UserEquipmentsBL();

            ClientsBL cBl = new ClientsBL();

            ViewBag.UEOwner = cBl.SelectedList("All", null, "-Select Owner-");

            return(View("new", ueb.ToSingle("ById", id.ToString())));
        }
Пример #2
0
        public Response IdleUE(string IMEI, int Duration, string TestType)
        {
            Response r = new Response();

            try
            {
                AV_UEPbxBL ueb = new AV_UEPbxBL();

                var rec = ueb.ToSingle("byIsIdle", true.ToString());
                if (rec != null)
                {
                    AD_UserEquipmentsBL ueqb = new AD_UserEquipmentsBL();
                    var uerec = ueqb.ToSingle("BySerialNo", IMEI);
                    if (uerec != null)
                    {
                        SendMessage(rec.DeviceToken, uerec.UENumber, Duration, TestType);
                        r.Status  = "success";
                        r.Message = "success";
                    }
                    else
                    {
                        r.Status  = "error";
                        r.Message = "Device number not found!.";
                    }
                }
                else
                {
                    r.Status  = "error";
                    r.Message = "Server busy.";
                }
            }
            catch (Exception ex)
            {
                r.Status  = "error";
                r.Message = ex.Message;
            }

            return(r);
        }
Пример #3
0
        public JsonResult Movement(List <AD_UEMovement> mov, string UEStatus)
        {
            Response res = new Response();

            try
            {
                AD_UEMovementBL ueb = new AD_UEMovementBL();

                foreach (var item in mov)
                {
                    ueb.Manage(UEStatus, item);
                }

                //------------------------------
                if (UEStatus == "Issue")
                {
                    long UEId   = mov.Select(x => x.UEId).Single();
                    long UserId = mov.Select(x => x.UserId).Single();

                    AD_UserEquipmentsBL uebl = new AD_UserEquipmentsBL();
                    AD_UserEquipment    uEqu = uebl.ToSingle("ById", UEId.ToString());

                    Sec_UserBL u            = new Sec_UserBL();
                    Sec_User   usr          = u.Single("ById", UserId.ToString());
                    WebConfig  wc           = new WebConfig();
                    string     UeModel      = uEqu.Model;
                    string     Manufacturer = uEqu.Manufacturer;
                    string     SerialNo     = uEqu.SerialNo;

                    string AVStoreURL = wc.AppSettings("AVStoreURL");

                    string Url = "<a href=" + AVStoreURL + ">AirView Store</a>";

                    string UserName = usr.UserName;
                    string ToEmail  = usr.Email;

                    string Subject = "UE Device Issued";
                    string Body    = "<h1>Hi, " + UserName + "</h1>" +
                                     "<p>A new device is issued to your account.</p>" +
                                     "<table border=" + 1 + " cellpadding=" + 2 + " cellspacing=" + 0 + " width = " + 400 + ">" +
                                     "<tr bgcolor='#F5F5F5'><td><strong>Model</strong></td><td>" + UeModel + "</td></tr>" +
                                     "<tr bgcolor='#F5F5F5'><td><strong>Manufacturer</strong></td><td>" + Manufacturer + "</td></tr>" +
                                     "<tr bgcolor='#F5F5F5'><td><strong>SerialNo</strong></td><td>" + SerialNo + "</td></tr>" +
                                     "</table>" +
                                     "<p>Please download and install AirView Store by clicking here: " + Url + "</p>";


                    Thread thread = new Thread(() => SendEmail(Subject, ToEmail, Body));
                    thread.Start();

                    //-----------------------------
                }


                res.Status  = "success";
                res.Message = "save successfully";
            }
            catch (Exception ex)
            {
                res.Status  = "danger";
                res.Message = ex.Message;
            }
            return(Json(res, JsonRequestBehavior.AllowGet));
        }