Beispiel #1
0
        //public SelectList GardenSelection()
        //{
        //    var UserName = User.Identity.Name;
        //    var brans = _employeeService.All().Where(x => x.Email == UserName).ToList().FirstOrDefault();
        //    var UserId = brans.Id;
        //    var items = _userbranchService.All().ToList().Where(x => x.Userid == UserId.ToString()).ToList();
        //    List<Branch> branchList = new List<Branch>();
        //    foreach (var item in items)
        //    {
        //        var branch = _BranchService.All().ToList().FirstOrDefault(x => x.BranchCode == item.BranchCode);
        //        branchList.Add(branch);
        //    }
        //    branchList.Insert(0, new Branch() { BranchCode = "0", BranchName = "---- Select ----" });
        //    //List<Branch> BranchCode = new SelectList(branchList, "BranchCode", "BranchName");
        //    return new SelectList(branchList.OrderBy(x => x.BranchCode), "BranchCode", "BranchName");

        //}
        public SelectList GardenSelection()
        {
            var UserName = Session["UserName"].ToString();
            var brans    = _employeeService.All().Where(x => x.Email == UserName).FirstOrDefault();

            //shahin

            List <Branch>     branchs    = _BranchService.All().ToList();
            List <UserBranch> userbranch = _userbranchService.All().ToList();
            var branchInfo = (from ii in userbranch
                              join i in branchs on ii.BranchCode equals i.BranchCode
                              where ii.Userid == brans.Id.ToString()
                              select new
            {
                BranchCode = ii.BranchCode,
                BranchName = i.BranchName
            }).ToList();

            if (branchInfo.Count == 1)
            {
                branchInfo.Insert(0, new { BranchCode = "0", BranchName = "All" });
                return(new SelectList(branchInfo.OrderBy(x => x.BranchCode), "BranchCode", "BranchName"));
            }
            else if (branchInfo.Count > 1)
            {
                //List<Branch> branch = _BranchService.All().ToList();
                branchInfo.Insert(0, new { BranchCode = "0", BranchName = "All" });
                return(new SelectList(branchInfo.OrderBy(x => x.BranchCode), "BranchCode", "BranchName"));
            }
            else
            {
                return(null);
            }
        }
Beispiel #2
0
 // GET: PurchaseReturn
 public ActionResult PurchaseReturn(string errMsg)
 {
     if (Session["UserID"] != null)
     {
         DateTime datetime = DateTime.Now;
         ViewBag.GLProvition = Counter("PR");
         ViewBag.GLEntries   = CountEntries("PR", datetime);
         ViewBag.LocCode     = new SelectList(_locationService.All().Where(s => s.LocCode != "900").ToList(), "LocCode", "LocName");
         ViewBag.CustCode    = new SelectList(_subsidiaryInfoService.All().ToList().Where(x => x.SubType == "2").OrderBy(x => x.SubName), "SubCode", "SubName");
         ViewBag.ItemCode    = LoadDropDown.LoadEmpDlList();
         var sysSet = _sysSetService.All().ToList().FirstOrDefault();
         ViewBag.MaintJob    = sysSet.MaintJob;
         Session["MaintLot"] = sysSet.MaintLot;
         ViewBag.MaintVAT    = sysSet.MaintVAT;
         Session["MaintVAT"] = sysSet.MaintVAT;
         ViewBag.Reason      = LoadDropDown.LoadAdjReason();
         ViewBag.ApprBy      = new SelectList(_EmployeeService.All().ToList(), "Id", "UserName");
         ViewBag.JobNo       = LoadDropDown.LoadJobInfo();
         var VchrConv = _vchrSetService.All().ToList().FirstOrDefault().VchrConv;
         Session["VchrConv"] = VchrConv;
         ViewBag.PurRetNo    = LoadDropDown.GeneratePurRetNo(_PurRetMainService, "", Session["BranchCode"].ToString(), "", Session["VchrConv"].ToString());
         ViewBag.errMsg      = errMsg;
         return(View());
     }
     else
     {
         return(RedirectToAction("SecUserLogin", "SecUserLogin"));
     }
 }
 public ActionResult ChequeReceipts(string errMsg)
 {
     if (Session["UserID"] != null)
     {
         ViewBag.BranchCode  = new SelectList(_branchService.All().ToList(), "BranchCode", "BranchName");
         ViewBag.Accode      = LoadDropDown.LoadMRAgainstDDL();
         ViewBag.SubCode     = new SelectList(_subsidiaryService.All().Where(x => x.SubType == "1").ToList(), "SubCode", "SubName");//LoadDropDown.LoadSubsidiaryByPurpuse("", _subsidiaryService, _subsidiaryCtrlService);
         ViewBag.BankCode    = new SelectList(_bankInfoService.All().ToList(), "BankCode", "BankName");
         ViewBag.DepositBank = LoadDropDown.LoadDepositBankDDL();
         ViewBag.UpdateBy    = new SelectList(_employeeInfoService.All().ToList(), "Id", "UserName");
         DateTime datetime = DateTime.Now;
         ViewBag.GLProvition = Counter("BR");
         ViewBag.GLEntries   = CountEntries("BR", datetime);
         var sysSet = _sysSetService.All().ToList().FirstOrDefault();
         ViewBag.MaintJob = sysSet.MaintJob;
         ViewBag.JobNo    = LoadDropDown.LoadJobInfo();
         var VchrConv = _vchrSetService.All().ToList().FirstOrDefault().VchrConv;
         Session["VchrConv"] = VchrConv;
         ViewBag.errMsg      = errMsg;
         return(View());
     }
     else
     {
         return(RedirectToAction("SecUserLogin", "SecUserLogin"));
     }
 }
 // GET: OnlineMoneyReceipt
 public ActionResult OnlineMoneyReceipt()
 {
     if (Session["UserID"] != null)
     {
         ViewBag.BranchCode  = new SelectList(_branchService.All().ToList(), "BranchCode", "BranchName");
         ViewBag.MRAgainst   = LoadDropDown.LoadMRAgainstDDL();
         ViewBag.CustCode    = new SelectList(_subsidiaryInfoService.All().Where(x => x.SubType == "1").ToList(), "SubCode", "SubName");
         ViewBag.bankCode    = new SelectList(_bankInfoService.All().ToList(), "BankCode", "BankName");
         ViewBag.DepositBank = LoadDropDown.LoadDepositBankDDL();
         ViewBag.CollectedBy = new SelectList(_employeeInfoService.All().ToList(), "Id", "UserName");
         var CashAc = _defACService.All().ToList().FirstOrDefault().CashAc;
         ViewBag.Accode = LoadDropDown.LoadGLAc(CashAc, _newChartService);
         DateTime datetime = DateTime.Now;
         ViewBag.GLProvition = Counter("BR");
         ViewBag.GLEntries   = CountEntries("BR", datetime);
         var sysSet = _sysSetService.All().ToList().FirstOrDefault();
         ViewBag.MaintJob = sysSet.MaintJob;
         ViewBag.JobNo    = LoadDropDown.LoadJobInfo();
         ViewBag.GetwayId = LoadDropDown.LoadGetwayProvider();
         var VchrConv = _vchrSetService.All().ToList().FirstOrDefault().VchrConv;
         Session["VchrConv"] = VchrConv;
         return(View());
     }
     else
     {
         return(RedirectToAction("SecUserLogin", "SecUserLogin"));
     }
 }
Beispiel #5
0
 // GET: CustAdjustment
 public ActionResult CustAdjustment()
 {
     if (Session["UserID"] != null)
     {
         DateTime datetime = DateTime.Now;
         ViewBag.GLProvition = Counter("JB");
         ViewBag.GLEntries   = CountEntries("JB", datetime);
         var sysSet = _sysSetService.All().ToList().FirstOrDefault();
         ViewBag.MaintJob  = sysSet.MaintJob;
         ViewBag.CustCode  = new SelectList(_subsidiaryInfoService.All().ToList().Where(x => x.SubType == "1").OrderBy(x => x.SubName), "SubCode", "SubName");
         ViewBag.InvNo     = LoadDropDown.LoadEmpDlList();
         ViewBag.AdjReason = LoadDropDown.LoadAdjReason();
         ViewBag.ApprBy    = new SelectList(_EmployeeService.All().ToList(), "Id", "UserName");
         ViewBag.JobNo     = LoadDropDown.LoadJobInfo();
         var VchrConv = _vchrSetService.All().ToList().FirstOrDefault().VchrConv;
         Session["VchrConv"] = VchrConv;
         ViewBag.AdjNo       = LoadDropDown.GenerateAdjustmentNo(_custAdjustmentService, "", Session["BranchCode"].ToString(), "", Session["VchrConv"].ToString());
         return(View());
     }
     else
     {
         return(RedirectToAction("SecUserLogin", "SecUserLogin"));
     }
 }
Beispiel #6
0
        public ActionResult Register()
        {
            //var branch = _employeeService.All().ToList().FirstOrDefault(x => x.Email == User.Identity.Name);
            //Session["Garden"] = branch.BranchCode;

            List <string> roles = new List <string>();

            //  List<string> branch = new List<string>();
            foreach (string role in System.Web.Security.Roles.GetAllRoles().ToList())
            {
                roles.Add(role);
            }
            ViewBag.Roles = roles;
            //ViewBag.BranchCode = branch;

            ViewBag.BranchCode = new SelectList(_branchService.All().ToList(), "BranchCode", "BranchName");
            ViewBag.Id         = new SelectList(_employeeService.All().ToList(), "Id", "UserName");
            // ViewBag.RecvItem = LoadDropDown.LoadItem(_itemInfoService);
            return(View());
        }