コード例 #1
0
        public ActionResult Form(long?id)
        {
            try
            {
                if (id == null)
                {
                    user = (OCCUSER)Session["User"];
                    ViewBag.BRANCHCODE = new SelectList(db.BRANCHINFO, "ID", "BRANCHNAME");
                    CARDCHEREUISITION ccreq = new CARDCHEREUISITION();
                    //if (user.BRANCH != null)
                    //{
                    //    ccreq.BRANCHCODE = (long)user.BRANCH;
                    //}
                    long status = db.OCCENUMERATION.Where(x => x.Name == "applied").Select(x => x.ID).FirstOrDefault();
                    ViewBag.STATUSID = new SelectList(db.OCCENUMERATION.Where(x => x.Type == "chequereq"), "ID", "Name", status);
                    ViewBag.STATUS   = status;
                    ccreq.CREATEDON  = DateTime.Now;
                    return(View(ccreq));
                }
                CARDCHEREUISITION cardchereuisition = db.CARDCHEREUISITION.Find(id);
                if (cardchereuisition == null)
                {
                    return(HttpNotFound());
                }
                ViewBag.BRANCHCODE = new SelectList(db.BRANCHINFO, "ID", "BRANCHNAME", cardchereuisition.BRANCHCODE);

                ViewBag.STATUSID = new SelectList(db.OCCENUMERATION.Where(x => x.Type == "chequereq"), "ID", "Name", cardchereuisition.STATUS);

                return(View(cardchereuisition));
            }
            catch (Exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #2
0
        public ActionResult DelivaryPost(IEnumerable <long> idList)
        {
            OCCUSER user = (OCCUSER)Session["User"];

            try
            {
                foreach (var id in idList)
                {
                    var chequereq = db.CARDCHEREUISITION.Find(id);
                    var statusId  = db.OCCENUMERATION.Where(x => x.Type == "chequereq")
                                    .Where(x => x.Name == "delivered")
                                    .Select(x => x.ID)
                                    .FirstOrDefault();
                    chequereq.DELIVEREDBY     = user.ID;
                    chequereq.DELIVEREDON     = DateTime.Now;
                    chequereq.STATUS          = statusId;
                    db.Entry(chequereq).State = EntityState.Modified;
                    db.SaveChanges();
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #3
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult PostAuthList(IEnumerable <long> idList)
        {
            List <CARDCHEREUISITION> UpdatedList = new List <CARDCHEREUISITION>();
            long count = 1;

            try
            {
                OCCUSER user = (OCCUSER)Session["User"];

                foreach (var id in idList)
                {
                    var cheueReq = db.CARDCHEREUISITION.FirstOrDefault(x => x.ID == id);
                    cheueReq.STATUS       = db.OCCENUMERATION.Where(x => x.Type == "chequereq").Where(x => x.Name == "authorized").Select(x => x.ID).FirstOrDefault();
                    cheueReq.AUTHORIZEDBY = user.ID;
                    cheueReq.AUTHORIZEDON = DateTime.Now;
                    UpdatedList.Add(cheueReq);
                }

                foreach (var editedChqRq in UpdatedList)
                {
                    db.Entry(editedChqRq).State = EntityState.Modified;
                    db.SaveChanges();
                }
                // var authorizedList = db.CARDCHEREUISITION.Where(x => x.STATUS == 4).ToList();
                return(RedirectToAction("RequisitionRequest"));
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #4
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult UserCreation(OCCUSER occuser, int?BranchId)
        {
            try
            {
                if (!UserAlreadyExist(occuser.EMPLOYEEID))
                {
                    OCCUSER user = (OCCUSER)Session["User"];
                    occuser.CREATEDBY = user.ID;
                    occuser.CREATEDON = DateTime.Now;
                    occuser.ISACTIVE  = true;
                    occuser.BRANCH    = BranchId;
                    if (ModelState.IsValid)
                    {
                        db.OCCUSER.Add(occuser);
                        db.SaveChanges();
                        var msg = "Data saved successfully. ";

                        return(Json(msg, JsonRequestBehavior.AllowGet));
                    }


                    ViewBag.BRANCH = new SelectList(db.BRANCHINFO.ToList(), "ID", "BRANCHNAME", BranchId);
                    ViewBag.TYPE   = new SelectList(db.OCCENUMERATION.Where(x => x.Type == "user").ToList(), "ID", "Name", occuser.TYPE);
                    return(View());
                }
                var mymsg = "User Already Exists";
                return(Json(mymsg, JsonRequestBehavior.AllowGet));
            }
            catch (Exception exception)
            {
                return(Json(exception.Message, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #5
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
 public ActionResult UserDetail(OCCUSER aUser, string btnName)
 {
     try
     {
         OCCUSER user = (OCCUSER)Session["User"];
         if (String.Equals(btnName, "update"))
         {
             aUser.MODIFIEDBY      = user.ID;
             aUser.MODIFIEDON      = DateTime.Now;
             db.Entry(aUser).State = EntityState.Modified;
             db.SaveChanges();
             var msg = "Successfully Updated";
             return(Json(msg, JsonRequestBehavior.AllowGet));
         }
         if (String.Equals(btnName, "delete"))
         {
             aUser.MODIFIEDBY      = user.ID;
             aUser.MODIFIEDON      = DateTime.Now;
             aUser.ISACTIVE        = false;
             db.Entry(aUser).State = EntityState.Modified;
             db.SaveChanges();
             var msg = "Successfully Removed";
             return(Json(msg, JsonRequestBehavior.DenyGet));
         }
         return(RedirectToAction("Error", "Home", new { Area = "" }));
     }
     catch (Exception)
     {
         return(RedirectToAction("Error", "Home", new { Area = "" }));
     }
 }
コード例 #6
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult Form(DEPOSIT deposit)
        {
            try
            {
                OCCUSER user      = (OCCUSER)Session["User"];
                int     adminFlag = 0;
                if (deposit.ID == 0)
                {
                    deposit.CREATEDBY  = user.ID;
                    deposit.ISACTIVE   = true;
                    deposit.ISDELETE   = false;
                    deposit.ISDOWNLOAD = false;
                    var refNo = DateTime.Now.ToString("ddMMyyHHmmssfff");
                    //refNo += deposit.CARDNUMBER.Substring(deposit.CARDNUMBER.Length - 4);
                    deposit.REFERENCENUMBER = refNo;
                    db.DEPOSIT.Add(deposit);
                    db.SaveChanges();
                    //  Session["DepositSaveMsg"] = "Data saved successfully.\nReferance Number is: "+deposit.REFERENCENUMBER;
                    var msg = @"Data saved successfully.<br/>Referance Number is: " + deposit.REFERENCENUMBER;
                    if (user.TYPE == 1)
                    {
                        adminFlag = 1;
                    }
                    // return RedirectToAction("Index", "List");
                    return(Json(new { msg, adminFlag }, JsonRequestBehavior.AllowGet));
                }
                else
                {
                    if (ModelState.IsValid)
                    {
                        deposit.CREATEDBY  = user.ID;
                        deposit.ISACTIVE   = true;
                        deposit.ISDELETE   = false;
                        deposit.ISDOWNLOAD = false;

                        db.Entry(deposit).State = EntityState.Modified;
                        if (user.TYPE == 1)
                        {
                            adminFlag = 1;
                        }
                        //db.DEPOSIT.AddOrUpdate(x=>x.ID==deposit.ID);
                        db.SaveChanges();
                        var msg = "Successfully Updated";
                        return(Json(new { msg, adminFlag }, JsonRequestBehavior.AllowGet));
                    }
                    List <string> currencyList = new List <string>()
                    {
                        "USD", "BDT"
                    };

                    ViewBag.BRANCH   = new SelectList(db.BRANCHINFO.ToList(), "ID", "BRANCHNAME", db.DEPOSIT.Select(x => x.BRANCH));
                    ViewBag.CURRENCY = new SelectList(currencyList, null, null, db.DEPOSIT.Select(x => x.CURRENCY));
                    return(View(deposit));
                }
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #7
0
        //[ValidateAntiForgeryToken]
        public ActionResult Form(CARDCHEREUISITION cardchereuisition)
        {
            try
            {
                user = (OCCUSER)Session["User"];


                int adminFlag = 0;
                if (cardchereuisition.ID == 0)
                {
                    cardchereuisition.LEAFNO    = 10;
                    cardchereuisition.ISACTIVE  = false;
                    cardchereuisition.ISDELETE  = false;
                    cardchereuisition.CREATEDBY = user.ID;
                    if (ModelState.IsValid)
                    {
                        db.CARDCHEREUISITION.Add(cardchereuisition);
                        db.SaveChanges();
                        if (user.TYPE == 1)
                        {
                            adminFlag = 1;
                        }
                        string msg = "Successfully Saved";
                        return(Json(new { msg, adminFlag }, JsonRequestBehavior.AllowGet));
                    }
                    ViewBag.BRANCH = new SelectList(db.BRANCHINFO, "ID", "BRANCHNAME", user.BRANCH);
                    CARDCHEREUISITION ccreq = new CARDCHEREUISITION();
                    if (user.BRANCH != null)
                    {
                        ccreq.BRANCHCODE = (long)user.BRANCH;
                    }

                    long status = db.OCCENUMERATION.Where(x => x.Name == "applied").Select(x => x.ID).FirstOrDefault();
                    ViewBag.STATUSID         = new SelectList(db.OCCENUMERATION.Where(x => x.Type == "chequereq"), "ID", "Name", status);
                    cardchereuisition.STATUS = status;
                    return(View(cardchereuisition));
                }
                else
                {
                    var modifiedcardCheque = db.CARDCHEREUISITION.Find(cardchereuisition.ID);


                    modifiedcardCheque.REMARKS         = cardchereuisition.REMARKS;
                    modifiedcardCheque.REFERENCENO     = cardchereuisition.REFERENCENO;
                    modifiedcardCheque.MODIFIEDBY      = user.ID;
                    modifiedcardCheque.MODIFIEDON      = DateTime.Now;
                    db.Entry(modifiedcardCheque).State = EntityState.Modified;
                    db.SaveChanges();
                    string msg = "Successfully Updated";
                    return(Json(new { msg, adminFlag }, JsonRequestBehavior.AllowGet));
                }
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #8
0
        public ActionResult Index(int?STATUS, string CARDNO, DateTime?CREATEDON, int?page)
        {
            try
            {
                var checkSts =
                    db.OCCENUMERATION.Where(x => x.Name == "delivered" && x.Type == "chequereq")
                    .Select(x => x.ID)
                    .FirstOrDefault();
                OCCUSER user = (OCCUSER)Session["User"];
                var     cardchereuisition = db.CARDCHEREUISITION.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Include(c => c.OCCUSER1).Where(x => x.STATUS == checkSts && x.ISACTIVE == false).Where(x => x.ISDELETE == false).ToList();
                //var status = db.OCCENUMERATION.Where(x => x.Type == "chequereq").Where(x => x.IsActive == true).ToList();
                var status = new Dictionary <int, string>()
                {
                    { 16, "delivered" }, { 0, "Active" }
                };

                ViewBag.STATUS = new SelectList(status, "Key", "Value");

                if (STATUS != null)
                {
                    if (STATUS == 0)
                    {
                        cardchereuisition = db.CARDCHEREUISITION.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Include(c => c.OCCUSER1).Where(x => x.ISACTIVE).ToList();
                    }
                    else
                    {
                        cardchereuisition = db.CARDCHEREUISITION.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Include(c => c.OCCUSER1).Where(x => x.STATUS == STATUS && x.ISACTIVE == false).ToList();
                    }

                    ViewBag.STATUS  = new SelectList(status, "Key", "Value", STATUS);
                    ViewBag.currsts = STATUS;
                    // ViewBag.STATUS = new SelectList(statusID, "Key", "Value", statusID.Where(x => x.Key == STATUS));
                }

                if (!String.IsNullOrEmpty(CARDNO))
                {
                    CARDNO            = CARDNO.Trim();
                    cardchereuisition = cardchereuisition.Where(x => x.CARDNO.Contains(CARDNO)).ToList();
                    ViewBag.CARDNO    = CARDNO;
                }
                if (CREATEDON != null)
                {
                    cardchereuisition = cardchereuisition.Where(x => x.CREATEDON == CREATEDON).ToList();
                    ViewBag.CREATEDON = CREATEDON;
                }

                int pageSize   = ConstantConfig.PageSizes;
                int pageNumber = ((page ?? 1));

                return(View(cardchereuisition.ToPagedList(pageNumber, pageSize)));
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #9
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult Create(CARDCHTRAN cardchtran)
        {
            List <string> currencyList;

            try
            {
                int     adminFlag = 0;
                OCCUSER user      = (OCCUSER)Session["User"];
                cardchtran.CREATEDBY = user.ID;
                cardchtran.CREATEDON = DateTime.Now.Date;
                cardchtran.STATUS    = 13;
                cardchtran.ISACTIVE  = true;
                cardchtran.ISDELETE  = false;

                var leaf = db.CARDCHLEAF.FirstOrDefault(x => x.ID == cardchtran.CHEQUELEAFID);

                leaf.LEAFSTATUS      = db.OCCENUMERATION.Where(x => x.Name == "used").Select(x => x.ID).FirstOrDefault();
                db.Entry(leaf).State = EntityState.Modified;

                if (ModelState.IsValid)
                {
                    db.CARDCHTRAN.Add(cardchtran);
                    db.SaveChanges();
                    if (user.TYPE == 1)
                    {
                        adminFlag = 1;
                    }
                    var msg = "Data saved successfully. ";

                    return(Json(new { msg, adminFlag }, JsonRequestBehavior.AllowGet));
                }

                currencyList = new List <string>()
                {
                    "BDT"
                };
                ViewBag.BRANCHCODE = new SelectList(db.BRANCHINFO.ToList(), "ID", "BRANCHNAME");
                ViewBag.CURRENCY   = new SelectList(currencyList);
                return(View("Index"));
            }

            catch (DbEntityValidationException dbEntityValidationException)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
            catch (InvalidOperationException invalidOperationException)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }

            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #10
0
        //public ActionResult Index()
        //{
        //    return View();
        //}
        public ActionResult Index(int?STATUS, string CARDNO, DateTime?CREATEDON, int?page)
        {
            Dictionary <int, string> statusID;
            OCCUSER user = (OCCUSER)Session["User"];

            if (user.TYPE == 1)
            {
                statusID = new Dictionary <int, string>()
                {
                    { 4, "applied" }, { 5, "authorized" }, { 7, "received" }, { 8, "deny" }, { 16, "delivered" }
                };
            }
            else
            {
                statusID = new Dictionary <int, string>()
                {
                    { 4, "applied" }, { 5, "authorized" }, { 7, "received" }, { 16, "delivered" }
                };
            }

            ViewBag.STATUS = new SelectList(statusID, "Key", "Value");
            var statusId =
                db.OCCENUMERATION.Where(x => x.Type == "chequereq")
                .Where(x => x.Name == "received")
                .Select(x => x.ID)
                .FirstOrDefault();

            var List = db.CARDCHEREUISITION.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Where(x => x.ISDELETE != true).Where(x => x.STATUS == statusId).OrderByDescending(x => x.ID).ToList();

            if (STATUS != null)
            {
                List            = db.CARDCHEREUISITION.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Where(x => x.ISDELETE != true).Where(x => x.STATUS == STATUS).OrderByDescending(x => x.ID).ToList();
                ViewBag.STATUS  = new SelectList(statusID, "Key", "Value", statusID.Where(x => x.Key == STATUS));
                ViewBag.currsts = STATUS;
                // ViewBag.STATUS = new SelectList(statusID, "Key", "Value", statusID.Where(x => x.Key == STATUS));
            }

            if (!String.IsNullOrEmpty(CARDNO))
            {
                CARDNO         = CARDNO.Trim();
                List           = List.Where(x => x.CARDNO.Contains(CARDNO)).Where(x => x.ISDELETE != true).ToList();
                ViewBag.CARDNO = CARDNO;
            }
            if (CREATEDON != null)
            {
                List = List.Where(x => x.ESTABLISHMENTON.Value.Date == CREATEDON).Where(x => x.ISDELETE != true).ToList();
                ViewBag.CREATEDON = CREATEDON;
            }

            int pageSize   = ConstantConfig.PageSizes;
            int pageNumber = ((page ?? 1));

            return(View(List.ToPagedList(pageNumber, pageSize)));
        }
コード例 #11
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult Index()
        {
            try
            {
                OCCUSER user = (OCCUSER)Session["User"];
                AuthorizerDashboardVM aVm = new AuthorizerDashboardVM();

                WebRef.OBLAPP         oblApp = new WebRef.OBLAPP();
                System.Data.DataTable dt     = oblApp.GetByUserID(user.EMPLOYEEID);
                foreach (DataRow dataRow in dt.Rows)
                {
                    aVm.EmployeeInfoVm.BranchName  = (string)dataRow[21];
                    aVm.EmployeeInfoVm.Email       = (string)dataRow[9];
                    aVm.EmployeeInfoVm.EmployeeId  = (string)dataRow[2];
                    aVm.EmployeeInfoVm.JobTitle    = (string)dataRow[7];
                    aVm.EmployeeInfoVm.Name        = (string)dataRow[3];
                    aVm.EmployeeInfoVm.PreDeptName = (string)dataRow[17];
                }

                var pendingReqList      = db.CARDCHEREUISITION.Where(x => x.ISDELETE != true).Where(x => x.STATUS == 4).OrderByDescending(x => x.ID).ToList();
                var pendingReqListCount = pendingReqList.Count;
                aVm.PendingRequisitionCount = pendingReqListCount;
                aVm.PendingRequisitionList  = pendingReqList.Take(5).ToList();


                var pendingChequeList      = db.CARDCHTRAN.Where(x => x.STATUS == 13).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                var pendingChequeListCount = pendingChequeList.Count;
                aVm.PendingCardChequeAmount = pendingChequeList.Sum(x => x.AMOUNT);
                aVm.PendingCardChequeCount  = pendingChequeListCount;
                aVm.PendingCardChequeList   = pendingChequeList.Take(5).ToList();

                var authReqList      = db.CARDCHEREUISITION.Where(x => x.ISDELETE != true).Where(x => x.STATUS == 5).OrderByDescending(x => x.ID).ToList();
                var authReqListCount = authReqList.Count;
                aVm.AuthRequisitionCount      = authReqListCount;
                aVm.AuthorizedRequisitionList = authReqList.Take(5).ToList();


                var authChequeList      = db.CARDCHTRAN.Where(x => x.STATUS == 14).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                var authChequeListCount = authChequeList.Count;
                aVm.AuthorizedCardChequeAmount = authChequeList.Sum(x => x.AMOUNT);
                aVm.AuthCardCHequeCount        = authChequeListCount;
                aVm.AuthorizedCardChequeList   = authChequeList.Take(5).ToList();

                return(View(aVm));
            }
            catch (Exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }

            // return View();
        }
コード例 #12
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult CardChequePendingRequest(string CARDNO, DateTime?CREATEDON, int?page, int?STATUS)
        {
            var statusID           = db.OCCENUMERATION.Where(x => x.Type == "cardcheque");
            List <CARDCHTRAN> List = new List <CARDCHTRAN>();

            ViewBag.STATUS = new SelectList(statusID, "ID", "Name");
            OCCUSER user = (OCCUSER)Session["User"];

            // db.CARDCHTRAN.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Where(x=>x.)
            if (STATUS != null)
            {
                // List = List.Where(x => x.STATUS == STATUS).ToList();
                //if (STATUS == 13)
                //{

                //    List = db.CARDCHTRAN.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Where(x => x.STATUS == 13).Where(x => x.ISDELETE != true).ToList();
                //}
                //else
                //{
                //    List = db.CARDCHTRAN.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Where(x => x.STATUS == 14).Where(x => x.ISDELETE != true).ToList();
                //}
                List = db.CARDCHTRAN.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Where(x => x.STATUS == STATUS).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();

                ViewBag.currentStatus = STATUS;
                ViewBag.STATUS        = new SelectList(statusID, "ID", "Name", STATUS);
            }
            else
            {
                List = db.CARDCHTRAN.Include(c => c.BRANCHINFO).Include(c => c.OCCENUMERATION).Include(c => c.OCCUSER).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
            }



            if (!String.IsNullOrEmpty(CARDNO))
            {
                List = List.Where(x => x.CARDNO == CARDNO).Where(x => x.ISDELETE != true).ToList();
                ViewBag.currentCardNo = CARDNO;
            }
            if (CREATEDON != null)
            {
                List = List.Where(x => x.CREATEDON == CREATEDON).Where(x => x.ISDELETE != true).ToList();
                ViewBag.currentDate = CREATEDON;
            }

            // int pageSize = 3;
            int pageSize   = ConstantConfig.PageSizes;
            int pageNumber = ((page ?? 1));

            //var chqSts = db.OCCENUMERATION.Where(x => x.Type == "cardcheque" && x.Name != "pending").ToList();
            //ViewBag.CHQSTATUS = new SelectList (chqSts, "Id", "Name");
            return(View(List.ToPagedList(pageNumber, pageSize)));
        }
コード例 #13
0
ファイル: PaymentController.cs プロジェクト: bonyRocker/CCM
        // GET: Admin/Payment
        public ActionResult Index(int?BRANCH, string CARDNO, DateTime?CREATEDON, int?page, int?serial)
        {
            // var dEPOSIT = db.DEPOSIT.Include(d => d.BRANCHINFO).Include(d => d.OCCUSER);
            //   return View(dEPOSIT.ToList());
            int pageSize   = 10;
            int pageNumber = (page ?? 1);

            OCCUSER user = (OCCUSER)Session["User"];

            try
            {
                var list   = db.DEPOSIT.Where(x => x.ISDELETE == false).OrderByDescending(x => x.ID).ToList();
                var branch = db.BRANCHINFO.Select(x => new { x.BRANCHNAME, x.ID }).OrderBy(x => x.BRANCHNAME);
                ViewBag.BRANCH = new SelectList(branch, "ID", "BRANCHNAME");

                if (serial != null)
                {
                    @ViewBag.Sln = (pageNumber * pageSize) - 9;
                }
                else
                {
                    @ViewBag.Sln = 1;
                }

                if (BRANCH != null)
                {
                    list                  = list.Where(x => x.BRANCH == BRANCH).ToList();
                    ViewBag.BRANCH        = new SelectList(branch, "ID", "BRANCHNAME", BRANCH);
                    ViewBag.currentBranch = BRANCH;
                }
                if (!String.IsNullOrEmpty(CARDNO))
                {
                    CARDNO         = CARDNO.Trim();
                    list           = list.Where(x => x.CARDNUMBER.Contains(CARDNO)).ToList();
                    ViewBag.CARDNO = CARDNO;
                }
                if (CREATEDON != null)
                {
                    list = list.Where(x => x.CREATEDON == CREATEDON).ToList();
                    ViewBag.CREATEDON = CREATEDON;
                }

                return(View(list.ToPagedList(pageNumber, pageSize)));
                // return View(list);
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #14
0
        public ActionResult Index()
        {
            try
            {
                OCCUSER           user = (OCCUSER)Session["User"];
                TellerDashBoardVM aVm  = new TellerDashBoardVM();

                var visaList = db.DEPOSIT.Where(x => x.ISDELETE == false).Where(x => x.CREATEDBY == user.ID).OrderByDescending(x => x.ID).ToList();
                aVm.TotalVisaPayment           = visaList.Count;
                aVm.TotalVisaPaymentCollection = (decimal)visaList.Sum(x => x.AMOUNT);
                visaList = visaList.Take(5).ToList();


                var requisitionList = db.CARDCHEREUISITION.Where(x => x.CREATEDBY == user.ID).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                aVm.TotalReqisitionRequest = requisitionList.Count;
                requisitionList            = requisitionList.Take(5).ToList();


                var cardchtanList = db.CARDCHTRAN.Where(x => x.CREATEDBY == user.ID).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                aVm.TotalCardPayment         = cardchtanList.Sum(x => x.AMOUNT);
                aVm.TotalChequePaymentNumber = cardchtanList.Count;
                cardchtanList = cardchtanList.Take(5).ToList();


                WebRef.OBLAPP oblApp = new WebRef.OBLAPP();
                DataTable     dt     = oblApp.GetByUserID(user.EMPLOYEEID);
                foreach (DataRow dataRow in dt.Rows)
                {
                    aVm.EmployeeInfoVm.BranchName  = (string)dataRow[21];
                    aVm.EmployeeInfoVm.Email       = (string)dataRow[9];
                    aVm.EmployeeInfoVm.EmployeeId  = (string)dataRow[2];
                    aVm.EmployeeInfoVm.JobTitle    = (string)dataRow[7];
                    aVm.EmployeeInfoVm.Name        = (string)dataRow[3];
                    aVm.EmployeeInfoVm.PreDeptName = (string)dataRow[17];
                }


                //var visaPaymentList = db.DEPOSIT.Where(x => x.CREATEDBY == user.ID).ToList();
                aVm.Deposits     = visaList;
                aVm.Requisitions = requisitionList;
                aVm.ChequeTrans  = cardchtanList;
                // aVm.TotalVisaPayment = visaPaymentList.Count;
                // aVm.TotalVisaPaymentCollection = (decimal)visaPaymentList.Sum(x => x.AMOUNT);
                return(View(aVm));
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #15
0
 public ActionResult SearchReasult(DateTime startDate, DateTime endDate, string btnName)
 {
     try
     {
         if (btnName == "visa")
         {
             OCCUSER user = (OCCUSER)Session["User"];
             var     List = db.DEPOSIT.Where(x => x.CREATEDON >= startDate).Where(x => x.CREATEDON <= endDate).Where(x => x.CREATEDBY == user.ID).ToList();
         }
         return(View());
     }
     catch (Exception)
     {
         return(Json("Error"));
     }
 }
コード例 #16
0
        public ActionResult Details(CARDCHTRAN tran, string btnName)
        {
            try
            {
                OCCUSER user = (OCCUSER)Session["User"];
                if (String.Equals(btnName, "update"))
                {
                    var updatedTrn = db.CARDCHTRAN.Find(tran.ID);
                    updatedTrn.CHEQUELEAFID   = tran.CHEQUELEAFID;
                    updatedTrn.CARDNO         = tran.CARDNO;
                    updatedTrn.BENEFICIARINFO = tran.BENEFICIARINFO;
                    updatedTrn.AMOUNT         = tran.AMOUNT;
                    updatedTrn.BRANCHCODE     = tran.BRANCHCODE;
                    updatedTrn.REQUESTDATE    = tran.REQUESTDATE;

                    updatedTrn.MODIFIEDBY = user.ID;
                    updatedTrn.MODIFIEDON = DateTime.Now;
                    // updatedTrn.ISACTIVE = true;
                    db.Entry(updatedTrn).State = EntityState.Modified;
                    db.SaveChanges();
                    var msg = "Successfully Updated";
                    return(Json(msg, JsonRequestBehavior.AllowGet));
                }
                if (String.Equals(btnName, "delete"))
                {
                    //aUser.MODIFIEDBY = user.ID;
                    //aUser.MODIFIEDON = DateTime.Now;
                    //aUser.ISACTIVE = false;
                    //db.Entry(aUser).State = EntityState.Modified;
                    //db.SaveChanges();
                    var updatedTrn = db.CARDCHTRAN.Find(tran.ID);
                    updatedTrn.ISDELETE        = true;
                    db.Entry(updatedTrn).State = EntityState.Modified;
                    db.SaveChanges();
                    var msg = "Successfully Removed";
                    return(Json(msg, JsonRequestBehavior.AllowGet));
                }
                var msg1 = "Error in operation";
                return(Json(msg1, JsonRequestBehavior.DenyGet));
                //  return View(tran);
            }
            catch (Exception exception)
            {
                return(Json(exception.Message, JsonRequestBehavior.AllowGet));
                //return RedirectToAction("Error", "Home", new { Area = "" });
            }
        }
コード例 #17
0
        public ActionResult Details(CARDCHEREUISITION cardchereuisition, string btnName)
        {
            try
            {
                OCCUSER user = (OCCUSER)Session["User"];
                if (String.Equals(btnName, "delete"))
                {
                    CARDCHEREUISITION ccr = db.CARDCHEREUISITION.Find(cardchereuisition.ID);
                    ccr.ISDELETE = true;
                    //db.Entry(ccr).State = EntityState.Modified;
                    db.SaveChanges();
                    var msg = "Successfully Removed";
                    return(Json(msg, JsonRequestBehavior.AllowGet));
                }
                if (String.Equals(btnName, "update"))
                {
                    var updatedModel = db.CARDCHEREUISITION.Find(cardchereuisition.ID);
                    updatedModel.CARDNO      = cardchereuisition.CARDNO;
                    updatedModel.CREATEDON   = cardchereuisition.CREATEDON;
                    updatedModel.BRANCHCODE  = cardchereuisition.BRANCHCODE;
                    updatedModel.STATUS      = cardchereuisition.STATUS;
                    updatedModel.REFERENCENO = cardchereuisition.REFERENCENO;
                    updatedModel.REMARKS     = cardchereuisition.REMARKS;
                    //if (cardchereuisition.ISACTIVE)
                    //{
                    //    updatedModel.ISACTIVE = cardchereuisition.ISACTIVE;
                    //}
                    //if (ModelState.IsValid)
                    //{

                    //db.Entry(cardchereuisition).State = EntityState.Modified;
                    db.SaveChanges();
                    //}

                    var msg = "Successfully Updated";
                    return(Json(msg, JsonRequestBehavior.AllowGet));
                }
                return(Json("Error", JsonRequestBehavior.AllowGet));
            }
            catch (Exception exception)
            {
                return(Json(exception.Message, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #18
0
        // GET: /ChequeRequisition/Home/
        public ActionResult Index(int?STATUS, string CARDNO, DateTime?CREATEDON, int?page)
        {
            try
            {
                user = (OCCUSER)Session["User"];
                Dictionary <int, string> statusID = new Dictionary <int, string>()
                {
                    { 4, "applied" }, { 5, "authorized" }
                };
                ViewBag.STATUS = new SelectList(statusID, "Key", "Value");

                var List = db.CARDCHEREUISITION.Include(c => c.BRANCHINFO).Where(x => x.ISDELETE == false).Where(x => x.CREATEDBY == user.ID).OrderByDescending(x => x.ID).ToList();

                if (STATUS != null)
                {
                    List            = List.Where(x => x.STATUS == STATUS).ToList();
                    ViewBag.STATUS  = new SelectList(statusID, "Key", "Value", statusID.Where(x => x.Key == STATUS));
                    ViewBag.currsts = STATUS;
                    // ViewBag.STATUS = new SelectList(statusID, "Key", "Value", statusID.Where(x => x.Key == STATUS));
                }
                if (!String.IsNullOrEmpty(CARDNO))
                {
                    CARDNO         = CARDNO.Trim();
                    List           = List.Where(x => x.CARDNO.Contains(CARDNO)).ToList();
                    ViewBag.CARDNO = CARDNO;
                }
                if (CREATEDON != null)
                {
                    List = List.Where(x => x.CREATEDON == CREATEDON).ToList();
                    ViewBag.CREATEDON = CREATEDON;
                }

                int pageSize   = ConstantConfig.PageSizes;
                int pageNumber = ((page ?? 1));
                return(View(List.ToPagedList(pageNumber, pageSize)));
            }
            catch (Exception ex)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #19
0
        public ActionResult Post(IEnumerable <long> idList)
        {
            OCCUSER user = (OCCUSER)Session["User"];

            try
            {
                foreach (var id in idList)
                {
                    var cheqreq = db.CARDCHEREUISITION.FirstOrDefault(x => x.ID == id);
                    cheqreq.CALLCENTERBY    = user.ID;
                    cheqreq.CALLCENTERON    = DateTime.Now;
                    cheqreq.ISACTIVE        = true;
                    db.Entry(cheqreq).State = EntityState.Modified;
                    db.SaveChanges();
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #20
0
ファイル: PaymentController.cs プロジェクト: bonyRocker/CCM
        public ActionResult Details(DEPOSIT deposit, string btnName)
        {
            try
            {
                OCCUSER user = (OCCUSER)Session["User"];
                if (String.Equals(btnName, "update"))
                {
                    DEPOSIT deposits = db.DEPOSIT.Find(deposit.ID);

                    deposit.CREATEDBY  = deposits.CREATEDBY;
                    deposit.CREATEDON  = deposits.CREATEDON;
                    deposit.MODIFIEDBY = user.ID;
                    deposit.MODIFIEDON = DateTime.Now;
                    deposit.ISACTIVE   = true;
                    deposit.ISDELETE   = false;
                    //db.Entry(deposit).State = EntityState.Modified;
                    db.DEPOSIT.AddOrUpdate(deposit);
                    db.SaveChanges();
                    var msg = "Successfully Updated";
                    return(Json(msg, JsonRequestBehavior.AllowGet));
                }
                if (String.Equals(btnName, "delete"))
                {
                    DEPOSIT depostis = db.DEPOSIT.Find(deposit.ID);
                    depostis.ISDELETE        = true;
                    db.Entry(depostis).State = EntityState.Modified;
                    db.SaveChanges();
                    var msg = "Successfully Removed";
                    return(Json(msg, JsonRequestBehavior.AllowGet));
                }
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
            catch (Exception exception)
            {
                var msg = exception.Message;
                return(Json(msg, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #21
0
        // GET: Admin/CardCheque
        public ActionResult Index(int?STATUS, string CARDNO, DateTime?CREATEDON, int?page)
        {
            try
            {
                OCCUSER user   = (OCCUSER)Session["User"];
                var     List   = db.CARDCHTRAN.Include(c => c.CARDCHLEAF).Include(c => c.OCCUSER).Include(c => c.OCCUSER1).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                var     status = db.OCCENUMERATION.Where(x => x.Type == "cardcheque");
                ViewBag.STATUS = new SelectList(status, "ID", "Name");

                if (STATUS != null)
                {
                    List            = List.Where(x => x.STATUS == STATUS).ToList();
                    ViewBag.STATUS  = new SelectList(status, "ID", "Name", STATUS);
                    ViewBag.currsts = STATUS;
                }
                if (!String.IsNullOrEmpty(CARDNO))
                {
                    CARDNO         = CARDNO.Trim();
                    List           = List.Where(x => x.CARDNO.Contains(CARDNO)).ToList();
                    ViewBag.CARDNO = CARDNO;
                }
                if (CREATEDON != null)
                {
                    List = List.Where(x => x.CREATEDON == CREATEDON).ToList();
                    ViewBag.CREATEDON = CREATEDON;
                }
                // int pageSize = ConstantConfig.PageSizes;
                int pageSize   = ConstantConfig.PageSizes;
                int pageNumber = ((page ?? 1));
                return(View(List.ToPagedList(pageNumber, pageSize)));
            }
            catch (Exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #22
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult Index(DateTime?startDate, DateTime?endDate, string btnName)
        {
            try
            {
                if (startDate != null || endDate != null)
                {
                    OCCUSER          user = (OCCUSER)Session["User"];
                    AdminDashboardVM aVm  = new AdminDashboardVM();

                    var visaList = db.DEPOSIT.Where(x => x.ISDELETE == false).OrderByDescending(x => x.ID).ToList();
                    aVm.TotalVisaPayment           = visaList.Count;
                    aVm.TotalVisaPaymentCollection = (decimal)visaList.Sum(x => x.AMOUNT);
                    visaList = visaList.Take(5).ToList();


                    var requisitionList = db.CARDCHEREUISITION.Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                    aVm.TotalReqisitionRequest = requisitionList.Count;
                    requisitionList            = requisitionList.Take(5).ToList();


                    var cardchtanList = db.CARDCHTRAN.Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                    aVm.TotalCardPayment         = cardchtanList.Sum(x => x.AMOUNT);
                    aVm.TotalChequePaymentNumber = cardchtanList.Count;
                    cardchtanList = cardchtanList.Take(5).ToList();



                    WebRef.OBLAPP oblApp = new WebRef.OBLAPP();
                    DataTable     dt     = oblApp.GetByUserID(user.EMPLOYEEID);
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        aVm.EmployeeInfoVm.BranchName  = (string)dataRow[21];
                        aVm.EmployeeInfoVm.Email       = (string)dataRow[9];
                        aVm.EmployeeInfoVm.EmployeeId  = (string)dataRow[2];
                        aVm.EmployeeInfoVm.JobTitle    = (string)dataRow[7];
                        aVm.EmployeeInfoVm.Name        = (string)dataRow[3];
                        aVm.EmployeeInfoVm.PreDeptName = (string)dataRow[17];
                    }

                    if (btnName == "visa")
                    {
                        visaList                       = db.DEPOSIT.Where(x => x.ISDELETE == false).Where(x => x.CREATEDON.Value.Date >= startDate.Value.Date).Where(x => x.CREATEDON.Value.Date <= endDate.Value.Date).ToList();
                        aVm.TotalVisaPayment           = visaList.Count;
                        aVm.TotalVisaPaymentCollection = (decimal)visaList.Sum(x => x.AMOUNT);
                        //aVm.Deposits = List;
                    }
                    else if (btnName == "requisition")
                    {
                        requisitionList            = db.CARDCHEREUISITION.Where(x => x.ISDELETE != true).Where(x => x.CREATEDON.Date >= startDate.Value.Date).Where(x => x.CREATEDON.Date <= endDate.Value.Date).ToList();
                        aVm.TotalReqisitionRequest = requisitionList.Count;
                    }
                    else if (btnName == "cardcheque")
                    {
                        cardchtanList                = db.CARDCHTRAN.Where(x => x.ISDELETE != true).Where(x => x.CREATEDON >= startDate).Where(x => x.CREATEDON <= endDate).ToList();
                        aVm.TotalCardPayment         = cardchtanList.Sum(x => x.AMOUNT);
                        aVm.TotalChequePaymentNumber = cardchtanList.Count;
                    }
                    aVm.Deposits     = visaList;
                    aVm.Requisitions = requisitionList;
                    aVm.ChequeTrans  = cardchtanList;

                    return(View(aVm));
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
            //  return View();
        }
コード例 #23
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult CardChAuthPost(FormCollection formCollection)

        {
            List <long>   ID          = new List <long>();
            List <string> APPROVALNO  = new List <string>();
            List <int>    CHQSTATUS   = new List <int>();
            List <string> REMARKSLIST = new List <string>();

            try
            {
                OCCUSER user = (OCCUSER)Session["User"];
                List <CardChequeAuthorizrVM> vm = new List <CardChequeAuthorizrVM>();

                foreach (var key in formCollection.AllKeys)
                {
                    if (key.Contains("ID"))
                    {
                        long id = Convert.ToInt64(formCollection[key]);
                        ID.Add(id);
                    }
                    if (key.Contains("APPROVAL"))
                    {
                        string approval = formCollection[key];
                        APPROVALNO.Add(approval);
                    }
                    if (key.Contains("CHQSTATUS"))
                    {
                        int chqStatus = Convert.ToInt32(formCollection[key]);
                        CHQSTATUS.Add(chqStatus);
                    }
                    if (key.Contains("REMARKS"))
                    {
                        string remarks = formCollection[key];
                        REMARKSLIST.Add(remarks);
                    }

                    var value = formCollection[key];
                }
                for (int i = 0; i < ID.Count; i++)
                {
                    var aVm = new CardChequeAuthorizrVM()
                    {
                        APPROVALNO = APPROVALNO[i], ID = ID[i], ChqStatus = CHQSTATUS[i], REMARKS = REMARKSLIST[i]
                    };
                    vm.Add(aVm);
                }
                // var a = formCollection["CHQSTATUS"];
                foreach (var aViewModel in vm)
                {
                    var cardChq = db.CARDCHTRAN.FirstOrDefault(x => x.ID == aViewModel.ID);
                    cardChq.APPROVALNO      = aViewModel.APPROVALNO;
                    cardChq.STATUS          = aViewModel.ChqStatus;
                    cardChq.REMARKS         = aViewModel.REMARKS;
                    cardChq.AUTHORIZEDBY    = user.ID;
                    cardChq.AUTHORIZEDON    = DateTime.Now;
                    db.Entry(cardChq).State = EntityState.Modified;
                    db.SaveChanges();
                }

                return(RedirectToAction("CardChequePendingRequest"));
            }
            catch (Exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #24
0
ファイル: HomeController.cs プロジェクト: bonyRocker/CCM
        public ActionResult Index(DateTime?startDate, DateTime?endDate, string btnName)
        {
            try
            {
                if (startDate != null || endDate != null)
                {
                    OCCUSER user = (OCCUSER)Session["User"];
                    AuthorizerDashboardVM aVm = new AuthorizerDashboardVM();

                    WebRef.OBLAPP         oblApp = new WebRef.OBLAPP();
                    System.Data.DataTable dt     = oblApp.GetByUserID(user.EMPLOYEEID);
                    foreach (DataRow dataRow in dt.Rows)
                    {
                        aVm.EmployeeInfoVm.BranchName  = (string)dataRow[21];
                        aVm.EmployeeInfoVm.Email       = (string)dataRow[9];
                        aVm.EmployeeInfoVm.EmployeeId  = (string)dataRow[2];
                        aVm.EmployeeInfoVm.JobTitle    = (string)dataRow[7];
                        aVm.EmployeeInfoVm.Name        = (string)dataRow[3];
                        aVm.EmployeeInfoVm.PreDeptName = (string)dataRow[17];
                    }

                    var pendingReqList      = db.CARDCHEREUISITION.Where(x => x.ISDELETE == false).Where(x => x.STATUS == 4).OrderByDescending(x => x.ID).ToList();
                    var pendingReqListCount = pendingReqList.Count;
                    aVm.PendingRequisitionCount = pendingReqListCount;
                    aVm.PendingRequisitionList  = pendingReqList.Take(5).ToList();


                    var pendingChequeList      = db.CARDCHTRAN.Where(x => x.STATUS == 13).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                    var pendingChequeListCount = pendingChequeList.Count;
                    aVm.PendingCardChequeAmount = pendingChequeList.Sum(x => x.AMOUNT);
                    aVm.PendingCardChequeCount  = pendingChequeListCount;
                    aVm.PendingCardChequeList   = pendingChequeList.Take(5).ToList();

                    var authReqList      = db.CARDCHEREUISITION.Where(x => x.ISDELETE != true).Where(x => x.STATUS == 5).OrderByDescending(x => x.ID).ToList();
                    var authReqListCount = authReqList.Count;
                    aVm.AuthRequisitionCount      = authReqListCount;
                    aVm.AuthorizedRequisitionList = authReqList.Take(5).ToList();


                    var authChequeList      = db.CARDCHTRAN.Where(x => x.STATUS == 14).Where(x => x.ISDELETE != true).OrderByDescending(x => x.ID).ToList();
                    var authChequeListCount = authChequeList.Count;
                    aVm.AuthorizedCardChequeAmount = authChequeList.Sum(x => x.AMOUNT);
                    aVm.AuthCardCHequeCount        = authChequeListCount;
                    aVm.AuthorizedCardChequeList   = authChequeList.Take(5).ToList();


                    if (btnName == "pendingreq")
                    {
                        pendingReqList              = db.CARDCHEREUISITION.Where(x => x.ISDELETE != true).Where(x => x.STATUS == 4).Where(x => x.CREATEDON >= startDate).Where(x => x.CREATEDON <= endDate).ToList();
                        pendingReqListCount         = pendingReqList.Count;
                        aVm.PendingRequisitionCount = pendingReqListCount;
                        aVm.PendingRequisitionList  = pendingReqList.ToList();
                        //aVm.Deposits = List;
                    }
                    else if (btnName == "pendingcc")
                    {
                        pendingChequeList           = db.CARDCHTRAN.Where(x => x.STATUS == 13).Where(x => x.CREATEDON >= startDate).Where(x => x.CREATEDON <= endDate).Where(x => x.ISDELETE != true).ToList();
                        pendingChequeListCount      = pendingChequeList.Count;
                        aVm.PendingCardChequeAmount = pendingChequeList.Sum(x => x.AMOUNT);
                        aVm.PendingCardChequeCount  = pendingChequeListCount;
                        aVm.PendingCardChequeList   = pendingChequeList.ToList();
                    }
                    else if (btnName == "authreq")
                    {
                        authReqList                   = db.CARDCHEREUISITION.Where(x => x.ISDELETE != true).Where(x => x.STATUS == 5).Where(x => x.CREATEDON >= startDate).Where(x => x.CREATEDON <= endDate).ToList();
                        authReqListCount              = authReqList.Count;
                        aVm.AuthRequisitionCount      = authReqListCount;
                        aVm.AuthorizedRequisitionList = authReqList.Take(5).ToList();
                    }

                    else if (btnName == "authcc")
                    {
                        authChequeList                 = db.CARDCHTRAN.Where(x => x.STATUS == 14).Where(x => x.CREATEDON >= startDate).Where(x => x.CREATEDON <= endDate).Where(x => x.ISDELETE != true).ToList();
                        authChequeListCount            = authChequeList.Count;
                        aVm.AuthorizedCardChequeAmount = authChequeList.Sum(x => x.AMOUNT);
                        aVm.AuthCardCHequeCount        = authChequeListCount;
                        aVm.AuthorizedCardChequeList   = authChequeList.Take(5).ToList();
                    }
                    return(View(aVm));
                }
                return(RedirectToAction("Index"));
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }
コード例 #25
0
        public ActionResult LogIn(OCCUSER aUser, string PASSWORD)
        {
            WebRef.OBLAPP oblApp = new WebRef.OBLAPP();
            try
            {
                var isValid = oblApp.GetByUserIDCheck(aUser.EMPLOYEEID, PASSWORD);

                if (isValid == "Valid")
                {
                    ViewBag.flag = "";
                    if (IsUserInSystem(aUser.EMPLOYEEID))
                    {
                        var user = GetByEmpId(aUser.EMPLOYEEID);
                        if (user != null)
                        {
                            FormsAuthentication.SetAuthCookie(Convert.ToString(user.ID), false);
                            Session["User"] = user;
                            if (user.TYPE == 1)
                            {
                                return(RedirectToAction("Index", "Home", new { Area = "Admin" }));
                            }
                            if (user.TYPE == 3)
                            {
                                return(RedirectToAction("Index", "Home", new { Area = "Authorizer" }));
                            }
                            if (user.TYPE == 2)
                            {
                                return(RedirectToAction("Index", "Home", new { Area = "Teller" }));
                            }
                            if (user.TYPE == 9)
                            {
                                return(RedirectToAction("Index", "Home", new { Area = "Establishment" }));
                            }
                            if (user.TYPE == 15)
                            {
                                return(RedirectToAction("Index", "Home", new { Area = "CallCenter" }));
                            }
                            if (user.TYPE == 17)
                            {
                                return(RedirectToAction("Index", "Home", new { Area = "Dispatcher" }));
                            }
                        }
                    }
                    else
                    {
                        ViewBag.flag = "User is not in the system";
                    }
                }
                else if (isValid == "Invalid")
                {
                    ViewBag.flag = "Invalid User";
                    return(View());
                }
                else if (isValid == "NotFound")
                {
                    ViewBag.flag = "User Not Found";
                    return(View());
                }
                return(View());
            }
            catch (Exception exception)
            {
                ViewBag.flag = "Something is wrong " + exception.Message;
                return(View());
            }
        }
コード例 #26
0
        public ActionResult Post(IEnumerable <long> idList)
        {
            OCCUSER user  = (OCCUSER)Session["User"];
            var     aList = idList.OrderBy(x => x);

            try
            {
                foreach (var id in aList)
                {
                    var cheque   = db.CARDCHEREUISITION.FirstOrDefault(x => x.ID == id);
                    var statusId =
                        db.OCCENUMERATION.Where(x => x.Type == "chequereq")
                        .Where(x => x.Name == "received")
                        .Select(x => x.ID)
                        .FirstOrDefault();
                    cheque.STATUS = statusId;
                    if (IsLeafNoStartsWithZero())
                    {
                        cheque.LEAFFROM = "0000001";
                        cheque.LEAFTO   = "0000010";
                        cheque.LEAFNEXT = 11;
                    }

                    else
                    {
                        var lastSavedchq = db.CARDCHEREUISITION.Where(x => x.ESTABLISHMENTBY != null).OrderByDescending(x => x.LEAFNEXT).OrderByDescending(x => x.ESTABLISHMENTON).FirstOrDefault();
                        var leafnext     = (int)lastSavedchq.LEAFNEXT;
                        if (leafnext + 10 > 9999999)
                        {
                            cheque.LEAFFROM = "0000001";
                            cheque.LEAFTO   = "0000010";
                            cheque.LEAFNEXT = 11;
                        }
                        else
                        {
                            string leafnum = leafnext.ToString(CultureInfo.InvariantCulture);

                            cheque.LEAFFROM = leafnum.PadLeft(7, '0');

                            leafnext += 9;
                            leafnum   = leafnext.ToString(CultureInfo.InvariantCulture);

                            cheque.LEAFTO = leafnum.PadLeft(7, '0');

                            leafnext++;

                            cheque.LEAFNEXT = leafnext;
                        }
                    }
                    cheque.ESTABLISHMENTBY = user.ID;
                    cheque.ESTABLISHMENTON = DateTime.Now;
                    db.Entry(cheque).State = EntityState.Modified;
                    db.SaveChanges();
                }
                DownloadFile(idList);
                return(RedirectToAction("Index"));
            }
            catch (Exception exception)
            {
                return(RedirectToAction("Error", "Home", new { Area = "" }));
            }
        }