コード例 #1
0
 public void update(Model.paidfinance paidfinance)
 {
     id          = paidfinance.id;
     finance_id  = (int)paidfinance.finance_id;
     title       = paidfinance.title;
     date        = (int)paidfinance.date;
     paidby      = paidfinance.paidby;
     amount      = paidfinance.paidamount.Value;
     discription = paidfinance.discription;
 }
コード例 #2
0
 public Viwer(Model.paidfinance paidfinance, int sn)
 {
     for (int i = 1; i <= 10; i++)
     {
         SubItems.Add(new ListViewSubItem());
     }
     id                    = paidfinance.id;
     finance_id            = (int)paidfinance.finance_id;
     title                 = paidfinance.title;
     date                  = (int)paidfinance.date;
     paidby                = paidfinance.paidby;
     amount                = paidfinance.paidamount.Value;
     discription           = paidfinance.discription;
     this.SubItems[0].Text = sn.ToString();
 }
コード例 #3
0
        private void materialButton_save_Click(object sender, EventArgs e)
        {
            if (comboBox_finance.SelectedItem == null)
            {
                CustomControls.Alert.show("Select", "Please select finance name", 2000);
                return;
            }
            if (betterTextBox_Title.Text.Trim() == "")
            {
                CustomControls.Alert.show("Amount", "Please enter payment title", 2000);
                return;
            }
            if (betterTextBox_amout.decVal == 0)
            {
                CustomControls.Alert.show("Amount", "Please enter tax amount", 2000);
                return;
            }
            if (betterTextBox_paidbye.Text.Trim() == "")
            {
                CustomControls.Alert.show("Name", "Please enter Name of paidby", 2000);
                return;
            }
            if (betterTextBox_dis.Text.Trim() == "")
            {
                CustomControls.Alert.show("Discription", "Please enter discription", 2000);
                return;
            }


            var adddata = new Model.paidfinance()
            {
                vehicle_id  = id,
                title       = betterTextBox_Title.Text,
                paidamount  = betterTextBox_amout.decVal,
                discription = betterTextBox_dis.Text,
                date        = nepaliCalender_date.Datestamp,
                finance_id  = ((comboBox_finance.SelectedItem as Model.finance).id),
                paidby      = betterTextBox_paidbye.Text,
                updated_at  = DateTime.Now,
                created_at  = DateTime.Now,
                admin_id    = INFO.admin_id,
            };

            DB.Instance.paidfinances.Add(adddata);
            DB.Instance.SaveChanges();
            add?.Invoke(adddata);
            this.Close();
        }
コード例 #4
0
        private void Newedit_edit(Model.paidfinance paidfinance)
        {
            var sel = betterListView1.SelectedItems[0] as Viwer;

            sel.update(paidfinance);
        }
コード例 #5
0
 private void Adddata_add(Model.paidfinance paidfinance)
 {
     betterListView1.Items.Add(new Viwer(paidfinance, betterListView1.Items.Count + 1));
 }