public void RetrieveDropDownListInfo()
        {
            List <LUserOrgDetailsVM>   entityList_OrgDetailsVM = new List <LUserOrgDetailsVM>();
            List <LUserRoleVM>         entityList_RoleVM       = new List <LUserRoleVM>();
            List <FunctionVM>          entityList_FunVM        = new List <FunctionVM>();
            List <LUserOrganizationVM> entityList_OrgVM        = new List <LUserOrganizationVM>();

            WebCommonHelper webCommonHelper = new WebCommonHelper();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                // Function List
                entityList_FunVM = funMgtHelper.Value.GetAll(entity_WCFAuthInfoVM);

                // Organization List
                entityList_OrgVM = orgMgtHelper.Value.GetAll(entity_WCFAuthInfoVM);

                // Role List
                entityList_RoleVM = roleMgtHelper.Value.GetAll(entity_WCFAuthInfoVM);

                // Organization Details List
                entityList_OrgDetailsVM = orgDetailMgtHelper.Value.GetAll(entity_WCFAuthInfoVM);
            });

            #region [ Organization List ]
            entityList_OrgVM.ForEach(current => current.OrganizationKey = current.OrganizationPath + " - " + MultilingualHelper.GetStringFromResource(current.OrganizationKey));

            entityList_OrgVM = entityList_OrgVM.Where(current => guidList_AccessedOrgID.Contains(current.ID)).ToList();

            ViewBag.OrgList = webCommonHelper.GetSelectList(entityList_OrgVM, "OrganizationKey", "ID", true);
            #endregion

            #region [ Organization Details List ]
            ViewBag.OrgDetailsList = webCommonHelper.GetSelectList(entityList_OrgDetailsVM, "OrgDetailsKey", "ID", true);
            #endregion

            #region [ Role List ]
            ViewBag.RoleList = webCommonHelper.GetSelectList(entityList_RoleVM, "RoleName", "ID", true);
            #endregion

            #region [ Function List ]
            entityList_FunVM.ForEach(current => current.FunctionKey = current.FunctionPath + " - " + MultilingualHelper.GetStringFromResource(current.FunctionKey));

            ViewBag.FunIDs = webCommonHelper.GetSelectList(entityList_FunVM, "FunctionKey", "ID", true);
            #endregion
        }
Ejemplo n.º 2
0
        public ActionResult Create()
        {
            WebCommonHelper webCommonHelper = new WebCommonHelper();

            List <LUserOrgDetailsVM> entityList_OrgDetailsVM = initOrgDetailsList();

            ViewBag.OrgDList = webCommonHelper.GetSelectList(entityList_OrgDetailsVM, "OrgDetailsKey", "ID", true);

            return(View(new LUserOrganizationVM()));
        }
Ejemplo n.º 3
0
        public void initOrgDetailsList()
        {
            WebCommonHelper webCommonHelper = new WebCommonHelper();

            List <LUserRoleVM> entityList_RoleVM = new List <LUserRoleVM>();
            List <FunctionVM>  entityList_FunVM  = new List <FunctionVM>();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                entityList_FunVM = funMgtHelper.Value.GetAll(entity_WCFAuthInfoVM);

                entityList_RoleVM = roleMgtHelper.Value.GetAll(entity_WCFAuthInfoVM);
            });

            ViewBag.RoleList = webCommonHelper.GetSelectList(entityList_RoleVM, "RoleName", "ID", true);

            entityList_FunVM.ForEach(current => current.FunctionKey = current.FunctionPath + " - " + MultilingualHelper.GetStringFromResource(current.FunctionKey));

            ViewBag.FunIDs = webCommonHelper.GetSelectList(entityList_FunVM, "FunctionKey", "ID", true);
        }
Ejemplo n.º 4
0
        public ActionResult Create(LUserOrganizationVM orgVM)
        {
            //Message Box Title -- When Error occured, Message Box would be showed.
            string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LUOrganizationManage_Create");

            WebCommonHelper webCommonHelper = new WebCommonHelper();

            List <LUserOrgDetailsVM> entityList_OrgDetailsVM = initOrgDetailsList();

            ViewBag.OrgDList = webCommonHelper.GetSelectList(entityList_OrgDetailsVM, "OrgDetailsKey", "ID", true);

            ModelState.Clear();
            TryValidateModel(orgVM);

            if (!ErrorMsgHelper.CustomValiation(str_MsgBoxTitle, ModelState, ViewBag))
            {
                return(View(orgVM));
            }

            string strError = "";

            //Define wcf output object;
            WCFReturnResult ret = new WCFReturnResult();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                ret = orgMgtHelper.Value.Create(entity_WCFAuthInfoVM, orgVM);
            });

            if (ret != null && ret.StrList_Error.Count() > 0)
            {
                strError = string.Join("<br/>", ret.StrList_Error.ToArray());
            }

            if (ret != null && ret.IsSuccess)
            {
                MsgInfo successMsgInfo = new MsgInfo();
                successMsgInfo.MsgTitle    = str_MsgBoxTitle;
                successMsgInfo.MsgDesc     = MultilingualHelper.GetStringFromResource(languageKey, "I000");
                successMsgInfo.MsgType     = MessageType.Success;
                TempData[ActionMessageKey] = successMsgInfo;
                return(RedirectToAction("Index"));
            }
            else
            {
                MsgInfo errorMsgInfo = new MsgInfo();
                errorMsgInfo.MsgTitle = str_MsgBoxTitle;
                errorMsgInfo.MsgDesc  = strError;
                errorMsgInfo.MsgType  = MessageType.ValidationError;
                ViewBag.ActionMessage = errorMsgInfo;
                return(View(orgVM));
            }
        }
Ejemplo n.º 5
0
        public ActionResult Edit(string guid)
        {
            //Message Box Title -- When Error occured, Message Box would be showed.
            string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LUOrganizationManage_Edit");

            WebCommonHelper webCommonHelper = new WebCommonHelper();

            List <LUserOrgDetailsVM> entityList_OrgDetailsVM = initOrgDetailsList();

            ViewBag.OrgDList = webCommonHelper.GetSelectList(entityList_OrgDetailsVM, "OrgDetailsKey", "ID", true);

            Guid ID = Guid.Parse(guid);

            string strError = "";

            OrgSerEditResult entity_Return = new OrgSerEditResult();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                entity_Return = orgMgtHelper.Value.GetEntityByID(entity_WCFAuthInfoVM, guid);
            });

            if (entity_Return.StrList_Error.Count > 0 || entity_Return.Entity_LUserOrganizationVM == null)
            {
                if (entity_Return.StrList_Error.Count() > 0)
                {
                    strError = string.Join("<br/>", entity_Return.StrList_Error.ToArray());
                }

                MsgInfo errorMsgInfo = new MsgInfo();
                errorMsgInfo.MsgTitle = str_MsgBoxTitle;
                errorMsgInfo.MsgDesc  = strError;
                errorMsgInfo.MsgType  = MessageType.ValidationError;

                LUserOrgDetailsVM selectionCriteria = new LUserOrgDetailsVM();

                if (TempData.ContainsKey(SelectionCriteriaKey))
                {
                    selectionCriteria = (LUserOrgDetailsVM)TempData[SelectionCriteriaKey];
                }

                TempData[SelectionCriteriaKey] = selectionCriteria;

                TempData[ActionMessageKey] = errorMsgInfo;
                return(RedirectToAction("Index"));
            }
            else
            {
                return(View(entity_Return.Entity_LUserOrganizationVM));
            }
        }
        private void initFunType()
        {
            WebCommonHelper     CommonHelper            = new WebCommonHelper();
            List <CTComboBoxVM> entityList_CTComboBoxVM = new List <CTComboBoxVM>();

            entityList_CTComboBoxVM.Add(new CTComboBoxVM()
            {
                Text  = "Create",
                Value = "A"
            });
            entityList_CTComboBoxVM.Add(new CTComboBoxVM()
            {
                Text  = "Edit",
                Value = "M"
            });
            entityList_CTComboBoxVM.Add(new CTComboBoxVM()
            {
                Text  = "Delete",
                Value = "D"
            });

            ViewBag.FunTypes = CommonHelper.GetSelectList(entityList_CTComboBoxVM, "Text", "Value", true);
        }
Ejemplo n.º 7
0
        public ActionResult Edit(LUserOrganizationVM organizationVM)
        {
            //Message Box Title -- When Error occured, Message Box would be showed.
            string str_MsgBoxTitle = MultilingualHelper.GetStringFromResource(languageKey, "LUOrganizationManage_Edit");

            WebCommonHelper webCommonHelper = new WebCommonHelper();

            List <LUserRoleVM> entityList_RoleVM = new List <LUserRoleVM>();
            List <FunctionVM>  entityList_FunVM  = new List <FunctionVM>();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                entityList_FunVM = funMgtHelper.Value.GetAll(entity_WCFAuthInfoVM);

                entityList_RoleVM = roleMgtHelper.Value.GetAll(entity_WCFAuthInfoVM);
            });

            ViewBag.RoleList = webCommonHelper.GetSelectList(entityList_RoleVM, "RoleName", "ID", true);

            entityList_FunVM.ForEach(current => current.FunctionKey = current.FunctionPath + " - " + MultilingualHelper.GetStringFromResource(current.FunctionKey));

            ViewBag.FunIDs = webCommonHelper.GetSelectList(entityList_FunVM, "FunctionKey", "ID", true);

            ModelState.Clear();
            TryValidateModel(organizationVM);

            if (!ErrorMsgHelper.CustomValiation(str_MsgBoxTitle, ModelState, ViewBag))
            {
                return(View(organizationVM));
            }

            string strError = "";

            WCFReturnResult entity_Return = new WCFReturnResult();

            webCommonHelper.CallWCFHelper(this, (entity_WCFAuthInfoVM) =>
            {
                entity_Return = orgMgtHelper.Value.Update(entity_WCFAuthInfoVM, organizationVM);
            });

            if (entity_Return != null && entity_Return.IsSuccess)
            {
                webCommonHelper.RefreshSeverSideSession(this, this.HttpContext, postOffice.LoginUserMgtSerPath);
            }

            if (entity_Return != null && entity_Return.StrList_Error.Count() > 0)
            {
                strError = string.Join("<br/>", entity_Return.StrList_Error.ToArray());
            }

            if (entity_Return != null && entity_Return.IsSuccess)
            {
                MsgInfo successMsgInfo = new MsgInfo();
                successMsgInfo.MsgTitle    = str_MsgBoxTitle;
                successMsgInfo.MsgDesc     = MultilingualHelper.GetStringFromResource(languageKey, "I000");
                successMsgInfo.MsgType     = MessageType.Success;
                TempData[ActionMessageKey] = successMsgInfo;
                return(RedirectToAction("Index"));
            }
            else
            {
                MsgInfo errorMsgInfo = new MsgInfo();
                errorMsgInfo.MsgTitle = str_MsgBoxTitle;
                errorMsgInfo.MsgDesc  = strError;
                errorMsgInfo.MsgType  = MessageType.ValidationError;
                ViewBag.ActionMessage = errorMsgInfo;
                return(View(organizationVM));
            }
        }