Ejemplo n.º 1
0
        //
        // GET: /Admin/
        public ActionResult Index()
        {
            // var list = _roleGroupService.GetAllRoleGroups().ToSelectListItems(-1);
            LoginFormModel obj = new LoginFormModel();
            //obj.ListRoleGroup = list;
            string ip = Request.UserHostName;

            LoginClass.Member member = LoginClass.GetMember(ip);
            obj.name = member.shortId;
            return(View(obj));
        }
Ejemplo n.º 2
0
        public ActionResult RejectReason(InvoiceViewModel obj)
        {
            var wwid = Session["wwid"].ToString();
            //var wwid = "11573963";

            UserInvoice uInvoice = new UserInvoice();

            uInvoice.CreatedDate = DateTime.Now.Date;
            uInvoice.InvoiceId   = obj.Id;
            uInvoice.isDelete    = false;
            uInvoice.isReject    = true;
            //uInvoice.rejectReason = obj.UserInvoices.LastOrDefault().rejectReason;
            uInvoice.rejectReason = obj.rejectReason;
            uInvoice.UserTableId  = obj.UserTableId;
            uInvoice.StatusId     = _statusService.GetAllStatuses().Where(p => p.StatusName.ToLower().Trim().Equals(obj.recentStatus.ToLower().Trim())).FirstOrDefault().Id;

            //        var requestor = "<strong>" + _userTableService.GetUserById(obj.UserTableId).UserName.ToString() + "</strong>";
            //        var rejector = "<strong>"+_userTableService.GetAllUsers().Where(p => p.WWID == int.Parse(wwid)).FirstOrDefault().UserName.ToString() + "</strong>";
            //string email = "*****@*****.**";



            Invoice inv = _invoiceService.GetInvoiceById(obj.Id);

            string[] array = inv.Note.ToString().Split('|');

            string RequestorId = array[0];
            string email       = array[1];
            string ManagerId   = array[2];

            // string rejector = "<strong>" +_userTableService.GetAllUsers().Where(p => p.WWID.ToString().Equals(ManagerId)).FirstOrDefault().UserName.ToString() + "<strong>";
            // string requestor = "<strong>"+_userTableService.GetAllUsers().Where(p => p.WWID.ToString().Equals(RequestorId)).FirstOrDefault().UserName.ToString() + "<strong>";


            LoginClass.Member Requestor = LoginClass.GetName(int.Parse(RequestorId.ToString()));
            LoginClass.Member Manager   = LoginClass.GetName(int.Parse(ManagerId.ToString()));
            string            requestor = "<strong>" + Requestor.ccMailName + "<strong>";
            string            rejector  = "<strong>" + Manager.ccMailName + "<strong>";
            string            banner    = "<img src='http://vimt.intel.com/Images/bannerVIMT.png'><br><br><br><br>";
            string            content   = banner + "Dear " + requestor + ", <br/> Your invoice " + "(ID: " + obj.requestID + ") was rejected by " + rejector + " <br/> <b>Reason: " + obj.rejectReason + "</b>.<br/>Best Sincerely ";

            // string email = "*****@*****.**";


            Mail.SendMail(content, email);
            _userInvoiceService.AddUserInvoice(uInvoice);

            return(RedirectToAction("Index"));
        }