public ActionResult Checksmslogincode(string PhoneNumber, string UserLoginCode)
        {
            try
            {
                if (clsConnect.DB_OpenConnection(DBHost, DBName, DBUser, DBPassword))
                {
                    string SmsLoginCode = Session["SmsLoginCode"] as string;
                    if (!string.IsNullOrWhiteSpace(SmsLoginCode))
                    {
                        DateTime timestampSms = (DateTime)Session["TimeStampSmsLoginCode"];
                        if ((DateTime.Now - timestampSms).Minutes > 5)
                        {
                            Session["SmsLoginCode"]          = null;
                            Session["TimeStampSmsLoginCode"] = null;
                            return(Json(new { success = false, messenge = Languge.OTP_CodeExpired }));
                        }
                        if (UserLoginCode.CompareTo(SmsLoginCode) == 0)
                        {
                            CARD_CLIENT clientCard = CARD_CLIENT.ParseFromDataTable <CARD_CLIENT>(cls_2018_CLIENT.m2018_GetoneClient(PhoneNumber));
                            Session["SmsLoginCode"]          = null;
                            Session["TimeStampSmsLoginCode"] = null;
                            Session["KeyUserLogin"]          = clientCard.KEY_CARD_CLIENT;
                            Session["CodeUserLogin"]         = clientCard.COD_CARD_CLIENT;
                            return(Json(new { success = true, UserDisplayName = PhoneNumber, userData = clientCard }));
                        }
                    }
                }
                return(Json(new { success = false, messenge = Languge.ConnectNotSuccess }));
            }
            catch (Exception ex)

            { return(Json(new { success = false, messenge = ex.Message + " " + ex.StackTrace })); }
        }
 public ActionResult GetUserInfo()
 {
     if (clsConnect.DB_OpenConnection(DBHost, DBName, DBUser, DBPassword))
     {
         string      CodeClient = Session["CodeUserLogin"] as string;
         CARD_CLIENT userInfo   = CARD_CLIENT.ParseFromDataTable <CARD_CLIENT>(cls_2018_CLIENT.m2018_GetoneClient(CodeClient));
         return(Json(new { success = true, result = userInfo }, JsonRequestBehavior.AllowGet));
     }
     return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
 }
 public ActionResult GetDetailCart(Guid id)
 {
     if (id != null)
     {
         string      CodeUserLogin            = Session["CodeUserLogin"] as string;
         CARD_CLIENT clientCard               = CARD_CLIENT.ParseFromDataTable <CARD_CLIENT>(cls_2018_CLIENT.m2018_GetoneClient(CodeUserLogin));
         List <Sonetwsv.MAT_HANG> productMap  = Sonetwsv.MAT_HANG.ParseListFromDataTable <Sonetwsv.MAT_HANG>(cls_2018_GOODS.m2018_FilterGoods(""));
         ORDER_CLIENT             orderClient = ORDER_CLIENT.ParseFromDataTable <ORDER_CLIENT>(cls_2018_ORDERS.m2018_GetoneOrders(id));
         List <ORDER_GOODS>       orderGoods  = ORDER_GOODS.ParseListFromDataTable <ORDER_GOODS>(cls_2018_ORDERS.m2018_GetsallGoods(id));
         return(Json(new { success = true, result = orderClient, orderGoods = orderGoods, productMap = productMap, CLIENT_INFO = clientCard }, JsonRequestBehavior.AllowGet));
     }
     return(Json(new { success = false }, JsonRequestBehavior.AllowGet));
 }
        public ActionResult GetNewCartData()
        {
            CARD_CLIENT clientCard = null;

            if (clsConnect.DB_OpenConnection(DBHost, DBName, DBUser, DBPassword))
            {
                string CodeUserLogin = Session["CodeUserLogin"] as string;
                clientCard = CARD_CLIENT.ParseFromDataTable <CARD_CLIENT>(cls_2018_CLIENT.m2018_GetoneClient(CodeUserLogin));
            }
            return(Json(new
            {
                COD_ORDER_CLIENT = DateTime.Now.ToString("ddMMyyyyHHmmss"),
                CLIENT_INFO = clientCard
            }, JsonRequestBehavior.AllowGet));
        }