Beispiel #1
0
        private void LoadGrid()
        {
            try
            {
                //Grid.Rows.Clear();
                string vWhere = string.Empty;
                if (!string.IsNullOrEmpty(txtFilter.Text))
                {
                    vWhere = " AND DesignationTitle Like '%" + txtFilter.Text + "%'";
                }

                DataTable dt = objDAL.getRecord(vWhere);
                Grid.AutoGenerateColumns = false;
                Grid.DataSource          = dt;
            }
            catch (Exception exc)
            {
                Message.ShowMessage(MyMessages.MessageType.Error, exc.Message);
            }
        }
Beispiel #2
0
        private void PopulateCombos()
        {
            try
            {
                DataTable dt = new DataTable();

                DAL.Departments obj = new DAL.Departments();
                obj.connectionstring = objDAL.connectionstring;
                dt = obj.getRecord(string.Empty);

                cboDepartment.DataSource    = dt;
                cboDepartment.ValueMember   = "DepartmentID";
                cboDepartment.DisplayMember = "DepartmentTitle";


                DAL.Designation objD = new DAL.Designation();
                objD.connectionstring = objDAL.connectionstring;
                dt = objD.getRecord(string.Empty);

                DataRow dr = dt.NewRow();
                dr["DesignationID"]    = 0;
                dr["DesignationTitle"] = "All";
                dt.Rows.Add(dr);
                cboDesignation.DataSource    = dt;
                cboDesignation.ValueMember   = "DesignationID";
                cboDesignation.DisplayMember = "DesignationTitle";

                cboDesignation.SelectedValue = 0;
                cboDesignation.SelectedText  = "All";


                DAL.Shifts objS = new DAL.Shifts();
                objS.connectionstring = objDAL.connectionstring;
                dt = objS.getRecord(string.Empty);

                DataRow dr1 = dt.NewRow();
                dr1["ShiftID"]    = 0;
                dr1["ShiftTitle"] = "All";
                dt.Rows.Add(dr1);

                cboShift.DataSource    = dt;
                cboShift.ValueMember   = "ShiftID";
                cboShift.DisplayMember = "ShiftTitle";

                cboShift.SelectedValue = 0;
                cboShift.SelectedText  = "All";
            }
            catch (Exception exc)
            {
                Message.ShowMessage(MyMessages.MessageType.Error, exc.Message);
            }
        }
Beispiel #3
0
        private void PopulateCombos()
        {
            try
            {
                DataTable dt = new DataTable();

                DAL.Departments obj = new DAL.Departments();
                obj.connectionstring = objDAL.connectionstring;
                dt = obj.getRecord(string.Empty);

                cboDepartment.DataSource    = dt;
                cboDepartment.ValueMember   = "DepartmentID";
                cboDepartment.DisplayMember = "DepartmentTitle";


                DAL.Designation objD = new DAL.Designation();
                objD.connectionstring = objDAL.connectionstring;
                dt = objD.getRecord(string.Empty);

                cboDesignation.DataSource    = dt;
                cboDesignation.ValueMember   = "DesignationID";
                cboDesignation.DisplayMember = "DesignationTitle";


                DAL.Shifts objS = new DAL.Shifts();
                objS.connectionstring = objDAL.connectionstring;
                dt = objS.getRecord(string.Empty);

                cboShift.DataSource    = dt;
                cboShift.ValueMember   = "ShiftID";
                cboShift.DisplayMember = "ShiftTitle";
            }
            catch (Exception exc)
            {
                Message.ShowMessage(MyMessages.MessageType.Error, exc.Message);
            }
        }