// this function for just referance for partial update field user have to create seperate function learn from this function.
        public bool UpdatePartial(ENT.ActivityLog objEntity)
        {
            bool blnResult = false;

            try
            {
                //Create Fields List in dictionary
                Dictionary <string, bool> dctFields = new Dictionary <string, bool>();
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.activityid), true);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.userid), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.ipaddress), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.browser), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.macaddress), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.SystemDateTime), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.CreatedBy), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.CreatedDateTime), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.UpdatedBy), false);
                dctFields.Add(COM.HelperMethod.PropertyName <ENT.ActivityLog>(x => x.UpdatedDateTime), false);
                objEntity.FieldCollection = dctFields;
                if (objDAL.SaveChanges(objEntity.FieldCollection, objEntity))
                {
                    blnResult = true;
                }
            }
            catch (Exception)
            {
                throw;
            }
            return(blnResult);
        }
        public object GetByPrimaryKey(ENT.ActivityLog Entity)
        {
            object objResult = null;

            try
            {
                DAL.CRUDOperation tt = new DAL.CRUDOperation();
                objResult = tt.GetEntityByPrimartKey(Entity);
            }
            catch (Exception)
            {
                throw;
            }
            return(objResult);
        }
        private bool disposedValue = false; // To detect redundant calls

        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: dispose managed state (managed objects).
                }
                objDAL    = null;
                clsDAL    = null;
                Entity    = null;
                lstEntity = null;
                // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below.
                // TODO: set large fields to null.

                disposedValue = true;
            }
        }
        public async Task <ActionResult> Login(LoginViewModel model, string returnUrl)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }

            var result = await SignInManager.PasswordSignInAsync(model.Mobile, model.Password, model.RememberMe, shouldLockout : false);

            switch (result)
            {
            case SignInStatus.Success:
                ApplicationUser user      = UserManager.FindByName(model.Mobile);
                ENT.ActivityLog model2    = new Web.Framework.Entity.ActivityLog();
                BAL.ActivityLog ObjBAL    = new Web.Framework.BusinessLayer.ActivityLog();
                string[]        RetOutput = new string[3];
                RetOutput         = new GenralGetIp().GetBrowerInformation();
                model2.browser    = RetOutput[0].ToString() + " " + RetOutput[1].ToString();
                model2.useragent  = RetOutput[2].ToString();
                model2.ipaddress  = new GenralGetIp().GetIPAddress(Request);
                model2.userid     = Guid.Parse(user.Id);
                model2.macaddress = new GenralGetIp().GetMacAddress();
                ObjBAL.Insert(model2);
                return(RedirectToLocal(returnUrl));

            case SignInStatus.LockedOut:
                return(View("Lockout"));

            case SignInStatus.RequiresVerification:
                return(RedirectToAction("SendCode", new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }));

            case SignInStatus.Failure:
            default:
                ModelState.AddModelError("", "Invalid login attempt.");
                return(View(model));
            }
        }