private void FillDcDcstList() { objPUDB = new ProductUnitDB(); try { cbDCDCSTNo.DataSource = null; DataTable dt = objPUDB.DcDCSTList_Get(CommonData.CompanyCode, CommonData.BranchCode, CommonData.FinancialYear, CommonData.DocMonth).Tables[0]; if (dt.Rows.Count > 0) { DataRow row = dt.NewRow(); row[0] = "--Select--"; row[1] = "--Select--"; dt.Rows.InsertAt(row, 0); cbDCDCSTNo.DataSource = dt; cbDCDCSTNo.ValueMember = "VALUE_MEMBER"; cbDCDCSTNo.DisplayMember = "DISPLAY_MEMBER"; cbDCDCSTNo.SelectedIndex = 0; } dt = null; } catch (Exception ex) { MessageBox.Show(ex.Message, "SP GRN", MessageBoxButtons.OK, MessageBoxIcon.Stop); } finally { objPUDB = null; Cursor.Current = Cursors.Default; } }
private void FillTransactionDetl(DataTable dt) { objPUDB = new ProductUnitDB(); try { gvGRNDetails.Rows.Clear(); if (dt.Rows.Count > 0) { for (int intRow = 0; intRow < dt.Rows.Count; intRow++) { gvGRNDetails.Rows.Add(); gvGRNDetails.Rows[intRow].Cells["SLNO"].Value = intRow + 1; gvGRNDetails.Rows[intRow].Cells["Category"].Value = dt.Rows[intRow]["category_name"].ToString(); gvGRNDetails.Rows[intRow].Cells["Product"].Value = dt.Rows[intRow]["product_name"].ToString(); gvGRNDetails.Rows[intRow].Cells["ProductId"].Value = dt.Rows[intRow]["ProductId"].ToString(); //gvGRNDetails.Rows[intRow].Cells["GoodQty"].Value = dt.Rows[intRow]["IssQty"].ToString(); gvGRNDetails.Rows[intRow].Cells["DispQty"].Value = dt.Rows[intRow]["TotalQty"].ToString(); gvGRNDetails.Rows[intRow].Cells["TotalQty"].Value = dt.Rows[intRow]["RecevedQty"].ToString(); gvGRNDetails.Rows[intRow].Cells["DamageQty"].Value = dt.Rows[intRow]["ExcessOrShortageQty"].ToString(); gvGRNDetails.Rows[intRow].Cells["RATE"].Value = dt.Rows[intRow]["IssRate"].ToString(); gvGRNDetails.Rows[intRow].Cells["Amount"].Value = dt.Rows[intRow]["IssAmt"].ToString(); } } } catch (Exception ex) { MessageBox.Show(ex.Message, "SP GRN", MessageBoxButtons.OK, MessageBoxIcon.Stop); } finally { objPUDB = null; } }
private void FillProductBatchList() { objPU = new ProductUnitDB(); DataTable dt = null; try { if (strFLoad == "NO" && strModify == "NO") { if (cbCategory.SelectedIndex != -1 && cbProduct.SelectedIndex > -1) { this.gvProduct.Rows.Clear(); if (cbProduct.SelectedIndex > 0) { dt = objPU.FinishedProductList_Get(CommonData.CompanyCode, CommonData.BranchCode, cbProduct.SelectedValue.ToString(), cbCategory.SelectedValue.ToString()).Tables[0]; } else { dt = objPU.FinishedProductList_Get(CommonData.CompanyCode, CommonData.BranchCode, string.Empty, cbCategory.SelectedValue.ToString()).Tables[0]; } if (dt.Rows.Count > 0) { for (int intRow = 0; intRow < dt.Rows.Count; intRow++) { gvProduct.Rows.Add(); gvProduct.Rows[intRow].Cells["SLNO"].Value = intRow + 1; gvProduct.Rows[intRow].Cells["ProductId"].Value = dt.Rows[intRow]["ProductId"].ToString(); gvProduct.Rows[intRow].Cells["ProductName"].Value = dt.Rows[intRow]["Product"].ToString(); gvProduct.Rows[intRow].Cells["BatchNo"].Value = dt.Rows[intRow]["BatchNo"].ToString(); gvProduct.Rows[intRow].Cells["BatchDate"].Value = Convert.ToDateTime(dt.Rows[intRow]["BatchDate"]).ToString("dd/MM/yyyy"); gvProduct.Rows[intRow].Cells["MFGDate"].Value = Convert.ToDateTime(dt.Rows[intRow]["MFGDate"]).ToString("dd/MM/yyyy"); gvProduct.Rows[intRow].Cells["EXPDate"].Value = Convert.ToDateTime(dt.Rows[intRow]["EXPDate"]).ToString("dd/MM/yyyy"); gvProduct.Rows[intRow].Cells["ExpDays"].Value = dt.Rows[intRow]["ExpDays"].ToString(); gvProduct.Rows[intRow].Cells["Qty"].Value = dt.Rows[intRow]["Qty"].ToString(); gvProduct.Rows[intRow].Cells["Rate"].Value = dt.Rows[intRow]["Rate"].ToString(); gvProduct.Rows[intRow].Cells["Amount"].Value = dt.Rows[intRow]["Amount"].ToString(); } } } } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { objPU = null; } }
private void FillProducts() { objPU = new ProductUnitDB(); DataSet ds = new DataSet(); string strCatId = string.Empty; string strProduct = string.Empty; if (txtProductName.Text.ToString().Trim().Length > 2) { strProduct = txtProductName.Text; } tvProducts.Nodes.Clear(); ds = objPU.BatchProductList_Get(CommonData.CompanyCode, CommonData.BranchCode, strProduct); TreeNode tNode; tNode = tvProducts.Nodes.Add("Products"); Int16 intNode = 0; if (ds.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { if (strCatId != ds.Tables[0].Rows[i]["CategoryID"].ToString()) { strCatId = ds.Tables[0].Rows[i]["CategoryID"].ToString(); tvProducts.Nodes[0].Nodes.Add(ds.Tables[0].Rows[i]["CategoryID"].ToString(), ds.Tables[0].Rows[i]["CategoryName"].ToString()); tvProducts.Nodes[0].Nodes[intNode].Nodes.Add(ds.Tables[0].Rows[i]["ProductID"].ToString() + '@' + ds.Tables[0].Rows[i]["BATCH_NO"].ToString() + '@' + ds.Tables[0].Rows[i]["RATE"].ToString() + '@' + ds.Tables[0].Rows[i]["BATCH_DATE"].ToString() + '@' + ds.Tables[0].Rows[i]["BATCH_EXP_DATE"].ToString(), ds.Tables[0].Rows[i]["ProductName"].ToString()); intNode += 1; } else { tvProducts.Nodes[0].Nodes[intNode - 1].Nodes.Add(ds.Tables[0].Rows[i]["ProductID"].ToString() + '@' + ds.Tables[0].Rows[i]["BATCH_NO"].ToString() + '@' + ds.Tables[0].Rows[i]["RATE"].ToString() + '@' + ds.Tables[0].Rows[i]["BATCH_DATE"].ToString() + '@' + ds.Tables[0].Rows[i]["BATCH_EXP_DATE"].ToString(), ds.Tables[0].Rows[i]["ProductName"].ToString()); } } } if (this.tvProducts.Nodes[0].Nodes.Count > 0) { if (this.tvProducts.Nodes[0].Nodes[0].Nodes.Count > 1) { this.tvProducts.SelectedNode = tNode.Nodes[0]; this.tvProducts.SelectedNode.Expand(); } } }
private string NewTransactionNumber() { string sTranNo = string.Empty; objPUDB = new ProductUnitDB(); try { sTranNo = objPUDB.GenerateNewSPGRNTranNo(CommonData.CompanyCode, CommonData.BranchCode); } catch (Exception ex) { MessageBox.Show(ex.Message, "SP GRN", MessageBoxButtons.OK, MessageBoxIcon.Stop); } finally { objPUDB = null; } return(sTranNo); }