public void SetUserRights(string ObjectName, string FormType, string AlertMsg)
        {
            iUCToolbarClient objService = new iUCToolbarClient();

            try
            {
                if (AlertMsg == "")
                {
                    AlertMsg = "Not Allowed";
                }
                CustomProfile    profile    = CustomProfile.GetProfile();
                mUserRolesDetail userRights = new mUserRolesDetail();
                userRights = objService.GetUserRightsBy_ObjectNameUserID(ObjectName, profile.Personal.UserID, profile.DBConnection._constr);
                SetAddNewRight(false, AlertMsg);
                SetSaveRight(false, AlertMsg); SetEditRight(false, AlertMsg);
                SetClearRight(false, AlertMsg);
                SetExportRight(false, AlertMsg);
                SetImportRight(false, AlertMsg);
                SetMailRight(false, AlertMsg);
                SetPrintRight(false, AlertMsg);
                SetConvertToRight(false, AlertMsg);

                if (userRights != null)
                {
                    SetAddNewRight(Convert.ToBoolean(userRights.Add), AlertMsg);
                    if (FormType == "EntryForm" && Convert.ToBoolean(userRights.Add) == true)
                    {
                        SetSaveRight(true, "");
                        SetClearRight(true, "");
                    }
                }
            }
            catch { }
            finally { objService.Close(); }
        }
Beispiel #2
0
        public static string WMSetSessionGRN(string ObjectName, long GRNID, string state)
        {
            ClearSession();
            HttpContext.Current.Session["GRNID"]    = GRNID;
            HttpContext.Current.Session["GRNstate"] = state;
            iUCToolbarClient objService = new iUCToolbarClient();
            mUserRolesDetail checkRole  = new mUserRolesDetail();
            CustomProfile    profile    = CustomProfile.GetProfile();

            switch (ObjectName)
            {
            case "GRN":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("GRN", profile.Personal.UserID, profile.DBConnection._constr);
                break;

            case "QC":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("QC", profile.Personal.UserID, profile.DBConnection._constr);
                break;
            }
            if (checkRole.Add == false && checkRole.View == false)
            {
                ObjectName = "AccessDenied";
            }
            else if (ObjectName == "Approval" && checkRole.Approval == false)
            {
                ObjectName = "AccessDenied";
            }
            return(ObjectName);
        }
Beispiel #3
0
        public static string WMSetSessionReceipt(string ObjectName, long ReceiptID, string state)
        {
            ClearSession();
            HttpContext.Current.Session["PORReceiptID"] = ReceiptID;
            HttpContext.Current.Session["PORstate"]     = state;
            iUCToolbarClient objService = new iUCToolbarClient();
            mUserRolesDetail checkRole  = new mUserRolesDetail();
            CustomProfile    profile    = CustomProfile.GetProfile();

            switch (ObjectName)
            {
            case "Receipt":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("MaterialReceipt", profile.Personal.UserID, profile.DBConnection._constr);
                break;

            case "Consumption":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("Consumption", profile.Personal.UserID, profile.DBConnection._constr);
                HttpContext.Current.Session["PORConsumptionID"] = null;
                break;
            }
            if (checkRole.Add == false && checkRole.View == false)
            {
                ObjectName = "AccessDenied";
            }
            return(ObjectName);
        }
Beispiel #4
0
        public static string WMSetSessionRequest(string ObjectName, long RequestID, string state)
        {
            ClearSession();
            HttpContext.Current.Session["PKUPID"]    = RequestID;
            HttpContext.Current.Session["PKUPstate"] = state;
            iUCToolbarClient objService = new iUCToolbarClient();
            mUserRolesDetail checkRole  = new mUserRolesDetail();
            CustomProfile    profile    = CustomProfile.GetProfile();

            switch (ObjectName)
            {
            case "SalesOrder":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("SalesOrder", profile.Personal.UserID, profile.DBConnection._constr);
                break;

            case "PickUp":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("PickUp", profile.Personal.UserID, profile.DBConnection._constr);
                break;

            case "QC":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("QC", profile.Personal.UserID, profile.DBConnection._constr);
                break;

            case "LabelPrinting":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("LabelPrinting", profile.Personal.UserID, profile.DBConnection._constr);
                break;

            case "PutIn":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("PutIn", profile.Personal.UserID, profile.DBConnection._constr);
                break;

            case "Dispatch":
                checkRole = objService.GetUserRightsBy_ObjectNameUserID("Dispatch", profile.Personal.UserID, profile.DBConnection._constr);
                break;
            }
            if (checkRole.Add == false && checkRole.View == false)
            {
                ObjectName = "AccessDenied";
            }
            else if (ObjectName == "Approval" && checkRole.Approval == false)
            {
                ObjectName = "AccessDenied";
            }
            return(ObjectName);
        }
        public mUserRolesDetail GetUserRightsByObjectName(string ObjectName, string FormType, string AlertMsg)
        {
            mUserRolesDetail userRights = new mUserRolesDetail();
            iUCToolbarClient objService = new iUCToolbarClient();

            try
            {
                if (AlertMsg == "")
                {
                    AlertMsg = "Not Allowed";
                }
                CustomProfile profile = CustomProfile.GetProfile();
                userRights = objService.GetUserRightsBy_ObjectNameUserID(ObjectName, profile.Personal.UserID, profile.DBConnection._constr);
            }
            catch { }
            finally { objService.Close(); }
            return(userRights);
        }
Beispiel #6
0
 protected void ImgbtnSearch_Click(object sender, EventArgs e)
 {
     try
     {
         if (evClickSearch != null)
         {
             evClickSearch(this, ObjToolbarService);
         }
         ObjToolbarService = null;
     }
     catch (System.Exception ex)
     {
         Login.Profile.ErrorHandling(ex, ParentPage, "UCToolbar", "ImgbtnSearch_Click");
     }
     finally
     {
     }
 }