Beispiel #1
0
 public ShopCartVm()
 {
     Order               = new Fly_Order();
     ProductVariant      = new Fly_ProductVariant();
     Products            = new Fly_Product();
     Customer            = new Fly_Customer();
     CustomerAttr        = new Fly_CustomerAttribute();
     OrderNote           = new Fly_OrderNote();
     OrderProductVariant = new Fly_OrderProductVariant();
     Country             = new Fly_Country();
 }
Beispiel #2
0
        public static Fly_Customer UpdateEntity(Fly_Customer itemNew, Fly_Customer itemOld)
        {
            Fly_Customer rs = itemOld;

            if (itemNew != null && itemOld != null)
            {
                rs.CustomerID       = (itemNew.CustomerID.Equals(itemOld.CustomerID)) ? itemOld.CustomerID : itemNew.CustomerID;
                rs.Email            = (itemNew.Email != null && !itemNew.Email.Equals(itemOld.Email)) ? itemOld.Email : itemNew.Email;
                rs.Username         = (itemNew.Username != null && !itemNew.Username.Equals(itemOld.Username)) ? itemOld.Username : itemNew.Username;
                rs.IsTaxExempt      = (itemNew.IsTaxExempt.Equals(itemOld.IsTaxExempt)) ? itemOld.IsTaxExempt : itemNew.IsTaxExempt;
                rs.IsAdmin          = (itemNew.IsAdmin.Equals(itemOld.IsAdmin)) ? itemOld.IsAdmin : itemNew.IsAdmin;
                rs.Active           = (itemNew.Active.Equals(itemOld.Active)) ? itemOld.Active : itemNew.Active;
                rs.IsGuest          = (itemNew.IsGuest.Equals(itemOld.IsGuest)) ? itemOld.IsGuest : itemNew.IsGuest;
                rs.Deleted          = (itemNew.Deleted.Equals(itemOld.Deleted)) ? itemOld.Deleted : itemNew.Deleted;
                rs.RegistrationDate = (itemNew.RegistrationDate.Equals(itemOld.RegistrationDate)) ? itemOld.RegistrationDate : itemNew.RegistrationDate;
                rs.AvatarID         = (itemNew.AvatarID.Equals(itemOld.AvatarID)) ? itemOld.AvatarID : itemNew.AvatarID;
                rs.DateOfBirth      = (itemNew.DateOfBirth.Equals(itemOld.DateOfBirth)) ? itemOld.DateOfBirth : itemNew.DateOfBirth;
            }
            return(rs);
        }
Beispiel #3
0
        public ActionResult Login(string uname, string pwd)
        {
            try
            {
                Fly_Customer objUser = _repositoryUser.SignIn(uname, pwd);
//                string role = (objUser.IsAdmin.GetValueOrDefault(false)) ? true : false;
                var flag = (objUser != null);
                if (flag)
                {
                    FormsAuthentication.SetAuthCookie(uname, true);
                    Session["idxu"] = objUser.CustomerID;
                    Session.Timeout = 60;
                }
                return(Json(flag, JsonRequestBehavior.DenyGet));
            }
            catch
            {
                return(View());
            }
        }
Beispiel #4
0
        public ActionResult Login(string uname, string pwd)
        {
            bool flag = false;
            IRepositryCustomers <Fly_Customer> repositoryUser = new CustomerDAO();

            try
            {
                Fly_Customer objUser = repositoryUser.SignIn(uname, pwd);
                flag = (objUser != null);
                if (flag)
                {
                    FormsAuthentication.SetAuthCookie(uname, true);
                    Session["idxu"] = objUser.CustomerID;
                    flag            = true;
                }
            }
            catch (Exception ex)
            {
                flag = false;
            }
            return(Json(flag, JsonRequestBehavior.DenyGet));
        }
Beispiel #5
0
        public ActionResult Login(string uname, string pwd)
        {
            bool flag = false;

            try
            {
                Fly_Customer objUser = _repositoryUser.SignIn(uname, pwd);
                flag = (objUser != null && objUser.IsAdmin.GetValueOrDefault(false));
                if (flag)
                {
                    FormsAuthentication.SetAuthCookie(uname, true);
                    Session["idxu"] = objUser.CustomerID;
                }
                else
                {
                    return(View());
                }
                return(Json(flag, JsonRequestBehavior.DenyGet));
            }
            catch (Exception ex)
            {
                return(View(ex.Message));
            }
        }