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); } }
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); }
private void frmAddActivity_Load(object sender, EventArgs e) { try { Department_DL objDepartment_DL = new Department_DL(ConnectionStringClass.GetConnection()); cmbActivity.DataSource = objMainActivityDL.GetByDepID(objDepartment_DL.GetByDepType("RPD").DepID); cmbInstructedBy.DataSource = objEmployeeDL.Get_By_RoleType(EmployeeRole.RoleType.Manager.ToString(), true); cmbSupervisedBy.DataSource = objEmployeeDL.Get_By_RoleType(EmployeeRole.RoleType.Staff.ToString(), true); } catch (Exception) { MessageBox.Show(this, "Error occured while loading New RPD Batch Activity", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public long GenerateMR(PRPDBatch objPRPD) { MR objMR = new MR(); MRMaterialCollec objMRMatCollec = new MRMaterialCollec(); MRFinishProductCollec objMRFinishProductCollec = new MRFinishProductCollec(); MRBasicProductCollec objMRBasicProductCollec = new MRBasicProductCollec(); BatchMR objBatchMR = new BatchMR(); Department_DL objDepDL = new Department_DL(ConnectionStringClass.GetConnection()); MR_DL objMRDL = new MR_DL(ConnectionStringClass.GetConnection()); MRMaterial_DL objMRMaterialDL = new MRMaterial_DL(ConnectionStringClass.GetConnection()); Store_DL objStoreDL = new Store_DL(ConnectionStringClass.GetConnection()); try { objMR.MRDate = DateTime.Now; objMR.MRDepartmentFrom = objDepDL.GetByDepType("PRPD"); objMR.MREnterdBy = CurrentUser.EmployeeID; objMR.MRStatus = MR.Status.Initial; objMR.MRStore = objStore; objMR.MRType = MR.Type.Material; objMR.MRRemarks = "Material Requition(Materials) for PRPD Batch NO " + objPRPD.PRPDBatchID.ToString(); objMR.OriginType = MR.Origin.ToBatch; MRMaterial obj = new MRMaterial(); obj.Description = "PRPD Batch Material Requition"; obj.Material = objPRPD.PRPDBatchMaterial; obj.MRBINNo = ""; obj.ReqdQty = objPRPD.PRPDBatchQty; long MRNO = objMRDL.Add_M(objMR); if (MRNO > 0) { objMR.MRNO = MRNO; obj.MR = objMR; objMRMaterialDL.Add(obj); } return(MRNO); } catch (Exception ex) { return(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); } }
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); } }
public void Load_Data(SqlConnection Conn, string MatCode) { objMaterial_DL = new Material_DL(Conn); objStore_DL = new Store_DL(Conn); objDepartment_DL = new Department_DL(Conn); BasicMaterialCode = MatCode; objMaterial = objMaterial_DL.GetProcessdMaterial(BasicMaterialCode); if (objMaterial != null) { textBox1.Text = objMaterial.MaterialNameCode; //cmbStoreTo.DataSource = objStore_DL.GetData(); //cmbStoreTo.SelectedValue = objStore_DL.Get_Default(objDepartment_DL.GetByDepType("Store").DepID).StoreID; //cmbStoreTo.Enabled = true; } else { //cmbStoreTo.Enabled = false; textBox1.Text = "N/A"; } }
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); } }