private void updateVendorInfo(DataActionMode mode) { _vendor.Address = txtAddress.Text; _vendor.City = txtCity.Text; _vendor.ContactName = txtContactName.Text; _vendor.Country = txtCountry.Text; _vendor.Currency = cbxCurrency.Text; _vendor.email = txtEmail.Text; _vendor.Fax = txtFax.Text; _vendor.Isactive = chkIsActive.Checked; _vendor.mobile = txtMobile.Text; _vendor.Province = txtProvince.Text; _vendor.Tel = txtPhone.Text; _vendor.VendorCode = txtVendorCode.Text; _vendor.VendorName = txtVendorName.Text; _vendor.website = txtWebsite.Text; _vendor.Zipcode = txtZipCode.Text; int _result = new VendorDAL().UpdateVendor(_vendor, _mode); if (_result > 0) { MessageBox.Show("Vendor record update successfully.", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
/// <summary> /// Gets all vendor. /// </summary> /// <returns>Get All Vendor</returns> public List <Vendor> GetAllVendor() { IVendorDAL vendorDAL = new VendorDAL(); List <Vendor> result = vendorDAL.GetAllVendor(); return(result); }
private void frmAddItemType_Load(object sender, EventArgs e) { try { DataSet ds = UoMDAL.GetUoMsDataSet(); cmbUoM.DataSource = ds.Tables[0]; cmbUoM.DisplayMember = "UoM_Name"; cmbUoM.ValueMember = "ID"; DataSet dsVendor = VendorDAL.getVendorsDs(); DataRow defaultRow = dsVendor.Tables[0].NewRow(); defaultRow["ID"] = "0"; defaultRow["Name"] = "------ Select Vendor ------"; dsVendor.Tables[0].Rows.InsertAt(defaultRow, 0); cmbVendor.DataSource = dsVendor.Tables[0]; cmbVendor.DisplayMember = "Name"; cmbVendor.ValueMember = "ID"; } catch (IndexOutOfRangeException ex) { MessageBox.Show(this, "Add atleast one item type to add purchase", "Error:Add new stock", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } catch (Exception ex) { MessageBox.Show(this, ex.Message.ToString(), "Error:Add New Stock", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } }
/// <summary> /// 参照 U8供应商档案 /// </summary> private void RefVendor(object obj, EventArgs e) { IRefDAL dal = new VendorDAL(Information.UserInfo.ConnU8); RefForm frm = new RefForm(dal); if (frm.ShowDialog() == DialogResult.OK) { (obj as TextBox).Text = frm.rows[0]["cVenCode"].ToString(); } }
private void RefVendor(object sender, EventArgs e) { #region 供应商档案 IRefDAL dal = new VendorDAL(Information.UserInfo.ConnU8); RefForm frm = new RefForm(dal); if (frm.ShowDialog() == DialogResult.OK) { model.cVenCode = frm.rows[0]["cVenCode"].ToString(); (sender as TextBox).Text = frm.rows[0]["cVenName"].ToString(); } #endregion }
private void frmVendorManagement_Load(object sender, EventArgs e) { VendorDAL vendor = new VendorDAL(); _vendorsDs = vendor.getVendorsPresentationDs(); DataView dv = _vendorsDs.Tables[0].DefaultView; dv.RowFilter = "IsDeleted = 0"; dgVendors.DataSource = dv; btAddNewVendor.Focus(); _vendorAdapter = vendor.getVendorAdapter(); this.dgVendors.SelectionChanged += new EventHandler(dgVendors_SelectionChanged); isDirty = false; }
// To pass 'Vendor' data in VendorDAL Data Access Layer to show Active and Inactive type records public DataTable LoadAllVendor(int LoggedInUser, string Ret) { VendorDAL VendorDAL = new VendorDAL(); try { return VendorDAL.LoadAllVendor(LoggedInUser, Ret); } catch { throw; } finally { VendorDAL = null; } }
// To pass 'Vendor' data in VendorDAL Data Access Layer to show selected VendorID records public DataTable SelectVendorID(int VendorId, int LoggedInUser, string Ret) { VendorDAL VendorDAL = new VendorDAL(); try { return VendorDAL.SelectVendorID(VendorId, LoggedInUser, Ret); } catch { throw; } finally { VendorDAL = null; } }
// To pass 'Vendor' data in VendorDAL Data Access Layer for insertion public int InsertVendor(int UserID, bool IsActive, int LoginUser, string Ret) { VendorDAL VendorDAL = new VendorDAL(); try { return VendorDAL.InsertVendor(UserID, IsActive, LoginUser, Ret); } catch { throw; } finally { VendorDAL = null; } }
private void frmItemManagement_Load(object sender, EventArgs e) { try { ItemDAL dal = new ItemDAL(); _itemsDs = dal.getItemsPresentationDs(); DataView dv = _itemsDs.Tables[0].DefaultView; dv.RowFilter = "Is_Deleted = 0"; dgItem.DataSource = dv; DataSet uomDs = UoMDAL.GetUoMsDataSet(); DataRow defaultRowUnit = uomDs.Tables[0].NewRow(); defaultRowUnit["ID"] = "0"; defaultRowUnit["UoM_Name"] = "-------------- Select Unit ----------------"; uomDs.Tables[0].Rows.InsertAt(defaultRowUnit, 0); cmbUoM.DataSource = uomDs.Tables[0]; cmbUoM.DisplayMember = "UoM_Name"; cmbUoM.ValueMember = "ID"; DataSet venDs = VendorDAL.getVendorsDs(); DataRow defaultRow = venDs.Tables[0].NewRow(); defaultRow["ID"] = "0"; defaultRow["Name"] = "-------------- Select Vendor -------------------"; venDs.Tables[0].Rows.InsertAt(defaultRow, 0); cmbVendor.DataSource = venDs.Tables[0]; cmbVendor.DisplayMember = "Name"; cmbVendor.ValueMember = "ID"; btAddNewItem.Focus(); _itemAdapter = dal.getItemAdapter(); this.dgItem.SelectionChanged += new EventHandler(dgItems_SelectionChanged); isDirty = false; } catch (IndexOutOfRangeException ex) { MessageBox.Show(this, "Add atleast one item type to add purchase", "Error:Add new stock", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } catch (Exception ex) { MessageBox.Show(this, ex.StackTrace.ToString(), "Error:Add New Stock", MessageBoxButtons.OK, MessageBoxIcon.Error); this.Close(); } }
// To pass 'Vendor' data in VendorDAL Data Access Layer for updation public int UpdateVendor(int VendorId, bool IsActive, int LoginUser, string Ret) { VendorDAL VendorDAL = new VendorDAL(); try { return(VendorDAL.UpdateVendor(VendorId, IsActive, LoginUser, Ret)); } catch { throw; } finally { VendorDAL = null; } }
// To pass 'Vendor' data in VendorDAL Data Access Layer to show selected VendorID records public DataTable SelectVendorID(int VendorId, int LoggedInUser, string Ret) { VendorDAL VendorDAL = new VendorDAL(); try { return(VendorDAL.SelectVendorID(VendorId, LoggedInUser, Ret)); } catch { throw; } finally { VendorDAL = null; } }
// To pass 'Vendor' data in VendorDAL Data Access Layer to show Active and Inactive type records public DataTable LoadAllVendor(int LoggedInUser, string Ret) { VendorDAL VendorDAL = new VendorDAL(); try { return(VendorDAL.LoadAllVendor(LoggedInUser, Ret)); } catch { throw; } finally { VendorDAL = null; } }
// To pass 'Vendor' data in VendorDAL Data Access Layer for insertion public int InsertVendor(int UserID, bool IsActive, int LoginUser, string Ret) { VendorDAL VendorDAL = new VendorDAL(); try { return(VendorDAL.InsertVendor(UserID, IsActive, LoginUser, Ret)); } catch { throw; } finally { VendorDAL = null; } }
public static int GetRows() { return(VendorDAL.GetRows()); }
public static IQueryable GetAll() { return(VendorDAL.GetAll()); }
public int GetMaxVendorID() { return(VendorDAL.MaxID(_connection)); }
// add a vendor to the DB public Boolean AddVendor(Vendor vendor) { return(VendorDAL.AddVendor(vendor, _connection)); }
public Boolean DeleteVendor(Vendor vendor) { return(VendorDAL.DeleteVendor(vendor, _connection)); }
// To pass 'Vendor' data in VendorDAL Data Access Layer for updation public int UpdateVendor(int VendorId, bool IsActive, int LoginUser, string Ret) { VendorDAL VendorDAL = new VendorDAL(); try { return VendorDAL.UpdateVendor(VendorId, IsActive, LoginUser, Ret); } catch { throw; } finally { VendorDAL = null; } }
//删除 public static int VendorDele(int id) { return(VendorDAL.VendorDele(id)); }
public static IQueryable ShowByName1(string name) { return(VendorDAL.ShowByName1(name)); }
public List <Vendor> GetVendors() { List <Vendor> vendorList = VendorDAL.GetAllVendors(_connection); return(vendorList); }
public static int DeleteVndor(int VendorId) { return(VendorDAL.DeleteVndor(VendorId)); }
public static IVendor GetVendor(int ID) { return(VendorDAL.GetVendor(ID)); }
public static PageList PageListDemo(int pageIndex, int PageSize) { return(VendorDAL.PageListDemo(pageIndex, PageSize)); }
public static PageList ShowByName(int pageIndex, int pageSize, int VenId, string VenName) { return(VendorDAL.ShowByName(pageIndex, pageSize, VenId, VenName)); }
public static int updataVendor(Vendor d) { return(VendorDAL.updataVendor(d)); }
//添加供应商 public static int VendorAdd(Vendor ven) { return(VendorDAL.VendorAdd(ven)); }
public Vendor GetVendor(int vendorId) { return(VendorDAL.GetVendor(vendorId, _connection)); }
/// <summary> /// 根据id查供应商信息 /// </summary> /// <param name="id">供应商id</param> /// <returns>数据集合</returns> public static IQueryable VendorByid(int id) { return(VendorDAL.VendorByid(id)); }
public Boolean UpdateVendor(Vendor vendor, Vendor origVendor) { return(VendorDAL.UpdateVendor(vendor, origVendor, _connection)); }
public List <Vendor> GetVendorsByActive(Boolean active) { List <Vendor> vendorList = VendorDAL.GetAllVendorsByActive(active, _connection); return(vendorList); }
public Boolean ReactivateVendor(Vendor vendor) { return(VendorDAL.ReactivateVendor(vendor, _connection)); }