コード例 #1
0
        public ActionResult Edetails(int ide, int idee)
        {
            empid  = ide;
            loanid = idee;
            List <string> l = new List <string>();
            string        r = "Request Status";
            string        q = "select Value from Lookup where Category = '" + r + "'";

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlCommand    cmd    = new SqlCommand(q, conn);
            SqlDataReader reader = cmd.ExecuteReader();
            string        value  = "0";

            //  int i = 0;
            while (reader.Read())
            {
                value = (reader[0].ToString());
                //   l[i] = value;
                l.Add(value);

                // i++;
            }
            DB7Entities4 db  = new DB7Entities4();
            Lookup       db1 = new Lookup();

            ViewBag.choice = new SelectList(l);
            //s  choice.SelectedValue = l.Attributes("InitialValue");
            var        getRequestStatus = db.LoanRequestStatus.ToList();
            SelectList list             = new SelectList(getRequestStatus, "LoanId", "RequestStatus");

            ViewBag.requeststatus = list;

            DataTable dt = new DataTable();

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            string         query1 = "select Employee.Id,LoanApply.LoanApplyId,FirstName +' '+ LastName as [Name], Email,Department.Name,Designation,Salary,HireDate,RequestDate,LoanMoney,NoOfInstallments,InstallmentStartDate,InstallmentEndDate,RequestDate from Employee Join LoanApply on Employee.Id = LoanApply.EmployeeId join LoanRequestStatus on LoanApply.LoanApplyId =  LoanRequestStatus.LoanId join Department on Department.Id = Employee.DepartmentId where RequestStatus = 'Pending' and Employee.Id = '" + ide + "' and  LoanApplyId = '" + idee + "'";
            SqlDataAdapter da     = new SqlDataAdapter(query1, conn);

            da.Fill(dt);
            return(View(dt));
        }
コード例 #2
0
        public ActionResult prodocumentsverify(int ide, int idee)
        {
            DataTable dt = new DataTable();

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            loanide = idee;
            List <string> l  = new List <string>();
            string        r  = "Request Status";
            string        q1 = "select Value from Lookup where Category = '" + r + "'";

            if (conn.State == ConnectionState.Closed)
            {
                conn.Open();
            }
            SqlCommand    cmd    = new SqlCommand(q1, conn);
            SqlDataReader reader = cmd.ExecuteReader();
            string        value  = "0";

            //  int i = 0;
            while (reader.Read())
            {
                value = (reader[0].ToString());
                //   l[i] = value;
                l.Add(value);

                // i++;
            }
            DB7Entities4 db  = new DB7Entities4();
            Lookup       db1 = new Lookup();

            ViewBag.choice = new SelectList(l);
            string a  = "Against Provident Fund";
            string st = "Accepted";
            string q;

            q = "select Employee.Id,LoanApply.LoanApplyId, FirstName +' '+ LastName as [Name], Email,LoanMoney,LoanApply.[RequestDate],NoOfInstallments,[Installment Money],InstallmentStartDate,InstallmentEndDate,PropertyDocument,AutomobileDocument,SubmissionDate,IsDefaulter from Employee Join LoanApply on Employee.Id = LoanApply.EmployeeId join LoanCategory on LoanApply.LoanCategory = LoanCategory.Id join LoanRequestStatus on LoanApply.LoanApplyId =  LoanRequestStatus.LoanId join LoanDocumentVerify on LoanDocumentVerify.LoanId = LoanApply.LoanApplyId where LoanDocumentVerify.LoanId ='" + idee + "'";

            SqlDataAdapter da = new SqlDataAdapter(q, conn);

            da.Fill(dt);

            // r data = db.LoanApplies.SqlQuery(query).ToList();
            return(View(dt));
        }
コード例 #3
0
        public ActionResult Login2(Models.Person emp)
        {
            using (var context = new DB7Entities4())
            {
                bool isValid  = context.Employees.Any(x => x.Email == emp.Email && x.Password == emp.Password);
                bool isValid1 = context.Admins.Any(x => x.Email == emp.Email && x.Password == emp.Password);

                if (isValid)
                {
                    FormsAuthentication.SetAuthCookie(emp.Email, false);
                    return(RedirectToAction("welcome", "loan\\welcome"));
                }
                else if (isValid1)
                {
                    FormsAuthentication.SetAuthCookie(emp.Email, false);
                    return(RedirectToAction("welcome", "HR\\welcome"));
                }

                ModelState.AddModelError("", "Invalid Email or Password");
                return(View());
            }
        }