Esempio n. 1
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 }));
            }
        }