Esempio n. 1
0
        public UserProvider GetByUserID(string Uid)
        {
            string  filterExpression = "U.UserID='" + Uid + "'";
            DataSet ds = new DataSet();

            try
            {
                SqlCommand command = new SqlCommand();
                this.ConnectionOpen();
                command.Connection  = Connection;
                command.CommandType = CommandType.StoredProcedure;
                command.CommandText = StoredProcedureNames.UserGet;
                command.Parameters.Add("@FilterExpression", SqlDbType.VarChar).Value = filterExpression;
                command.Parameters.Add("@Option", SqlDbType.Int).Value = DBConstants.DataLoadingOption.LoadWithFilterExpression;
                sqlDataAdapter = new SqlDataAdapter(command);
                sqlDataAdapter.Fill(ds);
                this.ConnectionClosed();
            }
            catch (SqlException exp)
            {
                throw new Exception(exp.Message);
            }
            if ((ds == null) || (ds.Tables[0].Rows.Count == 0))
            {
                return(null);
            }
            else
            {
                return(DataTableConversion.ToCollection <UserProvider>(ds.Tables[0])[0]);
            }
        }
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = iTicketService.GetByID(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    Number.Text        = dt.Rows[0]["Number"].ToString();
                    Price.Text         = dt.Rows[0]["Price"].ToString();
                    Submit.Text        = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = iTicketService.Delete(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
Esempio n. 3
0
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //rowcommand for grid view function performing
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = iPositionInterface.GetPositionByIDFunc(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    PositionName.Text  = dt.Rows[0]["PositionName"].ToString();
                    DailyRate.Text     = dt.Rows[0]["DailyRate"].ToString();
                    MonthlyRate.Text   = dt.Rows[0]["MonthlyRate"].ToString();
                    Submit.Text        = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();//datatable instance
                bool      result = iPositionInterface.DeletePositionFunc(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
Esempio n. 4
0
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = jobInterface.GetJobByID(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    JobName.Text       = dt.Rows[0]["Job"].ToString();
                    MinSalary.Text     = dt.Rows[0]["MinSalary"].ToString();
                    MaxSalary.Text     = dt.Rows[0]["MaxSalary"].ToString();
                    Submit.Text        = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = jobInterface.DeleteJob(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //TeacherAllocationViewModel vmModel = new TeacherAllocationViewModel();
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            //vmModel.ID = Convert.ToInt32(id);
            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = iTeacherAllocationService.GetTeacherAllocationByID(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value   = dt.Rows[0]["ID"].ToString();
                    ClassMasterID.Text   = dt.Rows[0]["ClassMasterID"].ToString();
                    TeacherMasterID.Text = dt.Rows[0]["TeacherMasterID"].ToString();
                    StudentMasterID.Text = dt.Rows[0]["StudentMasterID"].ToString();
                    Submit.Text          = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = iTeacherAllocationService.DeleteTeacherAllocation(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //EmployeeModel vmModel = new EmployeeModel();
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            //vmModel.ID = Convert.ToInt32(id);
            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = iProductSupplierRepository.GetProductSupplierByID(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    SupplierID.Text    = dt.Rows[0]["SupplierID"].ToString();
                    ProductID.Text     = dt.Rows[0]["ProductID"].ToString();
                    Submit.Text        = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = iProductSupplierRepository.DeleteProductSupplier(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
        protected void bindGrid()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            var       lst = iProductSupplierRepository.ProductSupplierLists();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                grd.DataSource = dt;
                grd.DataBind();
            }
            else
            {
                grd.DataBind();
            }
        }
Esempio n. 8
0
        protected void bindGrid()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            var       lst = jobInterface.GetJobList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                grd.DataSource = dt;
                grd.DataBind();
            }
            else
            {
                grd.DataBind();
            }
        }
        protected void bindGrid()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            var       lst = iTeacherAllocationService.GetTeacherAllocationList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                grd.DataSource = dt;
                grd.DataBind();
            }
            else
            {
                grd.DataBind();
            }
        }
        protected void bindGrid()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            var       lst = iCustomerService.Lists();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                grd.DataSource = dt;
                grd.DataBind();
            }
            else
            {
                grd.DataBind();
            }
        }
Esempio n. 11
0
        protected void bindGrid()//gridview binding
        {
            DataTableConversion lsttodt = new DataTableConversion();
            var       lst = iPositionInterface.GetPositionListFunc();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                grd.DataSource = dt;
                grd.DataBind();
            }
            else
            {
                grd.DataBind();
            }
        }
Esempio n. 12
0
        protected void bindGrid()//bind grid method for binding the gridview
        {
            DataTableConversion lsttodt = new DataTableConversion();
            var       lst = _empService.GetEmployeeDataFunc();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                grd.DataSource = dt;
                grd.DataBind();
            }
            else
            {
                grd.DataBind();
            }
        }
Esempio n. 13
0
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //ClassMasterViewModel vmModel = new ClassMasterViewModel();
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            //vmModel.ID = Convert.ToInt32(id);
            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = iClassMasterService.GetClassMasterByID(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    ClassName.Text     = dt.Rows[0]["ClassName"].ToString();
                    Submit.Text        = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
                //if (lst != null)
                //{
                //    HiddenField1.Value = lst.ID.ToString();
                //    ClassName.Text = lst.ClassName;
                //    Submit.Text = "Update";
                //}
                //else
                //{
                //    //do nothing
                //    Submit.Text = "Save";
                //}
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = iClassMasterService.DeleteClassMaster(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
        protected void bindStudentList()
        {
            DataTableConversion   lsttodt = new DataTableConversion();
            IStudentMasterService service = new StudentMasterService();
            var       lst = service.GetStudentMasterList().Select(x => new { x.Name, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                StudentMasterID.DataSource     = dt;
                StudentMasterID.DataTextField  = "Name";
                StudentMasterID.DataValueField = "ID";
                StudentMasterID.DataBind();
            }
            else
            {
                StudentMasterID.DataBind();
            }
        }
        protected void bindDepartmentList()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            DepartmentInterface service = new DepartmentBussiness();
            var       lst = service.GetDepartmentList().Select(x => new { x.Name, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                DepartmentID.DataSource     = dt;
                DepartmentID.DataTextField  = "Name";
                DepartmentID.DataValueField = "ID";
                DepartmentID.DataBind();
            }
            else
            {
                DepartmentID.DataBind();
            }
        }
        protected void bindSeatList()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            ISeatService        service = new SeatService();
            var       lst = service.Lists().Select(x => new { Name = x.SeatNumber + " " + x.SeatSide, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                SeatID.DataSource     = dt;
                SeatID.DataTextField  = "Name";
                SeatID.DataValueField = "ID";
                SeatID.DataBind();
            }
            else
            {
                SeatID.DataBind();
            }
        }
        protected void bindSupplierList()
        {
            DataTableConversion lsttodt    = new DataTableConversion();
            ISupplierRepository repository = new SupplierRepository();
            var       lst = repository.SupplierLists().Select(x => new { x.Name, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                SupplierID.DataSource     = dt;
                SupplierID.DataTextField  = "Name";
                SupplierID.DataValueField = "ID";
                SupplierID.DataBind();
            }
            else
            {
                SupplierID.DataBind();
            }
        }
        protected void bindClassList()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            IClassMasterService service = new ClassMasterService();
            var       lst = service.GetClassMasterList().Select(x => new { x.ClassName, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                ClassMasterID.DataSource     = dt;
                ClassMasterID.DataTextField  = "ClassName";
                ClassMasterID.DataValueField = "ID";
                ClassMasterID.DataBind();
            }
            else
            {
                ClassMasterID.DataBind();
            }
        }
        protected void bindJobList()
        {
            DataTableConversion lsttodt = new DataTableConversion();
            JobInterface        service = new JobBussiness();
            var       lst = service.GetJobList().Select(x => new { x.Job, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                JobID.DataSource     = dt;
                JobID.DataTextField  = "Job";
                JobID.DataValueField = "ID";
                JobID.DataBind();
            }
            else
            {
                JobID.DataBind();
            }
        }
Esempio n. 20
0
        protected void bindEmployeeList()//binding the employee dropdown
        {
            DataTableConversion lsttodt = new DataTableConversion();

            IEmployeeInterface service = new EmployeeRepository();
            var       lst = service.GetEmployeeDataFunc().Select(x => new { x.Name, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                EmployeeID.DataSource     = dt;
                EmployeeID.DataTextField  = "Name";
                EmployeeID.DataValueField = "ID";
                EmployeeID.DataBind();
            }
            else
            {
                EmployeeID.DataBind();
            }
        }
Esempio n. 21
0
        protected void bindPositionList()//binding the position dropdown
        {
            DataTableConversion lsttodt = new DataTableConversion();

            IPositionInterface service = new PositionRepository();
            var       lst = service.GetPositionListFunc().Select(x => new { x.PositionName, x.ID }).ToList();
            DataTable dt  = lsttodt.ToDataTable(lst);

            if (dt != null && dt.Rows.Count > 0)
            {
                PositionID.DataSource     = dt;
                PositionID.DataTextField  = "PositionName";
                PositionID.DataValueField = "ID";
                PositionID.DataBind();
            }
            else
            {
                PositionID.DataBind();
            }
        }
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //EmployeeModel vmModel = new EmployeeModel();
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            //vmModel.ID = Convert.ToInt32(id);
            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = iCustomerService.GetByID(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    TicketID.Text      = dt.Rows[0]["TicketID"].ToString();
                    SeatID.Text        = dt.Rows[0]["SeatID"].ToString();
                    Name.Text          = dt.Rows[0]["Name"].ToString();
                    MobileNumber.Text  = dt.Rows[0]["MobileNumber"].ToString();
                    Email.Text         = dt.Rows[0]["EmailID"].ToString();
                    //HireDate.Text = dt.Rows[0]["HireDate"].ToString();
                    //Salary.Text = dt.Rows[0]["Salary"].ToString();
                    Submit.Text = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = iCustomerService.Delete(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
Esempio n. 23
0
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //StudentMasterViewModel vmModel = new StudentMasterViewModel();
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            //vmModel.ID = Convert.ToInt32(id);
            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = iStudentMasterService.GetStudentMasterByID(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    Name.Text          = dt.Rows[0]["Name"].ToString();
                    FatherName.Text    = dt.Rows[0]["FatherName"].ToString();
                    Address.InnerText  = dt.Rows[0]["Address"].ToString();
                    PhoneNumber.Text   = dt.Rows[0]["PhoneNo"].ToString();
                    Email.Text         = dt.Rows[0]["Email"].ToString();
                    DOB.Text           = dt.Rows[0]["DOB"].ToString();
                    GenderList.Text    = dt.Rows[0]["Gender"].ToString();
                    Submit.Text        = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = iStudentMasterService.DeleteStudentMaster(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
Esempio n. 24
0
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //row command method
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = _empService.GetEmployeeDataByIDFunc(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    PositionID.Text    = dt.Rows[0]["PositionID"].ToString();
                    Name.Text          = dt.Rows[0]["Name"].ToString();
                    PhoneNumber.Text   = dt.Rows[0]["PhoneNo"].ToString();
                    Email.Text         = dt.Rows[0]["Email"].ToString();
                    DOBDate.Text       = dt.Rows[0]["DOB"].ToString();
                    FatherName.Text    = dt.Rows[0]["FatherName"].ToString();
                    Address.InnerText  = dt.Rows[0]["Address"].ToString();
                    GenderList.Text    = dt.Rows[0]["Gender"].ToString();
                    Submit.Text        = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = _empService.DeleteEmployeeDataFunc(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //EmployeeModel myModel = new EmployeeModel();
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            //myModel.ID = Convert.ToInt32(id);
            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = employeeInterface.GetEmployeeByID(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value = dt.Rows[0]["ID"].ToString();
                    JobID.Text         = dt.Rows[0]["tblJobID"].ToString();
                    DepartmentID.Text  = dt.Rows[0]["tblDepartment"].ToString();
                    Name.Text          = dt.Rows[0]["Name"].ToString();
                    PhoneNumber.Text   = dt.Rows[0]["PhoneNumber"].ToString();
                    Email.Text         = dt.Rows[0]["Email"].ToString();
                    HireDate.Text      = dt.Rows[0]["HireDate"].ToString();
                    Salary.Text        = dt.Rows[0]["Salary"].ToString();
                    Submit.Text        = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = employeeInterface.DeleteEmployee(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }
Esempio n. 26
0
        protected void grd_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            //Grid command row function
            int    rowIndex = Convert.ToInt32(e.CommandArgument.ToString());
            string id       = this.grd.DataKeys[rowIndex]["ID"].ToString();

            if (e.CommandName == "updates")
            {
                DataTableConversion lsttodt = new DataTableConversion();
                var       lst = iPayrollInterface.GetPayrollByIDFunc(Convert.ToInt32(id));
                DataTable dt  = lsttodt.ToDataTable(lst);
                if (dt != null && dt.Rows.Count > 0)
                {
                    HiddenField1.Value  = dt.Rows[0]["ID"].ToString();
                    EmployeeID.Text     = dt.Rows[0]["EmployeeID"].ToString();
                    NoOfLeaves.Text     = dt.Rows[0]["NoOfLeaves"].ToString();
                    GrossSalary.Text    = dt.Rows[0]["GrossSalary"].ToString();
                    TotalDeduction.Text = dt.Rows[0]["TotalDeduction"].ToString();
                    NetPay.Text         = dt.Rows[0]["NetPay"].ToString();
                    Submit.Text         = "Update";
                }
                else
                {
                    Submit.Text = "Save";
                }
            }
            else
            {
                DataTable dt     = new DataTable();
                bool      result = iPayrollInterface.DeletePayrollFunc(Convert.ToInt32(id));
                if (result)
                {
                    bindGrid();
                }
            }
        }