public void update(Model.taxpaid taxpaid) { id = taxpaid.id; taxyear = (int)taxpaid.taxyear_id; title = (int)taxpaid.tax_id; date = (int)taxpaid.date; amount = (decimal)taxpaid.amount; paidby = taxpaid.paidby; discription = taxpaid.discription; }
private void materialButton_save_Click(object sender, EventArgs e) { if (comboBox_taxyear.SelectedItem == null) { CustomControls.Alert.show("Select", "Please select tax yearr", 2000); comboBox_taxyear.Focus(); return; } if (comboBox_Textitle.SelectedItem == null) { CustomControls.Alert.show("Title", "Please select tax title", 2000); comboBox_Textitle.Focus(); return; } if (betterTextBox_amout.decVal == 0) { CustomControls.Alert.show("Amount", "Please enter tax amount", 2000); betterTextBox_amout.Focus(); return; } if (betterTextBox_paidbye.Text.Trim() == "") { CustomControls.Alert.show("Name", "Please enter Name of paidby", 2000); betterTextBox_paidbye.Focus(); return; } if (betterTextBox_dis.Text.Trim() == "") { CustomControls.Alert.show("Discription", "Please enter discription", 2000); betterTextBox_dis.Focus(); return; } var addnew = new Model.taxpaid() { vahicle_id = id, tax_id = ((comboBox_Textitle.SelectedItem as Model.tax).id), taxyear_id = ((comboBox_taxyear.SelectedItem as Model.taxcategory).id), date = nepaliCalender_date.Datestamp, paidby = betterTextBox_paidbye.Text, amount = betterTextBox_amout.decVal, discription = betterTextBox_dis.Text, admin_id = INFO.admin_id, updated_at = DateTime.Now, created_at = DateTime.Now }; db.taxpaids.Add(addnew); db.SaveChanges(); adddata?.Invoke(addnew); this.Close(); }
public Viwer(Model.taxpaid Taxpaids, int sn) { for (int i = 1; i <= 10; i++) { SubItems.Add(new ListViewSubItem()); } id = Taxpaids.id; taxyear = (int)Taxpaids.taxyear_id; title = (int)Taxpaids.tax_id; date = (int)Taxpaids.date; amount = (decimal)Taxpaids.amount; paidby = Taxpaids.paidby; discription = Taxpaids.discription; SubItems[0].Text = sn.ToString(); }
private void Edit_edit(Model.taxpaid taxpaid) { var sel = betterListView1.SelectedItems[0] as Viwer; sel.update(taxpaid); }
private void Add_adddata(Model.taxpaid taxpaid) { betterListView1.Items.Add(new Viwer(taxpaid, betterListView1.Items.Count + 1)); }