public Result ClientSave(ClientVM _Client)
        {
            Result Result = new Result();

            try
            {
                using (PropertyTaxCollectionCMSMain_Entities db = new PropertyTaxCollectionCMSMain_Entities())
                {
                    var obj = db.APP_DETAILS.Where(x => x.AppId == _Client.AppId).FirstOrDefault();
                    if (obj != null)
                    {
                        obj.AppName         = _Client.AppName;
                        obj.AppName_mar     = _Client.AppName_mar;
                        obj.State           = _Client.State;
                        obj.District        = _Client.District;
                        obj.Tehsil          = _Client.Tehsil;
                        obj.EmailId         = _Client.EmailId;
                        obj.website         = _Client.website;
                        obj.baseImageUrlCMS = _Client.baseImageUrlCMS;
                        obj.baseImageUrl    = _Client.baseImageUrl;
                        obj.basePath        = _Client.basePath;
                        obj.Latitude        = _Client.Latitude;
                        obj.Logitude        = _Client.Logitude;
                        obj.AppVersion      = _Client.AppVersion;
                        obj.IsActive        = _Client.IsActive;
                        obj.ForceUpdate     = _Client.ForceUpdate;
                    }
                    else
                    {
                        APP_DETAILS Master = new APP_DETAILS();

                        Master.AppName         = _Client.AppName;
                        Master.AppName_mar     = _Client.AppName_mar;
                        Master.State           = _Client.State;
                        Master.District        = _Client.District;
                        Master.Tehsil          = _Client.Tehsil;
                        Master.EmailId         = _Client.EmailId;
                        Master.website         = _Client.website;
                        Master.baseImageUrlCMS = _Client.baseImageUrlCMS;
                        Master.baseImageUrl    = _Client.baseImageUrl;
                        Master.basePath        = _Client.basePath;
                        Master.Latitude        = _Client.Latitude;
                        Master.Logitude        = _Client.Logitude;
                        Master.AppVersion      = _Client.AppVersion;
                        Master.IsActive        = _Client.IsActive;
                        Master.ForceUpdate     = _Client.ForceUpdate;

                        db.APP_DETAILS.Add(Master);
                    }

                    db.SaveChanges();
                    Result.message = "success";
                }
            }
            catch
            {
                Result.message = "error";
            }

            return(Result);
        }
        public Result EmployeeSave(EmployeeVM _Employee)
        {
            Result Result = new Result();

            try
            {
                using (PropertyTaxCollectionCMSMain_Entities db = new PropertyTaxCollectionCMSMain_Entities())
                {
                    var obj = db.AD_USER_MST.Where(x => x.ADUM_USER_CODE == _Employee.ADUM_USER_CODE).FirstOrDefault();
                    if (obj != null)
                    {
                        obj.SERVER_ID        = Convert.ToByte(_Employee.SERVER_ID);
                        obj.APP_ID           = _Employee.APP_ID;
                        obj.ADUM_USER_ID     = _Employee.ADUM_LOGIN_ID;
                        obj.ADUM_USER_NAME   = _Employee.ADUM_USER_NAME;
                        obj.ADUM_LOGIN_ID    = _Employee.ADUM_LOGIN_ID;
                        obj.ADUM_PASSWORD    = _Employee.ADUM_PASSWORD;
                        obj.ADUM_EMPLOYEE_ID = _Employee.ADUM_EMPLOYEE_ID;
                        obj.ADUM_DESIGNATION = _Employee.ADUM_DESIGNATION;
                        obj.ADUM_MOBILE      = _Employee.ADUM_MOBILE;
                        obj.ADUM_EMAIL       = _Employee.ADUM_EMAIL;
                        obj.LOCAL_USER_NAME  = _Employee.LOCAL_USER_NAME;
                        if (_Employee.PROFILE_IMAGE != null)
                        {
                            obj.PROFILE_IMAGE = _Employee.PROFILE_IMAGE;
                        }
                        //obj.ADUM_FRDT = Convert.ToDateTime(_Employee.ADUM_FRDT);
                        //obj.ADUM_TODT = Convert.ToDateTime(_Employee.ADUM_TODT);
                        obj.UPDATE_FLAG     = _Employee.UPDATE_FLAG;
                        obj.LAST_UPDATE     = DateTime.Now;//Convert.ToDateTime(_Employee.LAST_UPDATE);
                        obj.AD_USER_TYPE_ID = _Employee.AD_USER_TYPE_ID;
                        obj.IS_ACTIVE       = _Employee.IS_ACTIVE;
                    }
                    else
                    {
                        AD_USER_MST Master = new AD_USER_MST();

                        Master.SERVER_ID        = Convert.ToByte(_Employee.SERVER_ID);
                        Master.APP_ID           = _Employee.APP_ID;
                        Master.ADUM_USER_ID     = _Employee.ADUM_LOGIN_ID;
                        Master.ADUM_USER_NAME   = _Employee.ADUM_USER_NAME;
                        Master.ADUM_LOGIN_ID    = _Employee.ADUM_LOGIN_ID;
                        Master.ADUM_PASSWORD    = _Employee.ADUM_PASSWORD;
                        Master.ADUM_EMPLOYEE_ID = _Employee.ADUM_EMPLOYEE_ID;
                        Master.ADUM_DESIGNATION = _Employee.ADUM_DESIGNATION;
                        Master.ADUM_MOBILE      = _Employee.ADUM_MOBILE;
                        Master.ADUM_EMAIL       = _Employee.ADUM_EMAIL;
                        Master.LOCAL_USER_NAME  = _Employee.LOCAL_USER_NAME;
                        Master.PROFILE_IMAGE    = _Employee.PROFILE_IMAGE;
                        //Master.ADUM_FRDT = Convert.ToDateTime(_Employee.ADUM_FRDT);
                        //Master.ADUM_TODT = Convert.ToDateTime(_Employee.ADUM_TODT);
                        Master.UPDATE_FLAG     = _Employee.UPDATE_FLAG;
                        Master.LAST_UPDATE     = DateTime.Now;
                        Master.AD_USER_TYPE_ID = _Employee.AD_USER_TYPE_ID;
                        Master.IS_ACTIVE       = _Employee.IS_ACTIVE;
                        db.AD_USER_MST.Add(Master);
                    }

                    db.SaveChanges();
                    Result.message = "success";
                }
            }
            catch (Exception ex)
            {
                Result.message = "error";
            }

            return(Result);
        }