Ejemplo n.º 1
0
 private void button1_Click(object sender, EventArgs e)
 {
     Poultry.classes.Expenses ex = new Poultry.classes.Expenses();
      ex.Save();
      double i=GLOBAL_VARS.db.getLastId();
      MessageBox.Show(i.ToString());
 }
Ejemplo n.º 2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if(this.hasErrors()==false){
                Expenses ex = new Expenses();
                ex.setExpensesType(cboType.Text);
                ex.setDescription(txtDescription.Text);
                if (btnBrowse.Enabled)
                {
                    ex.setQuantity(double.Parse(txtQuantity.Text));
                }
                else {
                    ex.setQuantity(0);
                }
                ex.setAmount(double.Parse(txtAmount.Text));
                ex.setRemarks(txtRemarks.Text);

                if(this.active_expenses_id!=0){
                    ex.setIdExpenses(active_expenses_id);
                    ex.edit();
                }
                else{ex.Save();}
            }
            this.clearFields();
            fe.loadListviewItem();

            //save record for tindahan record automatically
            this.saveToTindahan();
        }
Ejemplo n.º 3
0
 public frmViewExpenses()
     : base()
 {
     Expenses ex = new Expenses();
     InitializeComponent();
     this.lblHeader.Text = "EXPENSES";
     this.setLocation();
     setHeader();
     loadListviewItem();
 }
Ejemplo n.º 4
0
 private void btnSave_Click(object sender, EventArgs e)
 {
     //idexpenses, description, amount, quantity, date_created, remarks, expenses_type
     Expenses updateExp;
     List<Expenses> expensesToUpdate = new List<Expenses>();
     foreach(ListViewItem lst in lsvNewMonth.Items){
         updateExp = new Expenses();
         updateExp.setIdExpenses(Convert.ToDouble(lst.Text));
         updateExp.setDescription(lst.SubItems[1].Text);
         updateExp.setAmount(Convert.ToDouble(lst.SubItems[2].Text));
         updateExp.setQuantity(Convert.ToDouble(lst.SubItems[3].Text));
         updateExp.setRemarks(lst.SubItems[5].Text);
         updateExp.setDateCreated(formatDate());
         updateExp.setExpensesType(lst.SubItems[6].Text);
         updateExp.Save();
         expensesToUpdate.Add(updateExp);
     }
     this.updateQtyOfPreviousExp(expensesToUpdate);
 }
Ejemplo n.º 5
0
        private void frmManageExpenses_Load(object sender, EventArgs e)
        {
            if(this.active_expenses_id!=0){
                Expenses ex = new Expenses();
                ex.loadExpenses(this.active_expenses_id);
                this.cboType.Text = ex.getExpensesType();
                this.txtDescription.Text = ex.getDescription();
                this.txtAmount.Text = ex.getAmount().ToString();
                this.txtQuantity.Text = ex.getQuantity().ToString();
                this.txtRemarks.Text = ex.getRemarks();

                this.btnSave.Text = "UPDATE";
            }
        }
Ejemplo n.º 6
0
        private void deleteToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (MessageBox.Show("Selected record will be deleted", "Delete", MessageBoxButtons.OKCancel,MessageBoxIcon.Exclamation)==DialogResult.OK)
            {
                Expenses delEx = new Expenses();
                delEx.loadExpenses(Convert.ToDouble(lsvView.SelectedItems[0].Text));
                delEx.delete();
                this.loadListviewItem();

            }
        }