private void LoadEmployee() { CEmployeeBO oEmployeebo = new CEmployeeBO(); CResult oresult = new CResult(); CEmployee oEmployee = new CEmployee(); oresult = oEmployeebo.ReadAllEmployee(oEmployee); if (oresult.IsSuccess) { //ddlEmployeeType.Employees.Add(new ListEmployee("Select one Employee","NA")); ArrayList oEmployeeList = oresult.Data as ArrayList; cmbUserName.DataSource = oEmployeeList; cmbUserName.DisplayMember = "Name"; cmbUserName.ValueMember = "ID"; cmbUserName.SelectedIndex = -1; //foreach (CEmployeeType oEmployeetype1 in oresult.Data as ArrayList) //{ // ddlEmployeeType.Employees.Add(new ListEmployee(oEmployeetype1.TypeName, oEmployeetype.TypeID.ToString())); //} } else { cmbUserName.Text = "ERROR in loading"; } }
//private void LoadUnit() //{ // CSetUpBO oSetUpBO = new CSetUpBO(); // CResult oResult = new CResult(); // CUnit oUnit = new CUnit(); // oResult = oSetUpBO.ReadUnit(oUnit); // if (oResult.IsSuccess) // { // arrList = oResult.Data as ArrayList; // cmbUnit.DisplayMember = "Name"; // cmbUnit.ValueMember = "ID"; // cmbUnit.DataSource = arrList; // //foreach (CCompany obj in arCompanyList) // //{ // // ddlCompanyList.Items.Add(obj); // // ddlCompanyList.DisplayMember = "CompanyName"; // // ddlCompanyList.ValueMember = "CompanyID"; // //} // } // else // { // MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // cmbUnit.SelectedIndex = -1; //} ////private void LoadFloor() //{ // CSetUpBO oSetUpBO = new CSetUpBO(); // CResult oResult = new CResult(); // CFloor oFloor = new CFloor(); // oResult = oSetUpBO.ReadFloor(oFloor); // if (oResult.IsSuccess) // { // arrList = oResult.Data as ArrayList; // cmbFloor.DisplayMember = "Name"; // cmbFloor.ValueMember = "ID"; // cmbFloor.DataSource = arrList; // //foreach (CCompany obj in arCompanyList) // //{ // // ddlCompanyList.Items.Add(obj); // // ddlCompanyList.DisplayMember = "CompanyName"; // // ddlCompanyList.ValueMember = "CompanyID"; // //} // } // else // { // MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // cmbFloor.SelectedIndex = -1; //} //private void LoadSection() //{ // CSetUpBO oSetUpBO = new CSetUpBO(); // CResult oResult = new CResult(); // CSection oSection = new CSection(); // oResult = oSetUpBO.ReadSection(oSection); // if (oResult.IsSuccess) // { // arrList = oResult.Data as ArrayList; // cmbSection.DisplayMember = "Name"; // cmbSection.ValueMember = "ID"; // cmbSection.DataSource = arrList; // //foreach (CCompany obj in arCompanyList) // //{ // // ddlCompanyList.Items.Add(obj); // // ddlCompanyList.DisplayMember = "CompanyName"; // // ddlCompanyList.ValueMember = "CompanyID"; // //} // } // else // { // MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // cmbSection.SelectedIndex = -1; //} //private void LoadBlock() //{ // CSetUpBO oSetUpBO = new CSetUpBO(); // CResult oResult = new CResult(); // CBlock oBlock = new CBlock(); // oResult = oSetUpBO.ReadBlock(oBlock); // if (oResult.IsSuccess) // { // arrList = oResult.Data as ArrayList; // cmbBlock.DisplayMember = "Name"; // cmbBlock.ValueMember = "ID"; // cmbBlock.DataSource = arrList; // //foreach (CCompany obj in arCompanyList) // //{ // // ddlCompanyList.Items.Add(obj); // // ddlCompanyList.DisplayMember = "CompanyName"; // // ddlCompanyList.ValueMember = "CompanyID"; // //} // } // else // { // MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // cmbBlock.SelectedIndex = -1; //} //private void LoadShift() //{ // CSetUpBO oSetUpBO = new CSetUpBO(); // CResult oResult = new CResult(); // CShift oShift = new CShift(); // oResult = oSetUpBO.ReadShift(oShift); // if (oResult.IsSuccess) // { // arrList = oResult.Data as ArrayList; // cmbShift.DisplayMember = "Name"; // cmbShift.ValueMember = "ID"; // cmbShift.DataSource = arrList; // //foreach (CCompany obj in arCompanyList) // //{ // // ddlCompanyList.Items.Add(obj); // // ddlCompanyList.DisplayMember = "CompanyName"; // // ddlCompanyList.ValueMember = "CompanyID"; // //} // } // else // { // MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // cmbShift.SelectedIndex = -1; //} //private void LoadDesignation() //{ // CSetUpBO oSetUpBO = new CSetUpBO(); // CResult oResult = new CResult(); // CDesignation oDesignation = new CDesignation(); // oResult = oSetUpBO.ReadDesignation(oDesignation); // if (oResult.IsSuccess) // { // arrList = oResult.Data as ArrayList; // cmbDesignation.DisplayMember = "Name"; // cmbDesignation.ValueMember = "ID"; // cmbDesignation.DataSource = arrList; // //foreach (CCompany obj in arCompanyList) // //{ // // ddlCompanyList.Items.Add(obj); // // ddlCompanyList.DisplayMember = "CompanyName"; // // ddlCompanyList.ValueMember = "CompanyID"; // //} // } // else // { // MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // cmbDesignation.SelectedIndex = -1; //} //private void LoadEducation() //{ // CSetUpBO oSetUpBO = new CSetUpBO(); // CResult oResult = new CResult(); // CEducation oEducation = new CEducation(); // oResult = oSetUpBO.ReadEducationData(oEducation); // if (oResult.IsSuccess) // { // arrList = oResult.Data as ArrayList; // cmbEducation.DisplayMember = "Name"; // cmbEducation.ValueMember = "ID"; // cmbEducation.DataSource = arrList; // //foreach (CCompany obj in arCompanyList) // //{ // // ddlCompanyList.Items.Add(obj); // // ddlCompanyList.DisplayMember = "CompanyName"; // // ddlCompanyList.ValueMember = "CompanyID"; // //} // } // else // { // MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); // } // cmbEducation.SelectedIndex = -1; //} private void LoadEmployeeData() { lstEmployeeList.Items.Clear(); CEmployeeBO oEmployeeBO = new CEmployeeBO(); CResult oResult = new CResult(); CEmployee oEmployee = new CEmployee(); //string Unit = cmbUnit.Text.Trim(); //string Floor = cmbFloor.Text.Trim(); //string Secion = cmbSection.Text.Trim(); //string Block = cmbBlock.Text.Trim(); //string Shift = cmbShift.Text.Trim(); //string Designation = cmbDesignation.Text.Trim(); //string Education = cmbEducation.Text.Trim(); //string EmpID = txtEmpID.Text.Trim(); oResult = oEmployeeBO.ReadAllEmployee(oEmployee); if (oResult.IsSuccess) { arrList = oResult.Data as ArrayList; foreach (CEmployee obj in oResult.Data as ArrayList) { ListViewItem oItem = new ListViewItem(); oItem.Text = obj.ID.ToString(); oItem.SubItems.Add(obj.EmpID).ToString(); oItem.SubItems.Add(obj.Name).ToString(); oItem.SubItems.Add(obj.EmployeeType).ToString(); // oItem.SubItems.Add(obj.UnitID).ToString(); // oItem.SubItems.Add(obj.CompanyAddress); lstEmployeeList.Items.Add(oItem); } } else { MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void LoadEmployeeData() { CEmployeeBO oEmployeeBO = new CEmployeeBO(); CResult oResult = new CResult(); CEmployee oEmployee = new CEmployee(); //string Unit = cmbUnit.Text.Trim(); //string Floor = cmbFloor.Text.Trim(); //string Secion = cmbSection.Text.Trim(); //string Block = cmbBlock.Text.Trim(); //string Shift = cmbShift.Text.Trim(); //string Designation = cmbDesignation.Text.Trim(); //string Education = cmbEducation.Text.Trim(); //string EmpID = txtEmpID.Text.Trim(); oResult = oEmployeeBO.ReadAllEmployee(oEmployee); if (oResult.IsSuccess) { arrList = oResult.Data as ArrayList; CEmployee emp = new CEmployee(); List <CEmployee> emplist = new List <CEmployee>(); foreach (CEmployee obj in oResult.Data as ArrayList) { emp = new CEmployee(); emp.EmpID = obj.EmpID; emp.Name = obj.Name; emplist.Add(emp); } ddlSalesExecutive.DataSource = emplist; ddlSalesExecutive.DisplayMember = "Name"; ddlSalesExecutive.ValueMember = "EmpID"; } else { MessageBox.Show(oResult.ErrMsg.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }
private void ExportData() { string m_sMasterExportFileName = DateTime.Now.ToString("dd-MMM-yyyy") + "_" + currentBranch.CompBrn_Name; saveFileDialog1.FileName = m_sMasterExportFileName; saveFileDialog1.InitialDirectory = @"H:\"; saveFileDialog1.Filter = "Master File (*.mstrexp)|*.mstrexp"; if (saveFileDialog1.ShowDialog() == DialogResult.OK) { m_sMasterExportFileName = saveFileDialog1.FileName; IFormatter formatter = new BinaryFormatter(); using (Stream stream = new FileStream(m_sMasterExportFileName, FileMode.Create, FileAccess.Write, FileShare.None)) { byte[] baKey = { 51, 208, 75, 59, 223, 134, 241, 155, 170, 229, 177, 160, 246, 71, 77, 141, 66, 7, 223, 103, 97, 80, 235, 82, 94, 107, 226, 190, 76, 94, 31, 43 }; byte[] baIV = { 142, 96, 41, 14, 206, 132, 173, 19, 12, 50, 124, 121, 42, 27, 35, 9 }; Rijndael rijndael = Rijndael.Create(); CryptoStream cryptoStream = new CryptoStream(stream, rijndael.CreateEncryptor(baKey, baIV), CryptoStreamMode.Write); // { CResult oResult; // UOM oResult = new CResult(); CUOMBO oUOMBO = new CUOMBO(); oResult = oUOMBO.ReadAll(); if (oResult.IsSuccess) { ArrayList oListUOM = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListUOM); } // Item Type oResult = new CResult(); CItemBO oItemBO = new CItemBO(); oResult = oItemBO.ReadAll(new CItemType()); if (oResult.IsSuccess) { ArrayList oListItemType = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListItemType); } // Item Group oResult = new CResult(); oItemBO = new CItemBO(); oResult = oItemBO.ReadAll(new CItemGroup()); if (oResult.IsSuccess) { ArrayList oListItemGroup = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListItemGroup); } // Item oResult = new CResult(); oItemBO = new CItemBO(); oResult = oItemBO.ReadAll(); if (oResult.IsSuccess) { ArrayList oListItem = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListItem); } // Reorder Level oResult = new CResult(); CReorderLevelBO oReorderLevelBO = new CReorderLevelBO(); oResult = oReorderLevelBO.ReadAllReorderLevelData(new CReorderLevel()); if (oResult.IsSuccess) { ArrayList oListReorderLevel = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListReorderLevel); } // Currency oResult = new CResult(); CCurrencyBO oCurrencyBO = new CCurrencyBO(); oResult = oCurrencyBO.ReadAll(); if (oResult.IsSuccess) { List <CCurrency> oListCurrency = (List <CCurrency>)oResult.Data; formatter.Serialize(cryptoStream, oListCurrency); } // Price Master oResult = new CResult(); CPriceMasterBO oPriceMasterBO = new CPriceMasterBO(); oResult = oPriceMasterBO.ReadAll(); if (oResult.IsSuccess) { ArrayList oListPriceMaster = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListPriceMaster); } // Customer oResult = new CResult(); CCustomerBO oCustomerBO = new CCustomerBO(); oResult = oCustomerBO.ReadAll(new CCustomer()); if (oResult.IsSuccess) { ArrayList oListCustomer = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListCustomer); } // Supplier oResult = new CResult(); CSupplierBO oSupplierBO = new CSupplierBO(); oResult = oSupplierBO.ReadAll(new CSupplier()); if (oResult.IsSuccess) { ArrayList oListSupplier = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListSupplier); } // Company oResult = new CResult(); CCompanyBO oCompanyBO = new CCompanyBO(); oResult = oCompanyBO.ReadAll(); if (oResult.IsSuccess) { List <CCompany> oListCompany = (List <CCompany>)oResult.Data; formatter.Serialize(cryptoStream, oListCompany); } // Company Branch oResult = new CResult(); CCompanyBranchBO oCompanyBranchBO = new CCompanyBranchBO(); oResult = oCompanyBranchBO.ReadAll(); if (oResult.IsSuccess) { List <CCompanyBranch> oListCompanyBranch = (List <CCompanyBranch>)oResult.Data; formatter.Serialize(cryptoStream, oListCompanyBranch); } // Company Vs CompanyBranch oResult = new CResult(); CCVBBO oCVBBO = new CCVBBO(); oResult = oCVBBO.ReadAllCVB(new CCVB()); if (oResult.IsSuccess) { ArrayList oListCVB = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListCVB); } // Inventory Location oResult = new CResult(); CLocBO oLocBO = new CLocBO(); oResult = oLocBO.ReadAll(); if (oResult.IsSuccess) { ArrayList oListLocation = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListLocation); } // CompanyBranch Vs Location oResult = new CResult(); oCVBBO = new CCVBBO(); oResult = oCVBBO.ReadAllBVL(new CCVB()); if (oResult.IsSuccess) { ArrayList oListCVB = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListCVB); } // Employee oResult = new CResult(); CEmployeeBO oEmployeeBO = new CEmployeeBO(); oResult = oEmployeeBO.ReadAllEmployee(new CEmployee()); if (oResult.IsSuccess) { ArrayList oListEmployee = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListEmployee); } // User oResult = new CResult(); CUserBO oUserBO = new CUserBO(); oResult = oUserBO.ReadAllUserData(new CUser()); if (oResult.IsSuccess) { ArrayList oListUser = (ArrayList)oResult.Data; formatter.Serialize(cryptoStream, oListUser); } } // cryptoStream.Close(); } } this.Close(); }