private void onLoadBuy(object sender, EventArgs e)
        {
            try
            {
                bool isExist = ShopDAL.isItemTypeExists();
                if (isExist)
                {
                    ShopDAL dal = new ShopDAL();
                    DataSet ds  = dal.GetItemsType();
                    cmbItemType.DataSource    = ds.Tables[0];
                    cmbItemType.DisplayMember = "Name";
                    cmbItemType.ValueMember   = "Type_ID";
                }

                DataSet dsContractor = ContractorDAL.getContractorsDs();
                DataRow defaultRow   = dsContractor.Tables[0].NewRow();
                defaultRow["ID"]   = "0";
                defaultRow["Name"] = "------ Select Contractor  ------";
                dsContractor.Tables[0].Rows.InsertAt(defaultRow, 0);

                cmbContractor.DataSource    = dsContractor.Tables[0];
                cmbContractor.DisplayMember = "Name";
                cmbContractor.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();
            }
        }
Example #2
0
        private void ContractorManagement_Load(object sender, EventArgs e)
        {
            ContractorDAL contractor = new ContractorDAL();

            _contractorsDs = contractor.getContractorsPresentationDs();
            DataView dv = _contractorsDs.Tables[0].DefaultView;

            dv.RowFilter             = "IsDeleted = 0";
            dgContractors.DataSource = dv;
            combCountries.DataSource = CountryDAL.GetCountries();
            btAddNewContractor.Focus();
            _contractorAdapter = contractor.getContractorAdapter();
            this.dgContractors.SelectionChanged += new EventHandler(dgContractors_SelectionChanged);
            isDirty = false;
        }
 public bool Delete(ContractorModel Obj)
 {
     return(ContractorDAL.Delete(Obj));
 }
 public bool UpdateContractor(ContractorModel Obj)
 {
     return(ContractorDAL.UpdateContractor(Obj));
 }
 public bool AddContractor(ContractorModel Obj)
 {
     return(ContractorDAL.AddContractor(Obj));
 }
 public List <ContractorModel> GetContractor(SessionDataBLL Obj)
 {
     return(ContractorDAL.GetContractor(Obj));
 }