Esempio n. 1
0
        //Department in Dropdown
        public ActionResult GetDynamicDepartment()
        {
            FM_SignatoriesModel model = new FM_SignatoriesModel();

            model.DepartmentList = new SelectList((from s in TOSSDB.Signatory_DepartmentTable.ToList() select new { DepartmentID = s.DepartmentID, Department = s.DepartmentName }), "DepartmentID", "Department");
            return(PartialView("_DynamicDDDepartment", model));
        }
Esempio n. 2
0
        //Position in Dropdown
        public ActionResult GetDynamicSignatories()
        {
            FM_SignatoriesModel model = new FM_SignatoriesModel();

            model.DepartmentList = new SelectList((from s in TOSSDB.Signatory_PositionTable.ToList() orderby s.PositionName ascending select new { PositionID = s.PositionID, PositionName = s.PositionName }), "PositionID", "PositionName");
            return(PartialView("_DynamicDDPositionName", model));
        }
Esempio n. 3
0
        public ActionResult GetDynamicFunction(int DepartmentID)
        {
            FM_SignatoriesModel model = new FM_SignatoriesModel();

            model.DepartmentList = new SelectList((from s in TOSSDB.Functions.Where(a => a.DepartmentID == DepartmentID).ToList() select new { FunctionID = s.FunctionID, FunctionName = s.FunctionName }), "FunctionID", "FunctionName");
            return(PartialView("_DynamicDDFunctionName", model));
        }
        //Department
        #region
        //Department Table Partial View
        public ActionResult Get_DepartmentTable()
        {
            FM_SignatoriesModel model = new FM_SignatoriesModel();
            List <Signatory_DepartmentTable> tbl_Department = new List <Signatory_DepartmentTable>();

            var SQLQuery = "SELECT * FROM DB_TOSS.dbo.Signatory_DepartmentTable order by Department asc";

            //SQLQuery += " WHERE (IsActive != 0)";
            using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString()))
            {
                Connection.Open();
                using (SqlCommand command = new SqlCommand("[dbo].[SP_SignatoryDepartmentList]", Connection))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery));
                    SqlDataReader dr = command.ExecuteReader();
                    while (dr.Read())
                    {
                        tbl_Department.Add(new Signatory_DepartmentTable()
                        {
                            DepartmentID   = GlobalFunction.ReturnEmptyInt(dr[0]),
                            Department     = GlobalFunction.ReturnEmptyString(dr[1]),
                            DepartmentCode = GlobalFunction.ReturnEmptyString(dr[2]),
                        });
                    }
                }
                Connection.Close();
            }
            model.getDepartment = tbl_Department.ToList();
            return(PartialView("Department/_DepartmentTable", model.getDepartment));
        }
        //Delete Position Table
        public ActionResult DeleteDepartment(FM_SignatoriesModel model, int DepartmentID)
        {
            Signatory_DepartmentTable tblDepartment = (from e in TOSSDB.Signatory_DepartmentTable where e.DepartmentID == DepartmentID select e).FirstOrDefault();

            TOSSDB.Signatory_DepartmentTable.Remove(tblDepartment);
            TOSSDB.SaveChanges();
            return(RedirectToAction("Index"));
        }
        //Delete Position Table
        public ActionResult DeletePosition(FM_SignatoriesModel 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"));
        }
        //Get Position Update
        public ActionResult Get_UpdatePosition(FM_SignatoriesModel 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;
            return(PartialView("Position/_PositionUpdate", model));
        }
Esempio n. 8
0
        //Delete Signature Table
        public ActionResult DeleteSignature(FM_SignatoriesModel model, int SignatoriesID)
        {
            SignatoriesTable tblSignatories = (from e in TOSSDB.SignatoriesTables where e.SignatoriesID == SignatoriesID select e).FirstOrDefault();

            TOSSDB.SignatoriesTables.Remove(tblSignatories);
            TOSSDB.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult UpdatePosition(FM_SignatoriesModel model)
        {
            Signatory_PositionTable tblPosition = (from e in TOSSDB.Signatory_PositionTable where e.PositionID == model.getPositionColumns.PositionID select e).FirstOrDefault();

            tblPosition.PositionName = model.getPositionColumns.PositionName;
            TOSSDB.Entry(tblPosition);
            TOSSDB.SaveChanges();
            return(PartialView("Position/_PositionUpdate", model));
        }
        //Add Position
        public JsonResult AddPosition(FM_SignatoriesModel model)
        {
            Signatory_PositionTable tblPositionName = new Signatory_PositionTable();

            tblPositionName.PositionName = GlobalFunction.ReturnEmptyString(model.getPositionColumns.PositionName);
            TOSSDB.Signatory_PositionTable.Add(tblPositionName);
            TOSSDB.SaveChanges();
            return(Json(tblPositionName));
        }
        //Get Position Update
        public ActionResult Get_UpdateDepartment(FM_SignatoriesModel model, int DepartmentID)
        {
            Signatory_DepartmentTable tblDepartment = (from e in TOSSDB.Signatory_DepartmentTable where e.DepartmentID == DepartmentID select e).FirstOrDefault();

            model.getDepartmentColumns.DepartmentID   = tblDepartment.DepartmentID;
            model.getDepartmentColumns.Department     = tblDepartment.Department;
            model.getDepartmentColumns.DepartmentCode = tblDepartment.DepartmentCode;
            return(PartialView("Department/_DepartmentUpdate", model));
        }
        public ActionResult UpdateDepartment(FM_SignatoriesModel model)
        {
            Signatory_DepartmentTable tblDepartment = (from e in TOSSDB.Signatory_DepartmentTable where e.DepartmentID == model.getDepartmentColumns.DepartmentID select e).FirstOrDefault();

            tblDepartment.Department     = model.getDepartmentColumns.Department;
            tblDepartment.DepartmentCode = model.getDepartmentColumns.DepartmentCode;
            TOSSDB.Entry(tblDepartment);
            TOSSDB.SaveChanges();
            return(PartialView("Department/_DepartmentUpdate", model));
        }
        //Add Department
        public JsonResult AddDepartment(FM_SignatoriesModel model)
        {
            Signatory_DepartmentTable tblDepartment = new Signatory_DepartmentTable();

            tblDepartment.Department     = GlobalFunction.ReturnEmptyString(model.getDepartmentColumns.Department);
            tblDepartment.DepartmentCode = GlobalFunction.ReturnEmptyString(model.getDepartmentColumns.DepartmentCode);
            TOSSDB.Signatory_DepartmentTable.Add(tblDepartment);
            TOSSDB.SaveChanges();
            return(Json(tblDepartment));
        }
        //Get Signature Data
        public ActionResult Get_UpdateSignatories(FM_SignatoriesModel model, int SignatoriesID)
        {
            SignatoriesTable tblSignatories = (from e in TOSSDB.SignatoriesTables where e.SignatoriesID == SignatoriesID select e).FirstOrDefault();

            model.getSignatoriesColumns.SignatoriesID   = tblSignatories.SignatoriesID;
            model.getSignatoriesColumns.SignatoriesName = tblSignatories.SignatoriesName;
            model.DepartmentTempID = tblSignatories.DepartmentID;
            model.PositionTempID   = tblSignatories.PositionID;
            model.isDeptHeads      = tblSignatories.IsDeptHead;
            return(PartialView("_SignatoriesUpdate", model));
        }
        //Update Signature Data
        public ActionResult UpdateSignatories(FM_SignatoriesModel model)
        {
            SignatoriesTable tblSignatories = (from e in TOSSDB.SignatoriesTables where e.SignatoriesID == model.getSignatoriesColumns.SignatoriesID select e).FirstOrDefault();

            tblSignatories.SignatoriesName = model.getSignatoriesColumns.SignatoriesName;
            tblSignatories.PositionID      = model.PositionID;
            tblSignatories.DepartmentID    = model.DepartmentID;
            tblSignatories.IsDeptHead      = model.isDeptHeads;
            TOSSDB.Entry(tblSignatories);
            TOSSDB.SaveChanges();
            return(PartialView("_SignatoriesUpdate", model));
        }
        //Add Signatories
        public JsonResult AddSignatories(FM_SignatoriesModel model)
        {
            SignatoriesTable tblSignatories = new SignatoriesTable();

            tblSignatories.SignatoriesName = GlobalFunction.ReturnEmptyString(model.getSignatoriesColumns.SignatoriesName);
            tblSignatories.PositionID      = GlobalFunction.ReturnEmptyInt(model.PositionID);
            tblSignatories.DepartmentID    = GlobalFunction.ReturnEmptyInt(model.DepartmentID);
            tblSignatories.IsDeptHead      = GlobalFunction.ReturnEmptyBool(model.isDeptHeads);
            TOSSDB.SignatoriesTables.Add(tblSignatories);
            TOSSDB.SaveChanges();
            return(Json(tblSignatories));
        }
Esempio n. 17
0
        //Update Signature Data
        public ActionResult UpdateSignatories(FM_SignatoriesModel model)
        {
            SignatoriesTable tblSignatories = (from e in TOSSDB.SignatoriesTables where e.SignatoriesID == model.getSignatoriesColumns.SignatoriesID select e).FirstOrDefault();

            tblSignatories.SignatoriesName = GlobalFunction.ReturnEmptyString(model.getSignatoriesColumns.SignatoriesName);
            tblSignatories.PreferredName   = GlobalFunction.ReturnEmptyString(model.getSignatoriesColumns.PreferredName);
            tblSignatories.PositionID      = GlobalFunction.ReturnEmptyInt(model.PositionID);
            tblSignatories.DepartmentID    = GlobalFunction.ReturnEmptyInt(model.DepartmentID);
            tblSignatories.IsDeptHead      = GlobalFunction.ReturnEmptyBool(model.isDeptHeads);
            tblSignatories.FunctionID      = GlobalFunction.ReturnEmptyInt(model.FunctionID);
            tblSignatories.DivisionName    = GlobalFunction.ReturnEmptyString(model.getSignatoriesColumns.DivisionName);
            tblSignatories.isActive        = GlobalFunction.ReturnEmptyBool(model.isActive);
            TOSSDB.Entry(tblSignatories);
            TOSSDB.SaveChanges();
            return(PartialView("_SignatoriesUpdate", model));
        }
Esempio n. 18
0
        //Signatories Table Partial View
        public ActionResult GetListOfSignatories()
        {
            FM_SignatoriesModel    model = new FM_SignatoriesModel();
            List <SignatoriesList> TblsignatoriesLists = new List <SignatoriesList>();

            var SQLQuery = "SELECT SignatoriesID,SignatoriesName,PreferredName,PositionName,DepartmentName,IsDeptHead,FunctionName,DivisionName,isActive FROM DB_TOSS.dbo.SignatoriesTable,DB_TOSS.dbo.Signatory_PositionTable,Functions,DB_TOSS.dbo.Signatory_DepartmentTable where DB_TOSS.dbo.Signatory_PositionTable.PositionID = DB_TOSS.dbo.SignatoriesTable.PositionID and DB_TOSS.dbo.Signatory_DepartmentTable.DepartmentID = DB_TOSS.dbo.SignatoriesTable.DepartmentID AND Functions.FunctionID = SignatoriesTable.FunctionID";

            //SQLQuery += " WHERE (IsActive != 0)";
            using (SqlConnection Connection = new SqlConnection(GlobalFunction.ReturnConnectionString()))
            {
                Connection.Open();
                using (SqlCommand command = new SqlCommand("[dbo].[SP_SignatoryTable]", Connection))
                {
                    command.CommandType = CommandType.StoredProcedure;
                    command.Parameters.Add(new SqlParameter("@SQLStatement", SQLQuery));
                    SqlDataReader dr = command.ExecuteReader();
                    while (dr.Read())
                    {
                        TblsignatoriesLists.Add(new SignatoriesList()
                        {
                            SignatoriesID   = GlobalFunction.ReturnEmptyInt(dr[0]),
                            SignatoriesName = GlobalFunction.ReturnEmptyString(dr[1]),
                            PreferredName   = GlobalFunction.ReturnEmptyString(dr[2]),
                            PositionName    = GlobalFunction.ReturnEmptyString(dr[3]),
                            DepartmentName  = GlobalFunction.ReturnEmptyString(dr[4]),
                            isDeptHead      = GlobalFunction.ReturnEmptyBool(dr[5]),
                            FunctionName    = GlobalFunction.ReturnEmptyString(dr[6]),
                            DivisionName    = GlobalFunction.ReturnEmptyString(dr[7]),
                            isActive        = GlobalFunction.ReturnEmptyBool(dr[8]),
                        });
                    }
                }
                Connection.Close();
            }

            model.getSignatoriesList = TblsignatoriesLists.ToList();


            return(PartialView("_SignatoriesTable", model.getSignatoriesList));
        }
        //Position
        #region
        //Get Add Position Partial View
        public ActionResult Get_AddPosition()
        {
            FM_SignatoriesModel model = new FM_SignatoriesModel();

            return(PartialView("Position/_PositionAdd", model));
        }
        //Get Add Department Partial View
        public ActionResult Get_AddDepartment()
        {
            FM_SignatoriesModel model = new FM_SignatoriesModel();

            return(PartialView("Department/_DepartmentAdd", model));
        }
Esempio n. 21
0
        //Get Signatories Add Partial View
        public ActionResult Get_SignatoriesAdd()
        {
            FM_SignatoriesModel model = new FM_SignatoriesModel();

            return(PartialView("_SignatoriesAdd", model));
        }
Esempio n. 22
0
        public ActionResult Index()
        {
            FM_SignatoriesModel model = new FM_SignatoriesModel();

            return(View());
        }