Exemplo n.º 1
0
        //Position Table Partial View
        public ActionResult Get_PositionTable()
        {
            FM_Position_Position model        = new FM_Position_Position();
            List <PositionList>  tbl_Position = new List <PositionList>();

            var SQLQuery = "SELECT * FROM DB_TOSS.dbo.Signatory_PositionTable order by PositionName asc";

            //SQLQuery += " WHERE (IsActive != 0)";
            using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString()))
            {
                Connection.Open();
                using (SqlCommand command = new SqlCommand("[dbo].[SP_PositionList]", Connection))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery));
                    SqlDataReader dr = command.ExecuteReader();
                    while (dr.Read())
                    {
                        tbl_Position.Add(new PositionList()
                        {
                            PositionID   = GlobalFunction.ReturnEmptyInt(dr[0]),
                            PositionName = GlobalFunction.ReturnEmptyString(dr[1]),
                            PositionCode = GlobalFunction.ReturnEmptyString(dr[2]),
                        });
                    }
                }
                Connection.Close();
            }
            model.getPositionList = tbl_Position.ToList();
            return(PartialView("_PositionTable", model.getPositionList));
        }
Exemplo n.º 2
0
        //Delete Position Table
        public ActionResult DeletePosition(FM_Position_Position model, int PositionID)
        {
            Signatory_PositionTable tblPosition = (from e in TOSSDB.Signatory_PositionTable where e.PositionID == PositionID select e).FirstOrDefault();

            TOSSDB.Signatory_PositionTable.Remove(tblPosition);
            TOSSDB.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 3
0
        //Get Position Update
        public ActionResult Get_UpdatePosition(FM_Position_Position model, int PositionID)
        {
            Signatory_PositionTable tblPosition = (from e in TOSSDB.Signatory_PositionTable where e.PositionID == PositionID select e).FirstOrDefault();

            model.getPositioncolumns.PositionID   = tblPosition.PositionID;
            model.getPositioncolumns.PositionName = tblPosition.PositionName;
            model.getPositioncolumns.PositionCode = tblPosition.PositionCode;
            return(PartialView("_UpdatePosition", model));
        }
Exemplo n.º 4
0
        public ActionResult UpdatePosition(FM_Position_Position model)
        {
            Signatory_PositionTable tblPosition = (from e in TOSSDB.Signatory_PositionTable where e.PositionID == model.getPositioncolumns.PositionID select e).FirstOrDefault();

            tblPosition.PositionName = model.getPositioncolumns.PositionName;
            tblPosition.PositionCode = model.getPositioncolumns.PositionCode;
            TOSSDB.Entry(tblPosition);
            TOSSDB.SaveChanges();
            return(PartialView("_UpdatePosition", model));
        }
Exemplo n.º 5
0
        //Add Position
        public JsonResult AddPosition(FM_Position_Position model)
        {
            Signatory_PositionTable tblPositionName = new Signatory_PositionTable();

            tblPositionName.PositionName = GlobalFunction.ReturnEmptyString(model.getPositioncolumns.PositionName);
            tblPositionName.PositionCode = GlobalFunction.ReturnEmptyString(model.getPositioncolumns.PositionCode);
            TOSSDB.Signatory_PositionTable.Add(tblPositionName);
            TOSSDB.SaveChanges();
            return(Json(tblPositionName));
        }
Exemplo n.º 6
0
        //Get Add Position Partial View
        public ActionResult Get_AddPosition()
        {
            FM_Position_Position model = new FM_Position_Position();

            return(PartialView("_AddPosition", model));
        }