Пример #1
0
        public void CreateDesignation()
        {
            DesignationServiceClient client = null;

            try
            {
                string         userDesignation = Request.Params["ppUserDesignation"];
                UserDto        currentUser     = (UserDto)Session[Constants.SKCURRENTUSER];
                DesignationDto designation     = new DesignationDto();
                designation.DesignationName = userDesignation;
                designation.CreatedBy       = currentUser.UserId;
                designation.ModifiedBy      = currentUser.UserId;
                client      = new DesignationServiceClient();
                designation = client.Create(designation, currentUser.UserName);
                client.Close();
                if (designation.Response.HasWarning)
                {
                    foreach (BusinessWarning businessWarning in designation.Response.BusinessWarnings)
                    {
                        ViewData["Error"] = "Designation Present";
                    }
                }
                else
                {
                    TempData["GroupSaved"] = "Designation Saved";
                }
            }
            catch (Exception)
            {
                if (client != null && client.State == System.ServiceModel.CommunicationState.Opened)
                {
                    client.Close();
                }
            }
        }
Пример #2
0
        public List <DesignationDto> GetUserDesignationList()
        {
            DesignationServiceReference.DesignationServiceClient client = new DesignationServiceClient();
            List <DesignationDto> designationdtos = client.FindAll().Entities.ToList();

            client.Close();
            designationdtos.Insert(0, new DesignationDto()
            {
                DesignationId = 0, DesignationName = "[Select]"
            });
            return(designationdtos);
        }
Пример #3
0
        public static List <DesignationDto> GetDesignations()
        {
            DesignationServiceReference.DesignationServiceClient Designationclient = new DesignationServiceClient();
            List <DesignationDto> Designationdto = Designationclient.FindAll().Entities.ToList();

            Designationclient.Close();
            Designationdto.Insert(0, new DesignationDto()
            {
                DesignationId = 0, DesignationName = "[Select]"
            });
            return(Designationdto);
        }
Пример #4
0
        public ActionResult CreateNewUserDesignation()
        {
            DesignationServiceClient client   = null;
            string           Prefix           = Request.Params["prefix"];
            DesignationModel designationModel = new DesignationModel(Prefix);

            try
            {
                string         userDesignation = Request.Params["ppUserDesignation"];
                UserDto        currentUser     = (UserDto)Session[Constants.SKCURRENTUSER];
                DesignationDto designation     = new DesignationDto();
                designation.DesignationName = userDesignation;
                designation.CreatedBy       = currentUser.UserId;
                designation.ModifiedBy      = currentUser.UserId;
                client = new DesignationServiceClient();
                currentUser.ViewOfUserUserGroupRolePermissions = null;
                designation = client.Create(designation, currentUser.UserName);
                client.Close();
                if (designation.Response.HasWarning)
                {
                    foreach (BusinessWarning businessWarning in designation.Response.BusinessWarnings)
                    {
                        ViewData["Error"] = "Designation Present";
                    }
                }
                else
                {
                    TempData["DesignationId"] = designation.DesignationId.ToString();
                    TempData["GroupSaved"]    = "Designation Saved";
                }
            }
            catch (Exception)
            {
                if (client != null && client.State == System.ServiceModel.CommunicationState.Opened)
                {
                    client.Close();
                }
            }
            return(PartialView("CBPPopupAddDesignation", designationModel));
        }