public JsonResult GetOperators(string id)
        {
            List <ENT.OperatorSetup> lstEntity = new List <ENT.OperatorSetup>();

            GlobalVarible.Clear();
            try
            {
                using (BAL.OperatorSetup objBal = new BAL.OperatorSetup())
                {
                    lstEntity = objBal.GetOperatorByService(id, "30B24352-9F4B-485A-AB18-528E74F6F260");
                }
                GlobalVarible.AddMessage("Services get successfully.");
                return(Json(new { MySession.Current.MessageResult, lstEntity }, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                return(Json(new { MySession.Current.MessageResult, lstEntity }, JsonRequestBehavior.AllowGet));
            }
        }
Esempio n. 2
0
        public HttpResponseMessage GetOperators(GetOperatorModel model)
        {
            GlobalVarible.Clear();
            List <ENT.OperatorView> lstEntity = new List <ENT.OperatorView>();

            try
            {
                using (BAL.OperatorSetup objBal = new BAL.OperatorSetup())
                {
                    lstEntity = objBal.GetOperators("IN", model.serviceid);
                }

                foreach (ENT.OperatorView o in lstEntity)
                {
                    if (o.servicename == "DTH")
                    {
                        o.auth_maxlength  = 16;
                        o.auth_maxlength2 = 0;
                    }
                    else if (o.servicename == "PostPaid" || o.servicename == "Prepaid")
                    {
                        o.auth_maxlength  = 10;
                        o.auth_maxlength2 = 0;
                    }
                    else
                    {
                        o.auth_maxlength  = 30;
                        o.auth_maxlength2 = 50;
                    }
                }

                GlobalVarible.AddMessage("Operators get successfully.");
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult, lstEntity }));
            }
            catch (Exception ex)
            {
                GlobalVarible.AddError(ex.Message);
                ERRORREPORTING.Report(ex, _REQUESTURL, _LOGINUSERID, _ERRORKEY, string.Empty);
                return(ControllerContext.Request.CreateResponse(HttpStatusCode.OK, new { GlobalVarible.FormResult }));
            }
        }
Esempio n. 3
0
 public JsonResult SaveEntry(ENT.OperatorSetup model, string operatorid, string Billerlogoimg)
 {
     try
     {
         if (!string.IsNullOrWhiteSpace(Billerlogoimg))
         {
             model.Billerlogo = SaveGenralImages(Billerlogoimg);
         }
         List <Guid> dctDuplication = new List <Guid>();
         if (model.EntryMode == COM.Enumration.EntryMode.ADD)
         {
             model.Status = COM.MyEnumration.MyStatus.Active;
             List <ENT.OperatorSetup> lstResult = new BAL.OperatorSetup().CheckDuplicateCombination(dctDuplication, model.operatorname, model.operatorcode);
             if (lstResult.Count > 0)
             {
                 throw new Exception("OperatorName Or OperatorCode Already Exists.");
             }
             if (objBAL.Insert(model))
             {
                 GlobalVarible.AddMessage("Record Save Successfully");
             }
         }
         else
         {
             model.UpdatedDateTime = DateTime.Now;
             model.UpdatedBy       = Guid.Parse(User.Identity.GetUserId());
             model.operatorid      = new Guid(operatorid.Replace("/", ""));
             if (objBAL.UpdatePartial(model))
             {
                 GlobalVarible.AddMessage("Record Update Successfully");
             }
         }
     }
     catch (Exception ex)
     {
         GlobalVarible.AddError(ex.Message);
     }
     MySession.Current.MessageResult.MessageHtml = GlobalVarible.GetMessageHTML();
     return(Json(MySession.Current.MessageResult, JsonRequestBehavior.AllowGet));
 }