Example #1
0
        public string SetStatusTrRed()
        {
            var cTicket = _ticketBs.GetCronTicketSetRed();

            if (cTicket.Count != 0)
            {
                foreach (Ticket item in cTicket)
                {
                    if (item.NextCommenter == item.Responder)
                    {
                        //set red flag responder
                        item.ResponderFlag = 1;
                    }
                    else
                    {
                        //set red flag submiter
                        item.SubmiterFlag = 1;
                    }
                    _ticketBs.Edit(item);

                    //send email
                    if (WebConfigure.GetSendEmail())
                    {
                        Email.SendMailFlagRed(item.NextCommenter);
                    }
                }
                return("Flag Updated");
            }
            return("Already Updated");
        }
Example #2
0
        private void UpdateDueDateTsManager(int id, int tsId)
        {
            var userUpdate = _userService.GetDetail(id);

            var userTsManagerModel = _userTsManagerService.GetDetail(tsId);

            var addDay = Common.NumberOfWorkDays(DateTime.Now, WebConfigure.GetApprovalTsManagerDay());

            if (tsId == 1)
            {
                userUpdate.UserTsManager1Id      = userTsManagerModel.UserTsManagerId;
                userUpdate.UserTsManager1Name    = userTsManagerModel.Name;
                userUpdate.UserTsManager1DueDate = DateTime.Now.AddDays(addDay);
            }
            else if (tsId == 2)
            {
                userUpdate.UserTsManager2Id      = userTsManagerModel.UserTsManagerId;
                userUpdate.UserTsManager2Name    = userTsManagerModel.Name;
                userUpdate.UserTsManager2DueDate = DateTime.Now.AddDays(addDay);
            }
            else if (tsId == 3)
            {
                userUpdate.UserTsManager3Id      = userTsManagerModel.UserTsManagerId;
                userUpdate.UserTsManager3Name    = userTsManagerModel.Name;
                userUpdate.UserTsManager3DueDate = DateTime.Now.AddDays(addDay);
            }

            userUpdate.UserTsManagerDueFlag = tsId;

            _userService.Edit(userUpdate);
        }
        public ActionResult UploadMepExcel()
        {
            try
            {
                if (Request.Files.Count > 0)
                {
                    var    file     = Request.Files["file"];
                    string response = Common.ValidateFileUpload(file);

                    if (response.Equals("true"))
                    {
                        if (file != null)
                        {
                            var fileName = "MEP" + Path.GetExtension(file.FileName);

                            var path = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/Upload/"), fileName);

                            file.SaveAs(path);

                            string oleDbConnectionString =
                                $@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={path};Extended Properties=""Excel 12.0 Xml;HDR=YES""";
                            DataTable dataTable = _mepBusinessService.CreateDataTable(oleDbConnectionString);
                            _mepBusinessService.BulkUpdateMep(dataTable, WebConfigure.GetMainConnectionString());
                        }
                    }
                }
                return(Content("<script language='javascript' type='text/javascript'>alert('Upload MEP Excel was Successfull'); location.href = '" + WebConfigure.GetDomain() + "/Admin/Default/Index';</script>"));
            }
            catch
            {
                return(Content("<script language='javascript' type='text/javascript'>alert('Upload MEP Excel was Failed, Please Make to Sure about format file to upload then'); location.href = '" + WebConfigure.GetDomain() + "/Admin/Default/Index';</script>"));
            }
        }
        public ActionResult UploadPSLPartExcel()
        {
            try
            {
                if (Request.Files.Count > 0)
                {
                    var    file     = Request.Files["file"];
                    string response = Common.ValidateFileUpload(file);

                    if (response.Equals("true"))
                    {
                        if (file != null)
                        {
                            var fileName = "PSLPart_File" + Path.GetExtension(file.FileName);
                            var path     = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/Upload/Document/"), fileName);
                            file.SaveAs(path);

                            string csvConnectionString = "Driver={Microsoft Text Driver (*.txt; *.csv)};Dbq=" + path +
                                                         ";Extensions=asc,csv,tab,txt;Persist Security Info=False";
                            string oleDbConnectionString =
                                $@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={path};Extended Properties=""Excel 12.0 Xml;HDR=YES""";
                            DataTable dataTable = _mepBusinessService.CreateTablePSLPart(path);
                            _mepBusinessService.BulkUpdatePSLPart(dataTable, WebConfigure.GetMainConnectionString());
                        }
                    }
                }

                return(Content("<script language='javascript' type='text/javascript'>alert('Upload PSLPart Data Excel is Successfull'); location.href = '" + WebConfigure.GetDomain() + "/Admin/Default/Index';</script>"));
            }
            catch (Exception ex)
            {
                _logErrorBService.WriteLog("Admin Upload PSLPart", MethodBase.GetCurrentMethod().Name, ex.ToString());
                return(Content("<script language='javascript' type='text/javascript'>alert('Upload PSLPart Data was Failed, Please Make to Sure About Format File and then upload again'); location.href = '" + WebConfigure.GetDomain() + "/Admin/Default/Index';</script>"));
            }
        }
        public ActionResult GetPSLIdPIPPriority(string parentarea, string salesOffice, string dateRangeFrom, string dateRangeEnd, string inventory, string rental, string hid, string others, string pslType, string storeName, string area)
        {
            var splitPSLType   = new string[] { };
            var splitArea      = new string[] { };
            var splitStoreName = new string[] { };

            if (!string.IsNullOrWhiteSpace(pslType))
            {
                splitPSLType = pslType.Split(',');
            }
            if (!string.IsNullOrWhiteSpace(storeName))
            {
                splitStoreName = storeName.Split(',');
            }
            if (!string.IsNullOrWhiteSpace(area))
            {
                splitArea = area.Split(',');
            }
            var modelFormCollection = new GetFormCollectionPSLCompletionPip();

            modelFormCollection.DateRangeFrom           = dateRangeFrom;
            modelFormCollection.DateRangeEnd            = dateRangeEnd;
            modelFormCollection.Inventory               = inventory;
            modelFormCollection.Rental                  = rental;
            modelFormCollection.HID                     = hid;
            modelFormCollection.Others                  = others;
            modelFormCollection.Area                    = area;
            modelFormCollection.PSLId                   = "";
            modelFormCollection.PSLType                 = pslType;
            modelFormCollection.StoreName               = "";
            ViewBag.ModelFormCollectionPSLCompletionPip = modelFormCollection;
            ViewBag.ListPSLIdPipPriority                = pslBS.GetListPSLIdForCompletionPipPriority(parentarea, salesOffice, dateRangeFrom, dateRangeEnd, inventory, rental, hid, others, splitPSLType, splitArea, splitStoreName);
            ViewBag.Domain = WebConfigure.GetDomain();
            return(View());
        }
Example #6
0
        // GET: Library/Details/5
        public ActionResult Detail(int id)
        {
            if (Session["userid"] == null)
            {
                return(RedirectToAction("Login", "Account"));
            }

            if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj() != "" && Session["userid"] == null)
            {
                return(RedirectToAction("Login", "Account"));
            }
            if (Session["username"] != null)
            {
                if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower())
                {
                    return(RedirectToAction("Login", "Account"));
                }
            }

            var articleModel = _literatureService.GetDetail(id);

            var listArticleFileModel = _articleFileBs.GetListByArtikelId(id);

            ViewBag.ListFile = listArticleFileModel.Count == 0 ? null : listArticleFileModel;

            ViewBag.UseFullLink = _articleBs.getUseFullLink();
            return(View(articleModel));
        }
        public ActionResult UploadUserGuide()
        {
            try
            {
                if (Request.Files.Count > 0)
                {
                    var    file     = Request.Files["file"];
                    string response = Common.ValidateFileUpload(file);

                    if (response.Equals("true"))
                    {
                        if (file != null)
                        {
                            var fileName = Path.GetFileNameWithoutExtension(WebConfigure.GetUserGuideNameFileWithExtention()) + Path.GetExtension(file.FileName);

                            var path = Path.Combine(System.Web.HttpContext.Current.Server.MapPath("~/Upload/Document"), fileName);

                            file.SaveAs(path);
                        }
                    }
                }
                return(Content("<script language='javascript' type='text/javascript'>alert('Upload User Guide was Successfull'); location.href = '" + WebConfigure.GetDomain() + "/Admin/Default/Index';</script>"));
            }
            catch
            {
                return(Content("<script language='javascript' type='text/javascript'>alert('Upload User Guide was Failed, Please Make to Sure About Format File and then upload it'); location.href = '" + WebConfigure.GetDomain() + "/Admin/Default/Index';</script>"));
            }
        }
        public ActionResult Approve2Mail(User user, FormCollection collect)
        {
            string token = Common.AccessToken() + user.EmployeeId;

            token = token.Replace("/", "");
            token = token.Replace("+", "");

            var employeeM = _mstEmployeeBService.GetDetail(user.Approval2);

            var userTsManagerModel = _userTsManagerBusinessService.GetDetail(1);
            var Spv1 = _mstEmployeeBService.GetDetail(_mstEmployeeBService.GetDetail(user.EmployeeId).Superior_ID);
            var Spv2 = _mstEmployeeBService.GetDetail(Spv1.Superior_ID);
            //next to approval 2
            var userT = _userBService.GetDetail(user.UserId);

            userT.Status        = 5;
            userT.UpdatedAt     = DateTime.Now;
            userT.MobileToken   = token;
            userT.NameApproval2 = employeeM.Employee_Name;
            userT.DateApproval2 = DateTime.Now;

            userT.UserTsManager1Id   = userTsManagerModel.UserTsManagerId;
            userT.UserTsManager1Name = userTsManagerModel.Name;
            var addDay = Common.NumberOfWorkDays(DateTime.Now, WebConfigure.GetApprovalTsManagerDay());

            userT.UserTsManager1DueDate = DateTime.Now.AddDays(addDay);
            userT.UserTsManagerDueFlag  = 1;

            _userBService.Edit(userT);


            //insert UserMessage
            UserMessage userM = Factory.Create <UserMessage>("UserMessage", ClassType.clsTypeDataModel);

            userM.Message        = String.IsNullOrWhiteSpace(collect["approveMsg"]) ? "" : collect["approveMsg"];
            userM.MessageType    = "Approve 2";
            userM.ToUserId       = Convert.ToInt32(collect["UserId"]);
            userM.CreatedAt      = DateTime.Now;
            userM.ToEmployeeId   = userT.EmployeeId;
            userM.FromEmployeeId = userT.Approval2;

            _userMessageBService.Add(userM);

            Dictionary <String, EmployeeMaster> ApprovalData = new Dictionary <string, EmployeeMaster>();
            Dictionary <String, String>         Message      = new Dictionary <String, String>();

            ApprovalData.Add("Approval1", Spv1);
            ApprovalData.Add("Approval2", Spv2);
            ApprovalData.Add("ApprovalTS", _mstEmployeeBService.GetDetail(userTsManagerModel.EmployeeId));

            Message.Add("Approval1", _userMessageBService.GetDetail(Spv1.Employee_Id, 0, "Approve 1 - Registering").Message);
            Message.Add("Approval2", _userMessageBService.GetDetail(Spv2.Employee_Id, 0, "Approve 2 - Registering").Message);
            Message.Add("ApprovalTS", collect["ApproveMsg"]);


            //Send Email TsManager
            Email.SendMailNeedAppTs1(userT, 1, userM.Message);
            Email.SendMailResApp1(userT, userM.Message, 2, 1);
            return(RedirectToAction("ApproveList"));
        }
        private bool LoginValidate(User model)
        {
            bool ret;

            if (WebConfigure.GetLoginPortal() == "false")
            {
                return(true);
            }

            if (Common.GetUserXupj().ToLower() != model.Username.ToLower())
            {
                ModelState.AddModelError("Username", "Username and Login portal not match");
                ret = false;
            }
            else if (_userBService.CheckUserName(model.Username))
            {
                ret = true;
            }
            else
            {
                ModelState.AddModelError("Username", "Username not active or not registered");
                ret = false;
            }
            return(ret);
        }
Example #10
0
        public IHttpActionResult Post(ApiJsonDraw apiDraw, String level, String category, String keyword)
        {
            ApiJsonStatus apiJsonStatusM = Factory.Create <ApiJsonStatus>("ApiJsonStatus", ClassType.clsTypeDataModel);

            apiJsonStatusM.code    = 200;
            apiJsonStatusM.message = "Post ok " + apiDraw.draw;

            var start = 6 * (apiDraw.draw - 1);

            List <ArticleListJson> aljModel = new List <ArticleListJson>();

            var alModel = _articleBs.GetListApproved(start, level, category, keyword);

            foreach (var item in alModel)
            {
                ArticleListJson    ajModel  = Factory.Create <ArticleListJson>("ArticleListJson", ClassType.clsTypeDataModel);
                ArticleListJsonImg ajiModel = Factory.Create <ArticleListJsonImg>("ArticleListJsonImg", ClassType.clsTypeDataModel);

                string attachmentsPath = WebConfigure.GetDomain() + "/Upload/Article/Header/";
                ajiModel.src      = attachmentsPath + item.HeaderImage;
                ajiModel.label    = item.Category1;
                ajiModel.alt      = item.Category1;
                ajModel.img       = ajiModel;
                ajModel.link      = WebConfigure.GetDomain() + "/Library/Detail/" + item.ArticleId;
                ajModel.group_url = WebConfigure.GetDomain() + "/Library?category=" + item.Category1Id;
                ajModel.title     = item.Title;
                ajModel.text      = Common.GetShortDescription(item.Description);
                ajModel.type      = "Article";
                ajModel.date      = item.CreatedAt?.ToString("dd MMM yyyy");

                aljModel.Add(ajModel);
            }
            return(Ok(new { status = apiJsonStatusM, data = aljModel }));
        }
        public ActionResult Login()
        {
            ViewBag.connmain = SharepointHelper.PushConf()["primaindb"];
            ViewBag.connsec  = SharepointHelper.PushConf()["secdbempmst"];
            try
            {
                ViewBag.UrlApp     = WebConfigure.GetDomain();
                ViewBag.CheckLogin = WebConfigure.GetLoginPortal();

                if (Common.CheckAdmin())
                {
                    _userBService.EndDelegate();
                    return(View());
                }
                else
                {
                    return(RedirectToAction("Index", "Default"));
                }
            }
            catch (Exception er)
            {
                _logErrorBService.WriteLog("Account", MethodBase.GetCurrentMethod().Name, er.ToString());

                throw;
            }
        }
        // GET: Library/Delete/5
        public ActionResult Delete(int id)
        {
            if (Session["userid"] == null)
            {
                return(RedirectToAction("Login", "Account"));
            }

            if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower())
            {
                return(RedirectToAction("Login", "Account"));
            }

            Article articleObject = _articleBs.Detail(id);

            ViewBag.UseFullLink = _articleBs.getUseFullLink().Count > 0 ? _articleBs.getUseFullLink() : null;
            SetDropdownArtikelCategory(articleObject);

            var tags = _articleTagsService.GetTagsByArticle(id);

            ViewBag.Tags = tags;
            var attachments = _articleFileBs.GetListByArtikelId(id);
            List <TicketAttachmentsAPI> listAttachment = new List <TicketAttachmentsAPI>();
            string attachmentsPath = System.Web.HttpContext.Current.Server.MapPath("~/Upload/Article/");

            if (attachments != null)
            {
                string[] imgExt = { ".jpg", ".png", ".jpeg", ".gif", ".bmp", ".tif", ".tiff" };
                foreach (var attachment in attachments)
                {
                    if (imgExt.Contains(Path.GetExtension(attachment.Name)))
                    {
                        listAttachment.Add(new TicketAttachmentsAPI
                        {
                            Id   = attachment.ArticleFileId,
                            Name = Common.ImageToBase64(attachmentsPath + attachment.Name),
                            Type = Path.GetExtension(attachment.Name),
                            NameWithOutBase64 = attachment.Name
                        });
                    }
                    else
                    {
                        listAttachment.Add(new TicketAttachmentsAPI
                        {
                            Id   = attachment.ArticleFileId,
                            Name = attachment.Name,
                            Type = Path.GetExtension(attachment.Name),
                            NameWithOutBase64 = attachment.Name
                        });
                    }
                }
            }
            ViewBag.Attachments = listAttachment;
            ViewBag.HeaderImg   = WebConfigure.GetDomain() + "/Upload/Article/Header/" + articleObject.HeaderImage;
            if (articleObject == null)
            {
                return(HttpNotFound());
            }
            return(View(articleObject));
        }
 public ActionResult SubCategory(int parent = 0)
 {
     #region Category
     ViewBag.Domain            = WebConfigure.GetDomain();
     ViewBag.ListCategoryChild = _ArticleCategoryBs.GetListCategoryMostUsedSort(parent);
     #endregion
     return(View());
 }
Example #14
0
        // GET: Admin/Articles/Edit/5
        public ActionResult Edit(int id)
        {
            if (Common.CheckAdmin())
            {
                return(RedirectToAction("Login", "Default"));
            }
            ViewBag.Domain = WebConfigure.GetDomain() + "/Upload/Article/Attachments/";
            Article articleObject = _articleService.Detail(id);

            SetDropdownArtikelCategory(articleObject);

            var tags = _articleTagsService.GetTagsByArticle(id);

            ViewBag.Tags = tags;
            //Attachment
            var attachments = _articleFileBs.GetListByArtikelId(id);
            List <TicketAttachmentsAPI> listAttachment = new List <TicketAttachmentsAPI>();
            string attachmentsPath = System.Web.HttpContext.Current.Server.MapPath("~/Upload/Article/Attachments/");

            if (attachments != null)
            {
                string[] imgExt = { ".jpg", ".png", ".jpeg", ".gif", ".bmp", ".tif", ".tiff" };
                foreach (var attachment in attachments)
                {
                    if (imgExt.Contains(Path.GetExtension(attachment.Name)))
                    {
                        listAttachment.Add(new TicketAttachmentsAPI
                        {
                            Id                = attachment.ArticleFileId,
                            Name              = Common.ImageToBase64(attachmentsPath + attachment.Name),
                            Level             = attachment.LevelUser,
                            Type              = Path.GetExtension(attachment.Name),
                            NameWithOutBase64 = attachment.Name
                        });
                    }
                    else
                    {
                        listAttachment.Add(new TicketAttachmentsAPI
                        {
                            Id                = attachment.ArticleFileId,
                            Name              = attachment.Name,
                            Level             = attachment.LevelUser,
                            Type              = Path.GetExtension(attachment.Name),
                            NameWithOutBase64 = attachment.Name
                        });
                    }
                }
            }
            ViewBag.Attachments = listAttachment;
            ViewBag.HeaderImg   = WebConfigure.GetDomain() + "/Upload/Article/Header/" + articleObject.HeaderImage;
            ViewBag.DefaultImg  = WebConfigure.GetDomain() + "/Upload/attachment-default.png";
            ViewBag.EmptyImg    = WebConfigure.GetDomain() + "/assets/images/repository/empty-image.jpg";
            if (articleObject == null)
            {
                return(HttpNotFound());
            }
            return(View(articleObject));
        }
Example #15
0
 public ActionResult Testing(int parent = 0)
 {
     #region Category
     ViewBag.Download          = WebConfigure.GetDomain() + "/Upload/Document/" + WebConfigure.GetUserGuideNameFileWithExtention();
     ViewBag.Domain            = WebConfigure.GetDomain();
     ViewBag.ListCategoryChild = _articleCategoryBs.GetListCategoryMostUsedLiterature(parent); /*_articleCategoryBs.GetListMainCategory(parent);*/
     #endregion
     return(View());
 }
Example #16
0
 private String domain(Boolean isLocal = true)
 {
     if (isLocal == true)
     {
         return("http://localhost/TSICS");
     }
     else
     {
         return(WebConfigure.GetDomain());
     }
 }
Example #17
0
        // GET: Admin/Articles/Create
        public ActionResult Create()
        {
            if (Common.CheckAdmin())
            {
                return(RedirectToAction("Login", "Default"));
            }
            ViewBag.EmptyImg      = WebConfigure.GetDomain() + "/assets/images/repository/empty-image.jpg";
            ViewBag.ListCategory1 = _articleCategoryBs.GetListParent(0);

            return(View());
        }
        public ActionResult Create()
        {
            ViewBag.Domain = WebConfigure.GetDomain();
            if (Common.CheckAdmin())
            {
                return(RedirectToAction("Login", "Default"));
            }
            var UserData = _userBService.GetListUserNonDelegate();

            ViewBag.Userlist = UserData;

            return(View());
        }
Example #19
0
        private void UpdateUserRejectMessage(User userT)
        {
            //insert UserMessage
            UserMessage userM = Factory.Create <UserMessage>("UserMessage", ClassType.clsTypeDataModel);

            userM.Message        = "Reject by System after " + WebConfigure.GetApprovalSpvDay() + " days";
            userM.MessageType    = "Auto Reject";
            userM.ToUserId       = userT.UserId;
            userM.CreatedAt      = DateTime.Now;
            userM.ToEmployeeId   = userT.EmployeeId;
            userM.FromEmployeeId = userT.Status == 2 ? userT.Approval1 : userT.Approval2;

            _userMessageBService.Add(userM);
        }
Example #20
0
        public ActionResult FileNotFound()
        {
            if (Session["userid"] == null)
            {
                return(RedirectToAction("Login", "Account"));
            }

            if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower())
            {
                return(RedirectToAction("Login", "Account"));
            }

            ViewBag.Alert = "File Not Found";
            return(View("Index", "Literation"));
        }
        public ActionResult Approve1Mail(string id)
        {
            ViewBag.UseFullLink = _articleBs.getUseFullLink().Count > 0 ? _articleBs.getUseFullLink() : null;
            var articleData = _articleBs.GetDetailbyToken(id);
            var userData    = _userBService.GetDetail(articleData.CreatedBy);

            ViewBag.User      = userData;
            ViewBag.RoleLevel = _userRoleBService.GetDetail(userData.RoleId).Name;

            ViewBag.App1          = _mstEmployeeBService.GetDetail(_mstEmployeeBService.GetDetail(userData.EmployeeId).Superior_ID);
            ViewBag.DomainLink    = WebConfigure.GetDomain();
            ViewBag.RecentArticle = _articleBs.GetRecent();
            ViewBag.UseFullLink   = _articleBs.getUseFullLink();
            return(View(articleData));
        }
        public ActionResult Approve1Mail(User user, FormCollection collect)
        {
            string token = Common.AccessToken() + user.EmployeeId;

            token = token.Replace("/", "");
            token = token.Replace("+", "");

            var employeeM = _mstEmployeeBService.GetDetail(user.Approval1);

            //next to approval 2
            var userT = _userBService.GetDetail(user.UserId);

            userT.Status        = 3;
            userT.UpdatedAt     = DateTime.Now;
            userT.MobileToken   = token;
            userT.Approval2     = employeeM.Superior_ID;
            userT.NameApproval1 = employeeM.Employee_Name;
            userT.DateApproval1 = DateTime.Now;

            var addDay = Common.NumberOfWorkDays(DateTime.Now, WebConfigure.GetApprovalSpvDay());

            userT.DueDateApproval2 = DateTime.Now.AddDays(addDay);

            userT = _userBService.Edit(userT);


            //insert UserMessage
            UserMessage userM = Factory.Create <UserMessage>("UserMessage", ClassType.clsTypeDataModel);

            userM.Message     = String.IsNullOrWhiteSpace(collect["ApproveMsg"]) ? "" : collect["ApproveMsg"];
            userM.MessageType = "Approve 1";
            userM.ToUserId    = Convert.ToInt32(collect["UserId"]);
            //UserM.FromUserId = Convert.ToInt32(Session["userid"]);
            userM.CreatedAt      = DateTime.Now;
            userM.ToEmployeeId   = userT.EmployeeId;
            userM.FromEmployeeId = userT.Approval1;


            _userMessageBService.Add(userM);

            //Send Email to Approval 1 Status Approve
            Email.SendMailResApp1(userT, userM.Message, 1, 1);

            //Send Email to Approval 2 Need Approve
            Email.SendMailNeedApp2(userT, userM.Message);

            return(RedirectToAction("ApproveList"));
        }
        public ActionResult GetSalesOfficePIPPriority(string parent, string dateRangeFrom, string dateRangeEnd, string inventory, string rental, string hid, string others, string pslType, string storeName, string area)
        {
            var splitPSLType   = new string[] { };
            var splitArea      = new string[] { };
            var splitStoreName = new string[] { };

            if (!string.IsNullOrWhiteSpace(pslType))
            {
                splitPSLType = pslType.Split(',');
            }
            if (!string.IsNullOrWhiteSpace(storeName))
            {
                splitStoreName = storeName.Split(',');
            }
            if (!string.IsNullOrWhiteSpace(area))
            {
                splitArea = area.Split(',');
            }
            var           PSLData     = pslBS.GetListSalesOfficeForCompletionPipPriority(parent, dateRangeFrom, dateRangeEnd, inventory, rental, hid, others, splitPSLType, splitArea, splitStoreName);
            List <Ticket> PSLDataTemp = new List <Ticket>();

            foreach (var item in PSLData)
            {
                Ticket tempPSL = new Ticket()
                {
                    Title    = item.Replace(" ", ""),
                    TicketNo = item
                };
                PSLDataTemp.Add(tempPSL);
            }
            var modelFormCollection = new GetFormCollectionPSLCompletionPip();

            modelFormCollection.DateRangeFrom           = dateRangeFrom;
            modelFormCollection.DateRangeEnd            = dateRangeEnd;
            modelFormCollection.Inventory               = inventory;
            modelFormCollection.Rental                  = rental;
            modelFormCollection.HID                     = hid;
            modelFormCollection.Others                  = others;
            modelFormCollection.Area                    = parent;
            modelFormCollection.PSLId                   = pslType;
            modelFormCollection.PSLType                 = "";
            modelFormCollection.StoreName               = "";
            ViewBag.ModelFormCollectionPSLCompletionPip = modelFormCollection;
            ViewBag.ListSalesOfficePipPriority          = PSLDataTemp;
            ViewBag.AreaPriority = parent;
            ViewBag.Domain       = WebConfigure.GetDomain();
            return(View());
        }
 public ActionResult Draft()
 {
     ViewBag.UseFullLink = _articleBs.getUseFullLink().Count > 0 ? _articleBs.getUseFullLink() : null;
     if (Session["userid"] == null)
     {
         return(View("LoginRedirect"));
     }
     else
     {
         if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower())
         {
             return(View("LoginRedirect"));
         }
         return(View(_articleBs.GetMyDraft(Convert.ToInt32(Session["userid"]))));
     }
 }
        // GET: Library/Details/5
        public ActionResult Detail(int id)
        {
            if (Session["userid"] == null)
            {
                return(RedirectToAction("Login", "Account"));
            }

            if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower())
            {
                return(RedirectToAction("Login", "Account"));
            }

            try
            {
                if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj() != "" && Session["userid"] == null)
                {
                    return(RedirectToAction("Login", "Account"));
                }
                if (Session["username"] != null)
                {
                    if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower())
                    {
                        return(RedirectToAction("Login", "Account"));
                    }
                }

                var articleModel = _articleBs.Approved(id);

                var listArticleFileModel = _articleFileBs.GetListByArtikelId(id);
                var listArticleTagsModel = _articleTagsService.GetTagsByArticle(id);

                ViewBag.ListFile   = listArticleFileModel.Count == 0 ? null : listArticleFileModel;
                ViewBag.ArticleTag = listArticleTagsModel.Count == 0 ? null : listArticleTagsModel;
                ViewBag.PathImg    = articleModel.HeaderImage == null?WebConfigure.GetDomain() + "/assets/images/repository/empty-image.jpg" : WebConfigure.GetDomain() + "/Upload/Article/Header/" + articleModel.HeaderImage;

                ViewBag.Domain = WebConfigure.GetDomain();

                ViewBag.RecentArticle = _articleBs.GetRecent();
                ViewBag.UseFullLink   = _articleBs.getUseFullLink().Count > 0 ? _articleBs.getUseFullLink() : null;
                return(View(articleModel));
            }
            catch (Exception ex)
            {
                _logErrorBService.WriteLog("Detail Library", MethodBase.GetCurrentMethod().Name, ex.ToString());
                throw;
            }
        }
        // GET: Account
        public ActionResult Index()
        {
            ViewBag.Download = WebConfigure.GetDomain() + "/Upload/Document/" + WebConfigure.GetUserGuideNameFileWithExtention();
            if (Session["userid"] == null)
            {
                return(RedirectToAction("Login", "Account"));
            }
            else
            {
                //if (Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower())
                //{
                //    return RedirectToAction("Login", "Account");
                //}
                var userT = _userBService.GetDetail(Convert.ToInt32(Session["userid"]));

                ViewBag.MsgReject = _userMessageBService.GetListByEmployeeId(userT.EmployeeId);
                User app1 = userT.Approval1 == 0 ? null : _userBService.GetDetailByEmployeeId(userT.Approval1);
                User app2 = userT.Approval2 == 0 ? null : _userBService.GetDetailByEmployeeId(userT.Approval2);

                EmployeeMaster userEmpMst = _mstEmployeeBService.GetDetailbyUserName(userT.Username);
                EmployeeMaster empMstApp1 = userEmpMst == null ? null : _mstEmployeeBService.GetDetail(userEmpMst.Superior_ID);
                EmployeeMaster empMstApp2 = empMstApp1 == null ? null : _mstEmployeeBService.GetDetail(empMstApp1.Superior_ID);
                ViewBag.App1       = app1 == null ? null : app1;
                ViewBag.App2       = app2 == null ? null : app2;
                ViewBag.empMstApp1 = empMstApp1 == null ? null : empMstApp1;
                ViewBag.empMstApp2 = empMstApp2 == null ? null : empMstApp2;
                UserTsManager tsmanager = userT.UserTsManager1Id == 0 ? null : _userTsManagerBusinessService.GetDetail(userT.UserTsManager1Id);
                ViewBag.TSManager = tsmanager == null ? null : _userBService.GetDetailByEmployeeId(tsmanager.EmployeeId);
                ViewBag.Recent    = _ticketBs.GetRecent();
                var Employemst = _mstEmployeeBService.GetDetail(userT.EmployeeId);
                if (Employemst == null)
                {
                    ViewBag.EmployeeMaster_empId    = String.Empty;
                    ViewBag.EmployeeMaster_POH_Id   = String.Empty;
                    ViewBag.EmployeeMaster_POH_Name = "-";
                }
                else
                {
                    ViewBag.EmployeeMaster_empId    = Convert.ToString(Employemst.Employee_Id);
                    ViewBag.EmployeeMaster_POH_Id   = string.IsNullOrWhiteSpace(Employemst.Business_Area) ? "-" : "ID : " + Employemst.Business_Area;
                    ViewBag.EmployeeMaster_POH_Name = string.IsNullOrWhiteSpace(Employemst.Business_Area_Desc) ? "-" : Employemst.Business_Area_Desc;
                }
                return(View(userT));
            }
        }
 public ActionResult List()
 {
     ViewBag.UseFullLink = _articleBs.getUseFullLink().Count > 0 ? _articleBs.getUseFullLink() : null;
     if (Session["userid"] == null)
     {
         return(View("LoginRedirect"));
     }
     else
     {
         if (WebConfigure.GetLoginPortal() == "true" && Common.GetUserXupj().ToLower() != Session["username"].ToString().ToLower())
         {
             return(View("LoginRedirect"));
         }
         var         listArtikel = _articleBs.GetMyList(Convert.ToInt32(Session["userid"]));
         List <User> userData    = new List <User>();
         if (listArtikel != null)
         {
             foreach (var item in listArtikel)
             {
                 User userdata = _userBService.GetDetail(item.CreatedBy);
                 if (userdata != null)
                 {
                     User userobject = new User()
                     {
                         UserId = item.ArticleId,
                         Name   = userdata.Name
                     };
                     userData.Add(userobject);
                 }
                 else
                 {
                     User userobject = new User()
                     {
                         UserId = item.ArticleId,
                         Name   = null
                     };
                     userData.Add(userobject);
                 }
             }
         }
         ViewBag.UserData = userData;
         return(View(listArtikel));
     }
 }
        public ActionResult ApproveTsMail(string id)
        {
            ViewBag.UseFullLink = _articleBs.getUseFullLink().Count > 0 ? _articleBs.getUseFullLink() : null;
            var articleData = _articleBs.GetDetailbyToken(id);
            var userData    = _userBService.GetDetail(articleData.CreatedBy);
            var app1        = _mstEmployeeBService.GetDetail(articleData.Aproved1By);
            var app2        = _mstEmployeeBService.GetDetail(articleData.Aproved2By);

            ViewBag.App1             = app1;
            ViewBag.App2             = app2;
            ViewBag.TsManager        = _userTsManagerBusinessService.GetDetail(1);
            ViewBag.User             = userData;
            ViewBag.RoleLevel        = _userRoleBService.GetDetail(userData.RoleId).Name;
            ViewBag.MessageResponse1 = _userMessageBService.GetDetail(app1.Employee_Id, articleData.ArticleId, "Article");
            ViewBag.MessageResponse2 = _userMessageBService.GetDetail(app2.Employee_Id, articleData.ArticleId, "Article");
            ViewBag.DomainLink       = WebConfigure.GetDomain();
            ViewBag.RecentArticle    = _articleBs.GetRecent();
            ViewBag.UseFullLink      = _articleBs.getUseFullLink();
            return(View(articleData));
        }
        // GET: Admin/Category

        public ActionResult Index(String SearchString = "")
        {
            if (Common.CheckAdmin())
            {
                return(RedirectToAction("Login", "Default"));
            }

            //int pageSize = 100;
            //int pageNumber = (page ?? 1);

            ViewBag.Domain = WebConfigure.GetDomain();
            if (String.IsNullOrWhiteSpace(SearchString))
            {
                ViewBag.ListCategoryChild = _ArticleCategoryBs.GetListCategoryMostUsedSort(0);
            }
            else
            {
                ViewBag.ListCategoryChild = _ArticleCategoryBs.GetList(SearchString);
            }
            return(View(/*_ArticleCategoryBs.GetList().ToPagedList(pageNumber, pageSize)*/));
        }
        public ActionResult Edit(int id)
        {
            ViewBag.Domain = WebConfigure.GetDomain();
            if (Common.CheckAdmin())
            {
                return(RedirectToAction("Login", "Default"));
            }
            Delegation delegation   = _userBService.GetDetailDelegation(id);
            User       fromUserData = _userBService.GetDetail(delegation.FromUser);
            User       toUserData   = _userBService.GetDetail(delegation.ToUser);

            ViewBag.FromUser  = fromUserData;
            ViewBag.ToUser    = toUserData;
            ViewBag.RoleName1 = _userRoleBService.GetDetail(fromUserData.RoleId).Name;
            ViewBag.RoleName2 = _userRoleBService.GetDetail(toUserData.RoleId).Name;
            var UserData = _userBService.GetListActive();

            ViewBag.Userlist = UserData;

            return(View(delegation));
        }