public void update(Model.orderitemlist orderitemlist) { id = orderitemlist.id; sendername = orderitemlist.sender_name; senderphone = orderitemlist.sender_phone; itemname = orderitemlist.itemname; receivername = orderitemlist.receivername; receiverphone = orderitemlist.receiverphone; itemtype_id = (int)orderitemlist.orderitemtype_id; from_id = (int)orderitemlist.location_from; to_id = (int)orderitemlist.location_too; deliver_place = orderitemlist.deliveryplace; unit = orderitemlist.unit; quantity = (decimal)orderitemlist.quantity; weight = (decimal)orderitemlist.weight; date = (orderitemlist.date.Value); chargeamount = (decimal)orderitemlist.amount; }
public void add(Model.orderitemlist orderitemlist) { var viwer = new Item.SenderViwer(); viwer.id = orderitemlist.id; viwer.itemname = orderitemlist.itemname; viwer.sendername = orderitemlist.sender_name; viwer.senderphone = orderitemlist.sender_phone; viwer.from = (orderitemlist.location as Model.location).name; viwer.tooo = (orderitemlist.location1 as Model.location).name; viwer.senderphone = orderitemlist.sender_phone; viwer.receivername = orderitemlist.receivername; viwer.receiverphone = orderitemlist.receiverphone; viwer.weight = orderitemlist.weight.Value; viwer.quantity = orderitemlist.quantity.Value; viwer.rate = orderitemlist.amount.Value; viwer.deliver_place = orderitemlist.deliveryplace; viwer.unit = orderitemlist.unit; viwer.Dock = DockStyle.Top; panel_list.Controls.Add(viwer); }
public Viwer(Model.orderitemlist orderitemlist, int sn) { for (int i = 0; i <= 17; i++) { SubItems.Add(new ListViewSubItem()); } id = orderitemlist.id; sendername = orderitemlist.sender_name; receivername = orderitemlist.receivername; receiverphone = orderitemlist.receiverphone; senderphone = orderitemlist.sender_phone; itemname = orderitemlist.itemname; itemtype_id = (int)orderitemlist.orderitemtype_id; from_id = (int)orderitemlist.location_from; to_id = (int)orderitemlist.location_too; deliver_place = orderitemlist.deliveryplace; unit = orderitemlist.unit; quantity = (decimal)orderitemlist.quantity; weight = (decimal)orderitemlist.weight; date = (int)orderitemlist.date; chargeamount = (decimal)orderitemlist.amount; this.SubItems[0].Text = sn.ToString(); }
private void Add_adddata(Model.orderitemlist orderitem) { throw new NotImplementedException(); }
private void Addnew_adddata(Model.orderitemlist orderitem) { }
private void materialButton_save_Click(object sender, EventArgs e) { if (betterTextBox_sendername.Text.Trim() == "") { CustomControls.Alert.show("Name", "Please enter sender name", 2000); return; } if (betterTextBox_receivername.Text.Trim() == "") { CustomControls.Alert.show("Address", "Please enter sender address", 2000); return; } if (betterTextBox_senderphonenumber.Text.Trim() == "") { CustomControls.Alert.show("Address", "Please enter sender phone", 2000); return; } if (betterTextBox_itemname.Text.Trim() == "") { CustomControls.Alert.show("Name", " please enter item name", 2000); return; } if (comboBox_itemtype.SelectedItem == null) { CustomControls.Alert.show("Item Type", " please select item type", 2000); return; } if (comboBox_locationfrom.SelectedItem == null) { CustomControls.Alert.show("From", " please select location ", 2000); return; } if (comboBox_locationto.SelectedItem == null) { CustomControls.Alert.show("To", "select location", 2000); return; } if (betterTextBox_itemweight.Text.Trim() == "") { CustomControls.Alert.show("To", "enter weight of item", 2000); return; } if (betterTextBox_itemqty.Text.Trim() == "") { CustomControls.Alert.show("To", "enter quantity of item", 2000); return; } if (betterTextBox_amount.Text.Trim() == "") { CustomControls.Alert.show("To", "enter charge amount", 2000); return; } if (betterTextBox_unit.Text.Trim() == "") { CustomControls.Alert.show("To", "enter unit", 2000); return; } if (betterTextBox_deliverplace.Text.Trim() == "") { CustomControls.Alert.show("To", "enter deliver place", 2000); return; } var additem = new Model.orderitemlist() { sender_name = betterTextBox_sendername.Text, sender_phone = betterTextBox_senderphonenumber.Text, receivername = betterTextBox_receivername.Text, receiverphone = betterTextBox_receiverphone.Text, itemname = betterTextBox_itemname.Text, orderitemtype_id = ((comboBox_itemtype.SelectedItem as Model.orderitemtype).id), location_from = ((comboBox_locationfrom.SelectedItem as Model.location).id), location_too = ((comboBox_locationto.SelectedItem as Model.location).id), weight = betterTextBox_itemweight.decVal, active = true, deliveryplace = betterTextBox_deliverplace.Text, unit = betterTextBox_unit.Text, date = nepaliCalender_DAte.Datestamp, quantity = betterTextBox_itemqty.decVal, amount = betterTextBox_amount.decVal, created_at = DateTime.Now, updated_at = DateTime.Now }; db.orderitemlists.Add(additem); db.SaveChanges(); adddata?.Invoke(additem); this.Close(); }