Exemplo n.º 1
0
        public ActionResult LoadData(Level1Models LSModel)
        {
            GenericService act = new GenericService();

            SqlParameter[] parameters =
            {
                new SqlParameter("@Activity", "GetData")
            };
            DataSet ds = act.Generic("LS_SPLevel1", parameters);

            var Object = ConvertDataTableToJSON(ds.Tables[0]);


            return(this.Json(Object, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public ActionResult GetAllEmp(int PageNumber = 1, int PageSize = 3)
        {
            EmployeeCVModel emp = new EmployeeCVModel();
            GenericService  act = new GenericService();

            SqlParameter[] parameters =
            {
                new SqlParameter("@EmpID",      SqlDbType.NVarChar, 12)
                {
                    Value = emp.EmpID ?? (object)DBNull.Value
                },
                new SqlParameter("@VLastName",  SqlDbType.NVarChar, 100)
                {
                    Value = emp.VLastName ?? (object)DBNull.Value
                },
                new SqlParameter("@VFirstName", SqlDbType.NVarChar, 100)
                {
                    Value = emp.VFirstName ?? (object)DBNull.Value
                },
                new SqlParameter("@NickName",   SqlDbType.NVarChar, 50)
                {
                    Value = emp.NickName ?? (object)DBNull.Value
                },
                new SqlParameter("@DOB",        SqlDbType.NVarChar, 50)
                {
                    Value = emp.DOB ?? (object)DBNull.Value
                },
                new SqlParameter("@Gender",     SqlDbType.NVarChar, 1)
                {
                    Value = emp.Gender ?? (object)DBNull.Value
                },
                new SqlParameter("@Email",      SqlDbType.NVarChar, 50)
                {
                    Value = emp.Email ?? (object)DBNull.Value
                },
                new SqlParameter("@ACTION",     "SelectAll")
                //new SqlParameter("@PageNumber",PageNumber),
                //new SqlParameter("@PageSize",PageSize)
            };
            //DataSet ds = act.crud("sp_InsertUpdateDelete_tblEmpCV", parameters);
            DataSet ds = act.Generic("sp_InsertUpdateDelete_tblEmpCV", parameters);

            ViewBag.emp = ds.Tables[0];
            return(View(new EmployeeCVModel()));
        }
Exemplo n.º 3
0
        public ActionResult DeleteEmp(string id, string email)
        {
            EmployeeCVModel emp = new EmployeeCVModel();
            GenericService  act = new GenericService();

            emp.EmpID = id;
            emp.Email = email;
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmpID",      SqlDbType.NVarChar, 12)
                {
                    Value = emp.EmpID ?? (object)DBNull.Value
                },
                new SqlParameter("@VLastName",  SqlDbType.NVarChar, 100)
                {
                    Value = emp.VLastName ?? (object)DBNull.Value
                },
                new SqlParameter("@VFirstName", SqlDbType.NVarChar, 100)
                {
                    Value = emp.VFirstName ?? (object)DBNull.Value
                },
                new SqlParameter("@NickName",   SqlDbType.NVarChar, 50)
                {
                    Value = emp.NickName ?? (object)DBNull.Value
                },
                new SqlParameter("@DOB",        SqlDbType.NVarChar, 50)
                {
                    Value = emp.DOB ?? (object)DBNull.Value
                },
                new SqlParameter("@Gender",     SqlDbType.NVarChar, 1)
                {
                    Value = emp.Gender ?? (object)DBNull.Value
                },
                new SqlParameter("@Email",      SqlDbType.NVarChar, 50)
                {
                    Value = emp.Email ?? (object)DBNull.Value
                },
                new SqlParameter("@ACTION",     "SelectByID")
            };
            DataSet ds = act.Generic("sp_InsertUpdateDelete_tblEmpCV", parameters);

            ViewBag.emp = ds.Tables[0];
            return(View());
        }
Exemplo n.º 4
0
        public ActionResult CreateEmp(EmployeeCVModel emp)
        {
            GenericService act = new GenericService();

            emp.EmpID = act.getOutPut("sp_AutoGenID_Emp_Test", "@EmpID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmpID",      SqlDbType.NVarChar, 12)
                {
                    Value = emp.EmpID ?? (object)DBNull.Value
                },
                new SqlParameter("@VLastName",  SqlDbType.NVarChar, 100)
                {
                    Value = emp.VLastName ?? (object)DBNull.Value
                },
                new SqlParameter("@VFirstName", SqlDbType.NVarChar, 100)
                {
                    Value = emp.VFirstName ?? (object)DBNull.Value
                },
                new SqlParameter("@NickName",   SqlDbType.NVarChar, 50)
                {
                    Value = emp.NickName ?? (object)DBNull.Value
                },
                new SqlParameter("@DOB",        SqlDbType.NVarChar, 50)
                {
                    Value = emp.DOB ?? (object)DBNull.Value
                },
                new SqlParameter("@Gender",     SqlDbType.NVarChar, 1)
                {
                    Value = emp.Gender ?? (object)DBNull.Value
                },
                new SqlParameter("@Email",      SqlDbType.NVarChar, 50)
                {
                    Value = emp.Email ?? (object)DBNull.Value
                },
                new SqlParameter("@ACTION",     "Insert")
            };
            DataSet ds = act.Generic("sp_InsertUpdateDelete_tblEmpCV", parameters);

            return(RedirectToAction("GetAllEmp"));
        }
Exemplo n.º 5
0
        public ActionResult DeleteEmp(string id, string email, EmployeeCVModel emp)
        {
            GenericService act = new GenericService();

            emp.EmpID = id;
            emp.Email = email;
            SqlParameter[] parameters =
            {
                new SqlParameter("@EmpID",      SqlDbType.NVarChar, 12)
                {
                    Value = emp.EmpID ?? (object)DBNull.Value
                },
                new SqlParameter("@VLastName",  SqlDbType.NVarChar, 100)
                {
                    Value = emp.VLastName ?? (object)DBNull.Value
                },
                new SqlParameter("@VFirstName", SqlDbType.NVarChar, 100)
                {
                    Value = emp.VFirstName ?? (object)DBNull.Value
                },
                new SqlParameter("@NickName",   SqlDbType.NVarChar, 50)
                {
                    Value = emp.NickName ?? (object)DBNull.Value
                },
                new SqlParameter("@DOB",        SqlDbType.NVarChar, 50)
                {
                    Value = emp.DOB ?? (object)DBNull.Value
                },
                new SqlParameter("@Gender",     SqlDbType.NVarChar, 1)
                {
                    Value = emp.Gender ?? (object)DBNull.Value
                },
                new SqlParameter("@Email",      SqlDbType.NVarChar, 50)
                {
                    Value = emp.Email ?? (object)DBNull.Value
                },
                new SqlParameter("@ACTION",     "Delete")
            };
            act.Generic("sp_InsertUpdateDelete_tblEmpCV", parameters);
            return(RedirectToAction("GetAllEmp"));
        }
Exemplo n.º 6
0
        public ActionResult GetAllEmp(EmployeeCVModel emp)
        {
            SqlConnection conn = new SqlConnection(ConnectionString);

            GenericService act = new GenericService();

            if (emp.searchtxt != null)
            {
                SqlParameter[] parameters =
                {
                    new SqlParameter("@Searchtext", SqlDbType.NVarChar, 50)
                    {
                        Value = emp.searchtxt ?? (object)DBNull.Value
                    }
                };
                DataSet ds = act.Generic("sp_SearchData_EmpCV", parameters);
                ViewBag.emp = ds.Tables[0];
                return(View(new EmployeeCVModel()));
            }
            else
            {
                return(View());
            }
        }
Exemplo n.º 7
0
        // GET: Company
        public ActionResult GetAllCompany(int PageNumber = 1, int PageSize = 3)
        {
            LSCompanyModel com = new LSCompanyModel();
            GenericService act = new GenericService();

            SqlParameter[] parameters =
            {
                new SqlParameter("@LSCompanyID",   SqlDbType.NVarChar, 12)
                {
                    Value = com.LSCompanyID ?? (object)DBNull.Value
                },
                new SqlParameter("@LSCompanyCode", SqlDbType.NVarChar, 100)
                {
                    Value = com.LSCompanyCode ?? (object)DBNull.Value
                },
                new SqlParameter("@ShortName",     SqlDbType.NVarChar, 100)
                {
                    Value = com.ShortName ?? (object)DBNull.Value
                },
                new SqlParameter("@Name",          SqlDbType.NVarChar, 50)
                {
                    Value = com.Name ?? (object)DBNull.Value
                },
                new SqlParameter("@Address",       SqlDbType.NVarChar, 50)
                {
                    Value = com.Address ?? (object)DBNull.Value
                },
                new SqlParameter("@Phone",         SqlDbType.NVarChar, 1)
                {
                    Value = com.Phone ?? (object)DBNull.Value
                },
                new SqlParameter("@Fax",           SqlDbType.NVarChar, 50)
                {
                    Value = com.Fax ?? (object)DBNull.Value
                },
                new SqlParameter("@Rank",          SqlDbType.NVarChar, 50)
                {
                    Value = com.Rank.ToString() ?? (object)DBNull.Value
                },
                new SqlParameter("@Note",          SqlDbType.NVarChar, 50)
                {
                    Value = com.Note ?? (object)DBNull.Value
                },
                new SqlParameter("@Used",          SqlDbType.NVarChar, 50)
                {
                    Value = com.Used.ToString() ?? (object)DBNull.Value
                },
                new SqlParameter("@WorkingPlace",  SqlDbType.NVarChar, 50)
                {
                    Value = com.WorkingPlace ?? (object)DBNull.Value
                },
                new SqlParameter("@Creater",       SqlDbType.NVarChar, 50)
                {
                    Value = com.Creater ?? (object)DBNull.Value
                },
                new SqlParameter("@CreateTime",    SqlDbType.NVarChar, 50)
                {
                    Value = com.CreateTime ?? (object)DBNull.Value
                },
                new SqlParameter("@Editer",        SqlDbType.NVarChar, 50)
                {
                    Value = com.Editer ?? (object)DBNull.Value
                },
                new SqlParameter("@EditTime",      SqlDbType.NVarChar, 50)
                {
                    Value = com.EditTime ?? (object)DBNull.Value
                },
                new SqlParameter("@ACTION",        "SelectAll")
                //new SqlParameter("@PageNumber",PageNumber),
                //new SqlParameter("@PageSize",PageSize)
            };
            //DataSet ds = act.crud("sp_InsertUpdateDelete_tblEmpCV", parameters);
            DataSet ds = act.Generic("sp_InsertUpdateDelete_tblLSCompany", parameters);

            ViewBag.com = ds.Tables[0];
            return(View(new LSCompanyModel()));
        }