private void dgvSaleaProduct_CellClick(object sender, DataGridViewCellEventArgs e) { CDeleteSalesPorduct oSaleaProduct = new CDeleteSalesPorduct(); if (dgvSaleaProduct.Rows.Count > 0) { if (e.RowIndex != -1) { if (e.ColumnIndex == 6) { if (MessageBox.Show("Are You Sure You Want TO Delete Sales Data?", "Sales Delete!!", MessageBoxButtons.YesNo) == DialogResult.Yes) { string SODMas_OID = dgvSaleaProduct.Rows[e.RowIndex].Cells["CSalesID"].Value.ToString(); CSalesproduct oSalseMaster = oSaleaProduct.DeleteFromMaster(SODMas_OID, CurrentUser); dgvSaleaProduct.Rows.RemoveAt(e.RowIndex); dgvSaleaProduct.Refresh(); dgvSaleaDetails.Rows.Clear(); } } } } }
private void dgvSaleaProduct_CellContentDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex != null) { CDeleteSalesPorduct oSelsproduct = new CDeleteSalesPorduct(); if (dgvSaleaProduct.Rows.Count > 0) { dgvSaleaDetails.Rows.Clear(); if (dgvSaleaProduct.Rows[e.RowIndex].Cells[e.ColumnIndex].Value != null) { Salaes_id = dgvSaleaProduct.Rows[e.RowIndex].Cells[e.ColumnIndex].Value.ToString(); } CSalesDetials[] oSalesDetailsList = oSelsproduct.Saleadetels(Salaes_id, CurrentUser).ToArray(); if (oSalesDetailsList != null) { foreach (CSalesDetials odetails in oSalesDetailsList) { dgvSaleaDetails.Rows.Add(odetails.SODet_OID, odetails.SODet_Branch, odetails.SODet_QTY, odetails.SODet_Price, odetails.SODet_Amount, odetails.SODet_SDValue, odetails.SODet_SDAmount, odetails.SODet_VATValue, odetails.SODet_VATAmount, odetails.SODet_Discount, odetails.SODet_NetAmount); } } } if (e.ColumnIndex == 0) { GrandTotal(); txtTotalAmount.Text = (float.Parse(txtTotalPrice.Text) + float.Parse(txtSaleaVatAmount.Text)).ToString(); string str = txtTotalAmount.Text; double d = Convert.ToDouble(str); double total = System.Math.Ceiling(d); txtTotaln.Text = total.ToString(); } } }
private void dgvSaleaProduct_CellClick_1(object sender, DataGridViewCellEventArgs e) { CDeleteSalesPorduct oSaleaProduct = new CDeleteSalesPorduct(); if (dgvSaleaProduct.Rows.Count > 0) { if (e.RowIndex != -1) { if (e.ColumnIndex == 4) { if (MessageBox.Show("Are You Sure You Want TO Delete Sales Data?", "Sales Delete!!", MessageBoxButtons.YesNo) == DialogResult.Yes) { string SODMas_OID = dgvSaleaProduct.Rows[e.RowIndex].Cells["CSalesID"].Value.ToString(); float amount = float.Parse(dgvSaleaProduct.Rows[e.RowIndex].Cells["SOMstr_NetAmt"].Value.ToString()); float NetAmount = float.Parse(txtTotalNetAmount.Text); //float deletedAmount = NetAmount - amount; float percentage = (amount * 100) / NetAmount; txtDeletedAmount.Text = percentage.ToString(); CSalesproduct oSalseMaster = oSaleaProduct.DeleteFromMaster(SODMas_OID, CurrentUser); dgvSaleaProduct.Rows.RemoveAt(e.RowIndex); btnScarch_Click(sender, e); //dgvSaleaDetails.Rows.Clear(); //getmaxID(); } } } } }
private void BindGoodsReceive() { CDeleteSalesPorduct oGoodReceiveMaster = new CDeleteSalesPorduct(); CSGoodsReceive[] oGoodReceiveList = oGoodReceiveMaster.allGoodsReceive(CurrentUser).ToArray(); if (oGoodReceiveList != null) { foreach (CSGoodsReceive oGoodsReceive in oGoodReceiveList) //oGoodsReceiveMaster.GRMstr_Code,oGoodsReceiveMaster.GRMstr_Type, { dgvGoodsReceive.Rows.Add(oGoodsReceive.Rec_OID, oGoodsReceive.Rec_ReqID, oGoodsReceive.Rec_IssueID, oGoodsReceive.Rec_BranchID, oGoodsReceive.Rec_ProductID, oGoodsReceive.Rec_WantedQTY, oGoodsReceive.Rec_IssueQTY, oGoodsReceive.Rec_Remark, oGoodsReceive.Rec_ReceivedQty); } } }
private void dgvGoodsReceive_CellClick(object sender, DataGridViewCellEventArgs e) { CDeleteSalesPorduct oGoodsReceive = new CDeleteSalesPorduct(); if (dgvGoodsReceive.Rows.Count > 0) { if (e.RowIndex != -1) { if (e.ColumnIndex == 9) { string Rec_OID = dgvGoodsReceive.Rows[e.RowIndex].Cells["Rec_OID"].Value.ToString(); string Rec_ProductID = dgvGoodsReceive.Rows[e.RowIndex].Cells["Rec_ProductID"].Value.ToString(); CSGoodsReceive oGoodReceiveProduct = oGoodsReceive.DeleteGoodsReceivede(Rec_OID, Rec_ProductID, CurrentUser); dgvGoodsReceive.Rows.RemoveAt(e.RowIndex); } } } }
private void btnScarch_Click(object sender, EventArgs e) { List <CSalesproduct> oListSOProduct = new List <CSalesproduct>(); CDeleteSalesPorduct oCDeleteSalesPorduct = new CDeleteSalesPorduct(); DateTime date = dtpScarch.Value.Date; string branch = ddlbranch.Text; CSalesproduct[] oReceiveDetailsList = oCDeleteSalesPorduct.Scarch(date, branch).ToArray(); if (oReceiveDetailsList != null) { dgvSaleaProduct.Rows.Clear(); foreach (CSalesproduct odetails in oReceiveDetailsList) { dgvSaleaProduct.Rows.Add(odetails.SOMstr_OID, odetails.SOMstr_Branch, odetails.SOMstr_Date, odetails.SOMstr_NetAmt, odetails.SOMstr_NetAmt); } } GrandNetAmount(); }
private void dgvSaleaDetails_CellClick(object sender, DataGridViewCellEventArgs e) { CDeleteSalesPorduct oSaleaProduct = new CDeleteSalesPorduct(); if (dgvSaleaDetails.Rows.Count > 0) { if (e.RowIndex != -1) { if (e.ColumnIndex == 11) { string SODet_OID = dgvSaleaDetails.Rows[e.RowIndex].Cells["SODet_OID"].Value.ToString(); float qty = float.Parse(dgvSaleaDetails.Rows[e.RowIndex].Cells["SODet_QTY"].Value.ToString()); string ItemID = dgvSaleaDetails.Rows[e.RowIndex].Cells["ItemID"].Value.ToString(); string Rec_OID = dgvSaleaDetails.Rows[e.RowIndex].Cells["ReceiveID"].Value.ToString(); // float amount = float.Parse(dgvSaleaDetails.Rows[e.RowIndex].Cells["SODet_Amount"].Value.ToString()); //CSalesDetials oSalsedetails = oSaleaProduct.DeleteFromdetails(SODet_OID, ItemID, qty, Rec_OID,CurrentUser); dgvSaleaDetails.Rows.RemoveAt(e.RowIndex); } } } }