private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e) { DataGridViewRow row = dataGridView1.CurrentRow; EditOrder editform = new EditOrder(row); editform.Show(); }
public void EditOrder() { RightEditPanel.Controls.Clear(); EditOrder editOrder = new EditOrder(ref CurrentOrder, EditOrder_PageClose); editOrder.TopLevel = false; editOrder.Dock = DockStyle.Fill; RightEditPanel.Controls.Add(editOrder); editOrder.Show(); }
private void EditOrders_OnClick(object sender, RoutedEventArgs e) { _applicationManager.getCustomers(); _applicationManager.getEmployees(); _applicationManager.getProducts(); _applicationManager.GetOrderDetails(); var editOrdersForm = new EditOrder(); editOrdersForm.Show(); }
private void Border_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (OrderVerification()) { EditOrder editOrder = new EditOrder(_orderId); editOrder.Show(); } else { MessageBox.Show("Please, select the order"); } }
private void btnedit_Click(object sender, EventArgs e) { if (gvPurchase.SelectedRows.Count != 1) { MessageBox.Show("please select one row first"); return; } if (userRolesObj.getCheckstate("AddEditOrders") == true) { Forms.Order.EditOrder ec = new EditOrder(this); LotNo = int.Parse(this.gvPurchase.CurrentRow.Cells[3].Value.ToString()); ec.LotNo = LotNo; ec.OrderId = this.gvPurchase.CurrentRow.Cells[0].Value.ToString(); ec.DeliveryOrderNo = this.gvPurchase.CurrentRow.Cells[16].Value.ToString(); ec.cmLotNo.DataSource = new DAO().GetLotNoS(); ec.cmLotNo.DisplayMember = "LotNo"; ec.cmLotNo.ValueMember = "IId"; int lotNoIndex = getIndexLotNo(ec.cmLotNo, LotNo.ToString()); ec.cmLotNo.SelectedIndex = lotNoIndex; decimal SellingWeight = decimal.Parse(gvPurchase.CurrentRow.Cells[7].Value.ToString()); ec.SellingWt = SellingWeight; decimal Shortage = decimal.Parse(gvPurchase.CurrentRow.Cells[6].Value.ToString()); string partyname = this.gvPurchase.CurrentRow.Cells[2].Value.ToString(); ec.cbCustName.DataSource = new DAO().GetPartiesFrmAccount(); ec.cbCustName.DisplayMember = "Name"; ec.cbCustName.ValueMember = "Party-ID"; int PartyIndex = getIndexParty(ec.cbCustName, partyname); ec.cbCustName.SelectedIndex = PartyIndex; Brokername = this.gvPurchase.CurrentRow.Cells[12].Value.ToString(); ec.cmBrokerName.DataSource = new DAO().GetBrokers(); ec.cmBrokerName.DisplayMember = "BrokerName"; ec.cmBrokerName.ValueMember = "BId"; int brokerIndex = getIndexbroker(ec.cmBrokerName, Brokername); ec.cmBrokerName.SelectedIndex = brokerIndex; ec.dtODate.MinDate = new DateTime(DateTime.Now.Year, 1, 1); ec.dtODate.MaxDate = DateTime.Now; ec.dtODate.Value = DateTime.Parse(this.gvPurchase.CurrentRow.Cells[1].Value.ToString()); DataTable dt2 = new DAO().GetItemsforLotNo(LotNo); ec.IId = int.Parse(dt2.Rows[0]["IId"].ToString()); ec.txtGarden.Text = dt2.Rows[0]["IGarden"].ToString(); ec.txtGrade.Text = dt2.Rows[0]["IGrade"].ToString(); sellingQty = decimal.Parse(gvPurchase.CurrentRow.Cells[5].Value.ToString()); decimal TotalQuantityleft = decimal.Parse(dt2.Rows[0]["IQty"].ToString()); ec.txtQtyLeft.Text = TotalQuantityleft.ToString(); int ItemWtPerBag = int.Parse(dt2.Rows[0]["IWtPerBag"].ToString()); ec.txtWtPerBag.Text = ItemWtPerBag.ToString(); decimal TotalWeightLeft = decimal.Parse(dt2.Rows[0]["ITotalWeight"].ToString()); ec.txtWtLeft.Text = TotalWeightLeft.ToString(); ec.SellingQty = decimal.Parse(gvPurchase.CurrentRow.Cells[5].Value.ToString()); ec.txtSellingQty.Text = gvPurchase.CurrentRow.Cells[5].Value.ToString(); ec.txtSellingWt.Text = SellingWeight.ToString(); ec.txtShortage.Text = Shortage.ToString(); ec.NetWeight = SellingWeight - Shortage; ec.txtNetWeight.Text = Convert.ToString(SellingWeight - Shortage); ec.txtRatePerKg.Text = gvPurchase.CurrentRow.Cells[4].Value.ToString(); ec.RatePerKg = int.Parse(gvPurchase.CurrentRow.Cells[4].Value.ToString()); ec.txtTotal.Text = gvPurchase.CurrentRow.Cells[8].Value.ToString(); // ec.txtSellingQty.Text = gvPurchase.CurrentRow.Cells[5].Value.ToString(); ec.txtQtyLeft.Enabled = false; ec.txtWtLeft.Enabled = false; ec.txtWtPerBag.Enabled = false; ec.cmBrokerName.SelectedText = this.gvPurchase.CurrentRow.Cells[12].Value.ToString(); BrokeryAmount = decimal.Parse(this.gvPurchase.CurrentRow.Cells[11].Value.ToString()); ec.txtBrokeryAmount.Text = this.gvPurchase.CurrentRow.Cells[11].Value.ToString(); ec.txtBardena.Text = this.gvPurchase.CurrentRow.Cells[13].Value.ToString(); ec.txtTulai.Text = this.gvPurchase.CurrentRow.Cells[15].Value.ToString(); ec.txtCarrage.Text = this.gvPurchase.CurrentRow.Cells[14].Value.ToString(); ec.WindowState = FormWindowState.Maximized; ec.Show(); } else { MessageBox.Show("you don't have permission to enter here, Contact admin For further Details"); return; } }
private void addOrdToolStripMenuItem_Click(object sender, EventArgs e) { EditOrder editform = new EditOrder(); editform.Show(); }