예제 #1
0
        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);
            }
        }
예제 #2
0
        /// <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);
        }
예제 #3
0
        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();
            }
        }
예제 #4
0
        /// <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();
            }
        }
예제 #5
0
 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
 }
예제 #6
0
        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;
        }
예제 #7
0
 // 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;
     }
 }
예제 #8
0
 // 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;
     }
 }
예제 #9
0
 //  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;
     }
 }
예제 #10
0
        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();
            }
        }
예제 #11
0
    //  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;
        }
    }
예제 #12
0
    // 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;
        }
    }
예제 #13
0
    // 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;
        }
    }
예제 #14
0
    //  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;
        }
    }
예제 #15
0
 public static int GetRows()
 {
     return(VendorDAL.GetRows());
 }
예제 #16
0
 public static IQueryable GetAll()
 {
     return(VendorDAL.GetAll());
 }
예제 #17
0
 public int GetMaxVendorID()
 {
     return(VendorDAL.MaxID(_connection));
 }
예제 #18
0
 // add a vendor to the DB
 public Boolean AddVendor(Vendor vendor)
 {
     return(VendorDAL.AddVendor(vendor, _connection));
 }
예제 #19
0
 public Boolean DeleteVendor(Vendor vendor)
 {
     return(VendorDAL.DeleteVendor(vendor, _connection));
 }
예제 #20
0
 //  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;
     }
 }
예제 #21
0
 //删除
 public static int VendorDele(int id)
 {
     return(VendorDAL.VendorDele(id));
 }
예제 #22
0
 public static IQueryable ShowByName1(string name)
 {
     return(VendorDAL.ShowByName1(name));
 }
예제 #23
0
        public List <Vendor> GetVendors()
        {
            List <Vendor> vendorList = VendorDAL.GetAllVendors(_connection);

            return(vendorList);
        }
예제 #24
0
 public static int DeleteVndor(int VendorId)
 {
     return(VendorDAL.DeleteVndor(VendorId));
 }
예제 #25
0
 public static IVendor GetVendor(int ID)
 {
     return(VendorDAL.GetVendor(ID));
 }
예제 #26
0
 public static PageList PageListDemo(int pageIndex, int PageSize)
 {
     return(VendorDAL.PageListDemo(pageIndex, PageSize));
 }
예제 #27
0
 public static PageList ShowByName(int pageIndex, int pageSize, int VenId, string VenName)
 {
     return(VendorDAL.ShowByName(pageIndex, pageSize, VenId, VenName));
 }
예제 #28
0
 public static int updataVendor(Vendor d)
 {
     return(VendorDAL.updataVendor(d));
 }
예제 #29
0
 //添加供应商
 public static int VendorAdd(Vendor ven)
 {
     return(VendorDAL.VendorAdd(ven));
 }
예제 #30
0
 public Vendor GetVendor(int vendorId)
 {
     return(VendorDAL.GetVendor(vendorId, _connection));
 }
예제 #31
0
 /// <summary>
 /// 根据id查供应商信息
 /// </summary>
 /// <param name="id">供应商id</param>
 /// <returns>数据集合</returns>
 public static IQueryable VendorByid(int id)
 {
     return(VendorDAL.VendorByid(id));
 }
예제 #32
0
 public Boolean UpdateVendor(Vendor vendor, Vendor origVendor)
 {
     return(VendorDAL.UpdateVendor(vendor, origVendor, _connection));
 }
예제 #33
0
        public List <Vendor> GetVendorsByActive(Boolean active)
        {
            List <Vendor> vendorList = VendorDAL.GetAllVendorsByActive(active, _connection);

            return(vendorList);
        }
예제 #34
0
 public Boolean ReactivateVendor(Vendor vendor)
 {
     return(VendorDAL.ReactivateVendor(vendor, _connection));
 }