Beispiel #1
0
        //Emp Grid
        #region [Employee Grid Bind]

        private void GrdEmployeeBind()
        {
            try
            {
                EWA_EmpAssignSubject objEWA = new EWA_EmpAssignSubject();
                BL_EmpAssignSubject  objBL  = new BL_EmpAssignSubject();
                objEWA.Action            = "FetchFacultyCourseClass";
                objEWA.OrgId             = Session["OrgId"].ToString();
                objEWA.DesignationTypeId = "1";
                objEWA.CourseId          = ddlCourse.SelectedValue.ToString();
                objEWA.BranchId          = ddlBranch.SelectedValue.ToString();
                objEWA.ClassId           = ddlClass.SelectedValue.ToString();
                objEWA.SubjectId         = ddlSubject.SelectedValue.ToString();

                DataSet ds = objBL.EmployeeGridBind_BL(objEWA);
                if (ds.Tables[0].Rows.Count != 0)
                {
                    GrdEmployee.DataSource = ds;
                    GrdEmployee.DataBind();
                    GrdEmployee.Columns[3].Visible = true;
                }
                else
                {
                    ShowEmptyGridView(GrdEmployee);
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Beispiel #2
0
        //Grid Emp Bind
        #region [Grid Emp Bind]

        private void GrdEmployeeBind()
        {
            try
            {
                EWA_AssignDeptDes objEWA = new EWA_AssignDeptDes();
                BL_AssignDeptDes  objBL  = new BL_AssignDeptDes();
                objEWA.Action = "FetchNotAssignedEmployee";
                objEWA.OrgId  = Session["OrgId"].ToString();

                objEWA.DepartmentId      = ddlDepartment.SelectedValue.ToString();
                objEWA.DesignationTypeId = rbtlDesType.SelectedValue.ToString();
                objEWA.DesignationId     = ddlDesignation.SelectedValue.ToString();

                DataSet ds = objBL.EmployeeGridBind_BL(objEWA);
                if (ds.Tables[0].Rows.Count != 0)
                {
                    GrdEmployee.DataSource = ds;
                    GrdEmployee.DataBind();
                    dsGrdEmployee = ds.Copy();
                    GrdEmployee.Columns[3].Visible = true;
                }
                else
                {
                    ShowEmptyGridView(GrdEmployee);
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Beispiel #3
0
        //Delete Role
        #region [Delete Role]

        public void DeleteRole(string Uid)
        {
            try
            {
                objEWA        = new EWA_Role();
                objEWA.Action = "DeleteRole";

                objEWA.UserId         = Uid;
                objEWA.OrganizationId = Convert.ToInt32(Session["OrgId"].ToString());

                objBL.DeleteRole_BL(objEWA);

                DDL_Role.ClearSelection();

                GrdAssinedRole.DataSource = EmptyGridView();
                GrdAssinedRole.DataBind();

                GrdEmployee.DataSource = EmptyGridView();
                GrdEmployee.DataBind();

                msgBox.ShowMessage("Role removed Successfully !!!", "Successfull", UserControls.MessageBox.MessageStyle.Successfull);
                //GeneralErr("Role removed Successfully !!!");
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message);
            }
        }
Beispiel #4
0
        //Get All Role Data
        #region [Get All Role Data]

        public void GetAllRoleData()
        {
            try
            {
                if (DDL_Role.SelectedItem.Text == "Select")
                {
                    GrdAssinedRole.DataSource = EmptyGridView();
                    GrdAssinedRole.DataBind();

                    GrdEmployee.DataSource = EmptyGridView();
                    GrdEmployee.DataBind();
                }
                else
                {
                    objEWA                = new EWA_Role();
                    objEWA.UserType       = DDL_Role.SelectedItem.Text;
                    objEWA.OrganizationId = Convert.ToInt32(Session["OrgId"].ToString());
                    objEWA.IsActive       = true;

                    DataSet ds = new DataSet();
                    ds = objBL.GetRole_BL(objEWA);

                    BindGrids(ds);
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message);
            }
        }
Beispiel #5
0
        //Bind Grids
        #region [Bind Grids]

        public void BindGrids(DataSet ds)
        {
            GrdAssinedRole.DataSource = ds.Tables[0];
            GrdAssinedRole.DataBind();

            GrdEmployee.DataSource = ds.Tables[1];
            GrdEmployee.DataBind();
        }
Beispiel #6
0
 void clear()
 {
     GrdEmployee.DataSource = "";
     GrdEmployee.DataBind();
     //GrdParent.DataSource = "";
     //GrdParent.DataBind();
     GrdStudent.DataSource = "";
     GrdStudent.DataBind();
     txtMessage.Text = "";
 }
Beispiel #7
0
        //Emp Page Index Change
        #region [Emp Page Index Change]

        protected void GrdEmployee_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            try
            {
                GrdEmployee.PageIndex  = e.NewPageIndex;
                GrdEmployee.DataSource = dsGrdEmployee;
                GrdEmployee.DataBind();
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Beispiel #8
0
    public void getEmployee(string searchPar)

    {
        SqlConnection con = new SqlConnection(System.Configuration.ConfigurationManager.AppSettings["ConnectionString"].ToString());

        con.Open();
        SqlCommand cmd = new SqlCommand("sp_GetEmployeesByName", con);

        cmd.CommandType = CommandType.StoredProcedure;
        SqlParameter par = cmd.Parameters.AddWithValue("@empName", searchPar ?? string.Empty);

        GrdEmployee.DataSource = cmd.ExecuteReader();
        GrdEmployee.DataBind();
        con.Close();
    }
 private void GrdEmployeeBind()
 {
     try
     {
         objEWA.Action      = "SearchEmployee";
         objEWA.OrgId       = Convert.ToInt32(Session["OrgId"].ToString());
         objEWA.SearchValue = txtName.Text;
         DataSet ds = objBL.EmployeeGridBind_BL(objEWA);
         GrdEmployee.DataSource = ds;
         GrdEmployee.DataBind();
     }
     catch (Exception exp)
     {
         throw exp;
     }
 }
Beispiel #10
0
        //  Bind Student Grid Data

        //#region StudentGrid
        //private void BindStudentGridData()
        //{
        //    EWA_Common objEWA = new EWA_Common();
        //    BL_Common objBL = new BL_Common();

        //    objEWA.OrgId = Session["OrgId"].ToString();
        //    objEWA.CourseId = ddlCourse.SelectedValue.ToString();
        //    objEWA.BranchId = ddlBranch.SelectedValue.ToString();
        //    objEWA.ClassId = ddlClass.SelectedValue.ToString();
        //    objEWA.DivisionId = ddlDivision.SelectedValue.ToString();

        //    DataSet ds = objBL.BindStudentData_BL(objEWA);
        //    if (ds.Tables[0].Rows.Count != 0)
        //    {
        //        GrdStudent.DataSource = ds;
        //        GrdStudent.DataBind();

        //    }

        //    else
        //    {


        //        DataTable dt = new DataTable();
        //        dt.Clear();
        //        dt.Columns.Add("StudentId");
        //        dt.Columns.Add("StudentName");
        //        dt.Columns.Add("Mobile");

        //        dt.Rows.Add(dt.NewRow());
        //        GrdStudent.DataSource = dt;
        //        GrdStudent.DataBind();
        //        int totalcolums = GrdStudent.Rows[0].Cells.Count;
        //        GrdStudent.Rows[0].Cells.Clear();
        //        GrdStudent.Rows[0].Cells.Add(new TableCell());
        //        GrdStudent.Rows[0].Cells[0].ColumnSpan = totalcolums;
        //        GrdStudent.Rows[0].Cells[0].Text = "No Data Found";
        //    }


        //}


        //// For Student Empty Grid

        //private void ShowEmptyGridView(GridView grid)
        //{
        //    DataTable dt = new DataTable();
        //    dt.Columns.Add(grid.Columns[0].HeaderText);
        //    dt.Columns.Add(grid.Columns[1].HeaderText);
        //    dt.Columns.Add(grid.Columns[2].HeaderText);
        //    dt.Columns.Add(grid.Columns[3].HeaderText);
        //    DataRow dr = dt.NewRow();
        //    dt.Rows.Add(dr);

        //    grid.DataSource = dt;
        //    grid.DataBind();
        //    grid.Columns[0].Visible = true;
        //    grid.Rows[0].Cells[1].ColumnSpan = 3;
        //    foreach (GridViewRow row in grid.Rows)
        //    {
        //        row.Cells[2].Visible = false;
        //        row.Cells[3].Visible = false;
        //    }
        //    grid.Rows[0].Cells[1].Text = "No Record found";
        //}

        //#endregion

        //Employee Grid Bind

        #region [Employee Grid Bind]

        private void GrdEmployeeBind()
        {
            try
            {
                objEWA.OrgId             = Convert.ToString(Session["OrgId"]);
                objEWA.DepartmentId      = ddlDepartment.SelectedValue.ToString();
                objEWA.DesignationTypeId = rbtlDesType.SelectedValue.ToString();
                DataSet ds = objBL.EmployeeGridBind_BL(objEWA);
                GrdEmployee.DataSource = ds;
                GrdEmployee.DataBind();
            }

            catch (Exception exp)
            {
                throw exp;
            }
        }
Beispiel #11
0
        protected void ddlDesignation_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (ddlDesignation.SelectedItem.Text.Equals("Select"))
                {
                    GrdEmployee.DataSource = null;

                    GrdEmployee.DataBind();
                }
                else
                {
                    //GrdViewEmployeeBind();
                    GrdEmployeeBind();
                }
            }
            catch (Exception exp)
            {
                GeneralErr(exp.Message.ToString());
            }
        }
Beispiel #12
0
        //Page Load
        #region [Page Load]

        protected void Page_Load(object sender, EventArgs e)
        {
            orgId = Convert.ToInt32(Session["OrgID"]);
            if (orgId == 0)
            {
                Response.Redirect("~/CMSHome.aspx");
            }

            if (!IsPostBack)
            {
                //GetRoleData();

                GrdAssinedRole.DataSource = EmptyGridView();
                GrdAssinedRole.DataBind();

                GrdEmployee.DataSource = EmptyGridView();
                GrdEmployee.DataBind();

                //ShowEmptyGridView(ds);
            }
        }