Пример #1
0
 public void LoadForm(String EmpRole)
 {
     objSectionDL          = new Section_DL(ConnectionStringClass.GetConnection());
     objEmployeeDL         = new Employee_DL(ConnectionStringClass.GetConnection());
     cmbSection.DataSource = objSectionDL.GetDataView();
     EmployeeRole          = EmpRole;
 }
Пример #2
0
        private void gvMRList_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                if (e.RowIndex >= 0)
                {
                    bindItemList.DataSource = null;
                    long MRNO      = Convert.ToInt64(gvMRList.Rows[e.RowIndex].Cells["MRNO"].Value);
                    MR   objMRTemp = objMRDL.Get(MRNO);

                    objMR = new MR();
                    objMR = objMRTemp;


                    Load_MRItem();


                    txtDepartment.Text = objMR.MRDepartmentFrom.DepName;

                    ItemSelect = true;

                    Section_DL objSectionDL = new Section_DL(ConnectionStringClass.GetConnection());
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #3
0
        private void frmCosting_Load(object sender, EventArgs e)
        {
            StockHoldingRate_DL objStockHoldingRateDL = new StockHoldingRate_DL(ConnectionStringClass.GetConnection());
            Employee_DL         objEmpDL      = new Employee_DL(ConnectionStringClass.GetConnection());
            Department_DL       objDepDL      = new Department_DL(ConnectionStringClass.GetConnection());
            Section_DL          objSection_DL = new Section_DL(ConnectionStringClass.GetConnection());

            try
            {
                StockHoldingRate obj = new StockHoldingRate();
                obj = objStockHoldingRateDL.GetFinal();
                Employee objChangedBy = objEmpDL.Get(obj.ChangedBy);
                txtEnterdBy.Text            = objChangedBy.EmployeeName;
                txtEnterdDate.Text          = obj.FromDate.Value.ToShortDateString();
                txtCurrentRate.Text         = obj.Cost.ToString();
                bindStockHolding.DataSource = objStockHoldingRateDL.Get();

                bindDepartment.DataSource = objSection_DL.GetDataView();
                objCompanyOverHeadRate    = objCompanyOverHeadRate_DL.Get();

                if (objCompanyOverHeadRate != null)
                {
                    txtComDate.Text   = objCompanyOverHeadRate.EnterdDate.ToShortDateString();
                    txtComEnterd.Text = objCompanyOverHeadRate.EnterdBy.EmployeeNameID;
                    txtComRate.Text   = objCompanyOverHeadRate.Rate.ToString();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(this, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Пример #4
0
 public void LoadForm(String EmpRole, String DivisionType)
 {
     objSectionDL  = new Section_DL(ConnectionStringClass.GetConnection());
     objEmployeeDL = new Employee_DL(ConnectionStringClass.GetConnection());
     // cmbSection.DataSource = objSectionDL.Get);
     cmbSection.DataSource = objSectionDL.GetData(DivisionType);
     EmployeeRole          = EmpRole;
 }
Пример #5
0
 public void Initialize(SqlConnection Conn)
 {
     objDepDL     = new Department_DL(Conn);
     objEmpRoleDL = new EmployeeRole_DL(Conn);
     objEmpDL     = new Employee_DL(Conn);
     objSectionDL = new Section_DL(Conn);
     ucSectionFilter1.Load(Conn);
 }
Пример #6
0
        private void Load_Sections()
        {
            Section_DL objSection_DL = new Section_DL(ConnectionStringClass.GetConnection());

            try
            {
                objSourceSections.DataSource = objSection_DL.GetDataView();
                cmbSections.DataSource       = objSourceSections;
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occured while loading Section", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #7
0
 private void cmbDepartment_SelectedIndexChanged(object sender, EventArgs e)
 {
     try
     {
         if (cmbDepartment.SelectedValue != null)
         {
             Section_DL objSectionDL = new Section_DL(ConnectionStringClass.GetConnection());
             cmbSection.DataSource = objSectionDL.GetDataView(Convert.ToInt64(cmbDepartment.SelectedValue));
         }
     }
     catch (Exception)
     {
         MessageBox.Show(this, "Error occured while loading Sections", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
 }
Пример #8
0
        private void btnSaveDep_Click(object sender, EventArgs e)
        {
            try
            {
                Section_DL       objSection_DL       = new Section_DL(ConnectionStringClass.GetConnection());
                Department_DL    objDepDL            = new Department_DL(ConnectionStringClass.GetConnection());
                OverheadRates    objOverheadRates    = new OverheadRates();
                OverheadRates_DL objOverheadRates_DL = new OverheadRates_DL(ConnectionStringClass.GetConnection());
                Employee_DL      objEmpDL            = new Employee_DL(ConnectionStringClass.GetConnection());
                if (objSelectedSections.DepID != 0)
                {
                    Sections objSections = objSelectedSections;

                    if (textBox1.Text != "")
                    {
                        if (objSections.DepID != 0)
                        {
                            objOverheadRates.SectionID  = objSections.SectionID;
                            objOverheadRates.EnterdBy   = CurrentUser.EmployeeID;
                            objOverheadRates.EnterdDate = DateTime.Now;
                            objOverheadRates.Rate       = Convert.ToDecimal(textBox1.Text);

                            objOverheadRates_DL.Add(objOverheadRates);


                            ClearDep();
                            bindDepartment.DataSource = objSection_DL.GetDataView();
                        }
                    }
                    else
                    {
                        MessageBox.Show(this, "Please enter a valid Overhead Rate", "Empty Fields", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                    }
                }
                else
                {
                    MessageBox.Show(this, "Please Select a Department from the list", "Empty Fields", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occured while saving overhead rate", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #9
0
        public void Load(SqlConnection conn)
        {
            try
            {
                objSectionDL  = new Section_DL(conn);
                objEmpDL      = new Employee_DL(conn);
                objDepDL      = new Department_DL(conn);
                objDivisionDL = new Division_DL(conn);



                bindDivisions.DataSource = objDivisionDL.GetDataView();
                cmbDivision.DataSource   = bindDivisions;

                cmbSupervisor.DataSource = objEmpDL.Get_By_RoleType("Staff", true);
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occured while loading", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Пример #10
0
        private void gvDepartment_CellClick(object sender, DataGridViewCellEventArgs e)
        {
            try
            {
                Department_DL    objDepDL            = new Department_DL(ConnectionStringClass.GetConnection());
                Section_DL       objSection_DL       = new Section_DL(ConnectionStringClass.GetConnection());
                OverheadRates    objOverheadRates    = new OverheadRates();
                OverheadRates_DL objOverheadRates_DL = new OverheadRates_DL(ConnectionStringClass.GetConnection());
                Employee_DL      objEmpDL            = new Employee_DL(ConnectionStringClass.GetConnection());
                ClearDep();
                if (true)
                {
                    Sections   objSection = objSection_DL.Get(Convert.ToInt64(gvDepartment.Rows[e.RowIndex].Cells["colDepID"].Value));
                    Department objDep     = objDepDL.Get(objSection.DepID);
                    if (objDep.DepID != 0)
                    {
                        txtSection.Text        = objSection.SectionName;
                        objSelectedSections    = objSection;
                        txtDID.Text            = objDep.DepID.ToString();
                        txtDepartmentName.Text = objDep.DepName;
                        objOverheadRates       = objOverheadRates_DL.Get(objSection.SectionID);
                        if (objOverheadRates.SectionID != 0)
                        {
                            txtDepCurrent.Text = objOverheadRates.Rate.ToString();
                            Employee objEmp = objEmpDL.Get(objOverheadRates.EnterdBy);

                            txtDepEnterdBy.Text   = objEmp.EmployeeName;
                            txtDepEnterdDate.Text = objOverheadRates.EnterdDate.ToShortDateString();
                        }
                    }
                }
            }
            catch (Exception)
            {
                MessageBox.Show(this, "Error occured", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }