public ActionResult CreateNotice(NoticeModel notice)
        {
            ActionResult retVal = null;

            if (ModelState.IsValid)
            {
                notice.PostedBy = SessionStateManager <UserInfo> .Data.Employee.EmployeeId;
                INoticeDTO noticeDTO = (INoticeDTO)DTOFactory.Instance.Create(DTOType.NoticeDTO);
                DTOConverter.FillDTOFromViewModel(noticeDTO, notice);

                INoticeFacade noticeFacade          = (INoticeFacade)FacadeFactory.Instance.Create(FacadeType.NoticeManagerFacade);
                OperationResult <INoticeDTO> result = noticeFacade.CreateNotice(noticeDTO);

                if (result.IsValid())
                {
                    retVal = new JsonResult()
                    {
                        Data = new
                        {
                            Message     = "Notice created Successfully",
                            Success     = true,
                            RedirectUrl = Url.Action("GetActiveNotices", "Notice")
                        },
                        JsonRequestBehavior = JsonRequestBehavior.AllowGet
                    };
                }
                else if (result.HasValidationFailed() && (result.ValidationResult != null))
                {
                    foreach (EmployeePortalValidationFailure error in result.ValidationResult.Errors)
                    {
                        ModelState.AddModelError(error.PropertyName, error.ErrorMessage);
                    }

                    retVal = PartialView("~/Views/Notice/_EditNotice.cshtml", notice);
                    //retVal = PartialView("~/Views/Shared/_CreateNotice.cshtml",notice);
                }
                else if (result.HasFailed())
                {
                    //retVal = RedirectToAction("GetActiveNotices", "Notice");
                    retVal = new JsonResult()
                    {
                        Data = new
                        {
                            Message     = "Notice Creation failed",
                            Success     = false,
                            RedirectUrl = Url.Action("GetActiceNotices")
                        },
                        JsonRequestBehavior = JsonRequestBehavior.AllowGet
                    };
                }
                else
                {
                    retVal = View("~/Views/Shared/Error.cshtml");
                }
            }
            return(retVal);
        }
        static void CreateNotice()
        {
            INoticeDTO noticeDTO = (INoticeDTO)DTOFactory.Instance.Create(DTOType.NoticeDTO);

            System.Console.WriteLine("Title : ");
            noticeDTO.Title = System.Console.ReadLine();

            System.Console.WriteLine("Description : ");
            noticeDTO.Description = System.Console.ReadLine();

            System.Console.WriteLine("Posted By : ");
            int postedBy;

            int.TryParse(System.Console.ReadLine(), out postedBy);
            noticeDTO.PostedBy = postedBy;

            System.Console.WriteLine("Start Date : ");
            DateTime startDate;

            DateTime.TryParse(System.Console.ReadLine(), out startDate);
            noticeDTO.StartDate = startDate;

            System.Console.WriteLine("Expiration Date : ");
            DateTime expirationDate;

            DateTime.TryParse(System.Console.ReadLine(), out expirationDate);
            noticeDTO.ExpirationDate = expirationDate;

            INoticeFacade noticeFacade = (INoticeFacade)FacadeFactory.Instance.Create(FacadeType.NoticeManagerFacade);
            OperationResult <INoticeDTO> createNoticesRetValue = noticeFacade.CreateNotice(noticeDTO);

            if (createNoticesRetValue.IsValid())
            {
                System.Console.WriteLine("Notice created!!  Id  : " + createNoticesRetValue.Data.NoticeId);
            }
            else
            {
                System.Console.WriteLine(createNoticesRetValue.Data + "   " + createNoticesRetValue.Message);
            }
        }