Beispiel #1
0
        public JsonResult LoginUser(string login_User_ArrayData)
        {
            HCM_Users login_user_Obj = new HCM_Users();

            login_User_ArrayData = HttpUtility.UrlDecode(login_User_ArrayData);
            NameValueCollectionData nameValueCollectionData_Obj = new NameValueCollectionData();
            NameValueCollection     Login_User_Collection_Obj   = nameValueCollectionData_Obj.GetQueryStringCollection(login_User_ArrayData);

            ModifyLoginData loginuser_Obj = new ModifyLoginData();

            login_user_Obj = loginuser_Obj.LoginUser(Login_User_Collection_Obj);

            if (login_user_Obj.UserID != 0)
            {
                Session["UserID"]   = Convert.ToString(login_user_Obj.UserID);
                Session["ClientID"] = Convert.ToString(login_user_Obj.Client.ClientID);
                Session["UserType"] = Convert.ToString(login_user_Obj.UserType);


                if (login_user_Obj.UserType == "SuperAdmin")
                {
                    List <HCM_Client>       client_list = new List <HCM_Client>();
                    ModifyGlobalClientsData client_Obj  = new ModifyGlobalClientsData();
                    client_list = client_Obj.GetClients(String.IsNullOrEmpty(Convert.ToString(Session["ClientID"])) ? 0 : Convert.ToInt32(Session["ClientID"]), Convert.ToString(Session["UserType"]));
                    if (String.IsNullOrEmpty(Convert.ToString(Session["ClientID"])))
                    {
                        Session["ClientID"] = Convert.ToString(client_list.First().ClientID);
                    }
                }

                if (login_user_Obj.UserType == "ClientAdmin" || login_user_Obj.UserType == "SuperAdmin")
                {
                    List <HCM_Versions> version_List        = new List <HCM_Versions>();
                    ModifyVersionsData  versionDataList_Obj = new ModifyVersionsData();
                    version_List = versionDataList_Obj.GetActiveVersions();
                    foreach (var item in version_List)
                    {
                        if (item.IsDefault)
                        {
                            Session["VersionID"] = Convert.ToString(item.VersionID);
                        }
                    }
                }

                if (login_user_Obj.UserType == "ClientAdmin" || login_user_Obj.UserType == "SuperAdmin")
                {
                    List <HCM_Product> product_List        = new List <HCM_Product>();
                    ModifyProductData  productDataList_Obj = new ModifyProductData();
                    product_List = productDataList_Obj.GetAllProducts();
                    foreach (var item in product_List)
                    {
                        Session["ProductID"] = Convert.ToInt32(item.ProductID);
                    }
                }
            }
            return(Json(login_user_Obj, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public JsonResult UpdateVersionToDefault(string VersionID)
        {
            string             Msg = "";
            ModifyVersionsData versionDataList_Obj = new ModifyVersionsData();

            Msg = versionDataList_Obj.UpdateVersionToDefault(VersionID);
            Session["VersionID"] = VersionID;

            return(Json(Msg, JsonRequestBehavior.AllowGet));
        }
Beispiel #3
0
        public JsonResult InsertAndUpdateVersion(string VersionDataArray)
        {
            string Msg = "";

            VersionDataArray = HttpUtility.UrlDecode(VersionDataArray);
            NameValueCollectionData nameValueCollectionData_Obj = new NameValueCollectionData();
            NameValueCollection     Version_CreateCollection    = nameValueCollectionData_Obj.GetQueryStringCollection(VersionDataArray);
            ModifyVersionsData      versionDataList_Obj         = new ModifyVersionsData();

            Msg = versionDataList_Obj.InsertAndUpdateVersion(Version_CreateCollection);

            return(Json(Msg, JsonRequestBehavior.AllowGet));
        }
Beispiel #4
0
 public JsonResult GetActiveVersions()
 {
     try
     {
         List <HCM_Versions> version_List        = new List <HCM_Versions>();
         ModifyVersionsData  versionDataList_Obj = new ModifyVersionsData();
         version_List = versionDataList_Obj.GetActiveVersions();
         return(Json(version_List, JsonRequestBehavior.AllowGet));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }