Exemplo n.º 1
0
        public ActionResult Test(string DataIn, string DateFn)
        {
            try
            {
                string message = "BillingDetails";

                var ls = FacadeSecurity.GetBillings(DataIn, DateFn, message);

                foreach (var item in ls)
                {
                    var            usuario = item.FK_UserID.Value;
                    ModelViewUserG objCred = new ModelViewUserG();

                    var user = FacadeUsers.GetByID(item.FK_UserID.Value);

                    objCred.TokenApp  = "26438b8b-a543-4d16-9ba6-8c7049a5c7cf";
                    objCred.TokenUser = user.Token.ToString();
                    JavaScriptSerializer js = new JavaScriptSerializer();
                    string value            = js.Serialize(objCred);

                    var orden = new OrderController().SetBilling2(value, item.Message, item.Date.Value);
                }



                return(Json("Success", JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
 public JsonResult ChangePassword(string Data)
 {
     try
     {
         ModelViewChangePassword objCred = new JavaScriptSerializer().Deserialize <ModelViewChangePassword>(Data);
         FacadeSecurity.ChangePassword(objCred);
         return(Json("Success", JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 3
0
        public JsonResult Authenticate(string session)
        {
            try
            {
                ModelViewLogin objCred     = new JavaScriptSerializer().Deserialize <ModelViewLogin>(session);
                var            lst         = FacadeSecurity.Authenticate(objCred);
                HttpCookie     myCookieobj = new HttpCookie("ServiPlus");
                myCookieobj["TokenUser"] = lst.Token;
                myCookieobj.Expires      = DateTime.Now.Add(TimeSpan.FromDays(365));
                Response.Cookies.Add(myCookieobj);

                return(Json(lst, JsonRequestBehavior.AllowGet));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 4
0
        public ActionResult Recovery(string Data)
        {
            try
            {
                ViewBag.AppToken = GlobalConfiguration.TokenWEB;

                if (Data != null)
                {
                    ModelViewRecovery objCred = new JavaScriptSerializer().Deserialize <ModelViewRecovery>(Data);
                    FacadeSecurity.Recovery(objCred);
                    return(Json("Success", JsonRequestBehavior.AllowGet));
                }
                else
                {
                    return(View());
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }