当前位置: 首页>>代码示例>>C#>>正文


C# LoginViewModel.userLogin类代码示例

本文整理汇总了C#中WebApp_AAJI.Models.LoginViewModel.userLogin的典型用法代码示例。如果您正苦于以下问题:C# LoginViewModel.userLogin类的具体用法?C# LoginViewModel.userLogin怎么用?C# LoginViewModel.userLogin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


LoginViewModel.userLogin类属于WebApp_AAJI.Models命名空间,在下文中一共展示了LoginViewModel.userLogin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Create

        public ActionResult Create([Bind(Include="tftID,tftName,accountNo,createdDate,createdUser,modifiedDate,modifiedUser")] typeFinanceTransaction typefinancetransaction)
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });

            ViewBag.ddlTft = DDLTypeFinanceTransaction("");
            ViewBag.ddlAccount = new SelectList(db.chartOfAccounts.Where(x => x.levelID == 3).Select(x => new { x.id, accountName = "[" + x.accountNo + "] " + x.accountName }), "id", "accountName");

            if (ModelState.IsValid)
            {
                lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
                try
                {                    
                    using (TransactionScope ts = new TransactionScope())
                    {
                        typefinancetransaction.createdDate = DateTime.Now;
                        typefinancetransaction.createdUser = lvm.userID;
                        db.typeFinanceTransactions.Add(typefinancetransaction);
                        db.SaveChanges();
                        ts.Complete();
                    }
                    return RedirectToAction("Index");
                }
                catch(Exception exc)
                {
                    string a = exc.Message;
                }
            }

            return View(typefinancetransaction);
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:35,代码来源:TypeFinanceTransactionController.cs

示例2: Create

        public ActionResult Create(level level)
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });
            
            if (ModelState.IsValid)
            {
                lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
                level.createdUser = lvm.userID;
                level.createdDate = DateTime.Now;
                db.levels.Add(level);
                db.SaveChanges();

                if (level.levelID > 0)
                {
                    //harusnya kesini
                    return RedirectToAction("Edit", "Level", new { id = level.levelID });
                }
                else
                {
                    return RedirectToAction("Index");
                }
            }

            return View(level);
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:30,代码来源:LevelController.cs

示例3: Index

        // GET: /EmployeeClaimMedical/
        public ActionResult Index()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            loadDefault(string.Empty);
            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            return View(db.employeeClaimMedicals.Where(x=>x.employeeID==lvm.employeeId).ToList());
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:10,代码来源:EmployeeClaimMedicalPersonalController.cs

示例4: loadDetail

        public async Task<ActionResult> loadDetail(DateTime startDate, DateTime endDate)
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });


            ViewBag.linkAction = "?startDate=" + startDate.ToString() + "&endDate=" + endDate.ToString();
            string strConnection = conDB.conString;// System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;
            using (SqlCommand cmd = new SqlCommand())
            {
                using (SqlDataAdapter da = new SqlDataAdapter())
                {
                    DataTable ds = new DataTable();
                    cmd.CommandText = "sp_reportAttendanceSummary";
                    cmd.Connection = new SqlConnection(strConnection);
                    cmd.CommandType = CommandType.StoredProcedure;
                    cmd.Parameters.AddWithValue("@startDate", startDate);
                    cmd.Parameters.AddWithValue("@endDate", endDate);
                    da.SelectCommand = cmd;
                    da.Fill(ds);

                    foreach (IDataParameter param in cmd.Parameters)
                    {
                        if (param.Value == null) param.Value = DBNull.Value;
                    }

                    //if (ds.Rows.Count > 0)
                    ViewBag.detail = ds;
                }
            }

            List<string> periodAttendance = new List<string>();
            DateTime dateStarted = startDate;
            int yearStartPeriod = startDate.Year;
            int monthStartPeriod = startDate.Month;
            for (int i = 0; i <= ((endDate - startDate).TotalDays); i++ )
            {
                periodAttendance.Add(dateStarted.ToString("dd-MMM-yyyy"));
                if(DateTime.DaysInMonth(yearStartPeriod, monthStartPeriod) == dateStarted.Day)
                    dateStarted = new DateTime(dateStarted.Year, dateStarted.Month, 1).AddMonths(1);
                else
                    dateStarted = dateStarted.AddDays(1);
            }
            ViewBag.AttendancePeriod = periodAttendance;


            string sql = string.Empty;
            sql += "SELECT * FROM dbo.v_employee WHERE resignDate IS NULL";
            DataTable dtEmployee = conDB.executeReader(sql);
            ViewBag.dtEmployee = dtEmployee;
            ViewBag.typeAbsensi = db.typeAbsensis.ToList();
            return PartialView("ReportSummaryAttendance_PartialPage");
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:57,代码来源:ReportSummaryAttendanceController.cs

示例5: Index

        // GET: /Vendor/
        public ActionResult Index()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });

            return View(db.vendors.ToList());
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:12,代码来源:VendorController.cs

示例6: Create

        // GET: /MenuValidation/Create
        public ActionResult Create()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });

            ViewBag.MenuParent = cm.ddlMenuParent(string.Empty);
            ViewBag.menuExclusive = cm.ddlMenuValidationExclusive("");
            var menuAssign = db.Menus.Where(m => m.menuIsActive == true && m.menuLink != null) // && m.menuParent != 30 && m.menuID != 30)
		     .ToList();
            ViewBag.userID = new SelectList(db.Users.Where(m => m.isActive == true && m.userID != "admin").ToList(), "userID", "userName");

            var modelMenu = new menuValidation();
            for(int i=0;i<menuAssign.Count;i++)
            {
                var editor = new menuValidation.SelectMenuAuthorize()
                {
                    Id = Convert.ToInt32(menuAssign[i].menuID.ToString()),
                    menuSelected = false,
                    Name = menuAssign[i].menuName.ToString()
                };
                modelMenu.MenuAuth.Add(editor);
            }
            ViewData["menuGeneral"] = modelMenu.MenuAuth.OrderBy(x=>x.Name).ToList();

            #region checkBoxUser
            var modelUser = new user();
            var tempUser = db.Users.Where(x => x.userID != "admin" && x.isActive == true).ToList();
            foreach (var a in tempUser)
            {
                var editor = new user.SelectActionUser()
                {
                    userId = a.userID,
                    userSelected = false,
                    userName = a.userName
                };
                modelUser.userCheckBox.Add(editor);
            }
            ViewData["userAssign"] = modelUser.userCheckBox.OrderBy(x => x.userName).ToList();
            #endregion

            //var ax = new SelectList(db.Menus.Where(m => m.menuIsActive == true && m.menuLink != null), "menuID", "menuName");
            //List<SelectListItem> categoryList = new List<SelectListItem>();
            //foreach(var a in ax.ToList())
            //{
            //    categoryList.Add(new SelectListItem { Text = a.Text, Value = a.Value });
            //}
            //model.CategoryItems = categoryList;
            
            return View();
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:55,代码来源:MenuValidationController.cs

示例7: Create

        // GET: /Bank/Create
        public ActionResult Create()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });

            ViewBag.coa = new SelectList((db.chartOfAccounts.Where(x => x.levelID == 3 && x.accountName.Contains("bank")).Select(x => new { x.id, x.accountName}).OrderBy(x => x.accountName)), "id", "accountName");
            return View();
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:13,代码来源:BankController.cs

示例8: ApprovalProcess

        public async Task<ActionResult> ApprovalProcess(string act, string id)
        {
                lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
                purchaseRequestHeader model = db.purchaseRequestHeaders.Find(id);
                model.approvedStatus = act == "approved" ? true : false;
                model.approvedDate = DateTime.Now;
                model.approvedBy = lvm.userID;
                db.Entry(model).State = EntityState.Modified;
                db.SaveChanges();

                return RedirectToAction("Index", "PurchaseRequestHeader");
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:12,代码来源:PurchaseRequestController.cs

示例9: Index

        // GET: /Bank/
        public ActionResult Index()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });
            
            ViewData["coa"] = db.chartOfAccounts.Where(x => x.levelID == 3 && x.accountName.Contains("bank")).ToList();
            return View(db.banks.ToList());
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:13,代码来源:BankController.cs

示例10: Index

        // GET: /GroupEmail/
        public ActionResult Index()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });

            ViewBag.email = db.emails.OrderBy(a=>a.emailName) as IEnumerable<email>;
            return View(db.groupEmails.ToList());
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:13,代码来源:GroupEmailController.cs

示例11: ApprovalProcess

        public async Task<ActionResult> ApprovalProcess(string act, string id)
        {
            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            bankCashPaymentVoucher apv = db.bankCashPaymentVouchers.Find(id);
            apv.approvedStatus = act == "approved" ? true : false;
            apv.approvedDate = DateTime.Now;
            apv.approvedBy = lvm.userID;
            db.Entry(apv).State = EntityState.Modified;
            db.SaveChanges();

            return RedirectToAction("Index");
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:12,代码来源:BankCashPaymentVoucherController.cs

示例12: Create

        // GET: /User/Create
        public ActionResult Create()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });

            ViewBag.Dept = new SelectList(db.departments.ToList(),"deptID","deptName");
            return View();
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:13,代码来源:UserController.cs

示例13: Index

        // GET: /Divisi/
        public ActionResult Index()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });

            ViewData["Dept"] = db.departments.ToList();
            return View(db.divisis.OrderBy(x => new { x.deptID, x.divisiName }).ToList());
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:13,代码来源:DivisiController.cs

示例14: Index

		// GET: /SisaSaldoCuti/
		public ActionResult Index()
		{
			if (acm.cekSession() == false)
				return RedirectToAction("Logout", "Account");

			lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
			if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
				return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });

			//loadAbsensi(DateTime.Now.Year);
			return View(db.sisaSaldoCutis.ToList());
		}
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:13,代码来源:SisaSaldoCutiController.cs

示例15: Create

        // GET: /Vendor/Create
        public ActionResult Create()
        {
            if (acm.cekSession() == false)
                return RedirectToAction("Logout", "Account");

            lvm = Session["sessionUserLogin"] as LoginViewModel.userLogin;
            if (acm.cekValidation(Url.Action().ToString()) == false && lvm.isAdmin == false)
                return RedirectToAction("NotAuthorized", "Account", new { menu = Url.Action().ToString() });
            
            ViewBag.Bank = ccm.ddlBank(string.Empty);
            return View();
        }
开发者ID:alpialip,项目名称:Web-Aaji,代码行数:13,代码来源:VendorController.cs


注:本文中的WebApp_AAJI.Models.LoginViewModel.userLogin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。