private void btnVendorSearch_Click(object sender, EventArgs e) { try { if (PosApplication.Instance.TransactionServices.CheckConnection()) { ReadOnlyCollection <object> containerArray; containerArray = PosApplication.Instance.TransactionServices.InvokeExtension("GetVendAccount"); DataSet dsVendor = new DataSet(); StringReader srTransDetail = new StringReader(Convert.ToString(containerArray[3])); if (Convert.ToString(containerArray[3]).Trim().Length > 38) { dsVendor.ReadXml(srTransDetail); } if (dsVendor != null && dsVendor.Tables[0].Rows.Count > 0) { Dialog.WinFormsTouch.frmGenericSearch Osearch = new Dialog.WinFormsTouch.frmGenericSearch(dsVendor.Tables[0], null, "Vendor"); Osearch.ShowDialog(); DataRow dr = Osearch.SelectedDataRow; if (dr != null) { txtVendorAc.Text = Convert.ToString(dr["AccountNum"]); txtVendorName.Text = Convert.ToString(dr["Name"]); } } } } catch (Exception ex) { } }
private void btnTransferSearch_Click(object sender, EventArgs e) { try { if (PosApplication.Instance.TransactionServices.CheckConnection()) { ReadOnlyCollection <object> containerArray; string sStoreId = ApplicationSettings.Terminal.StoreId; containerArray = PosApplication.Instance.TransactionServices.InvokeExtension("GetTransferId", sStoreId); DataSet dsTransfer = new DataSet(); StringReader srTransDetail = new StringReader(Convert.ToString(containerArray[3])); if (Convert.ToString(containerArray[3]).Trim().Length > 38) { dsTransfer.ReadXml(srTransDetail); } if (dsTransfer != null && dsTransfer.Tables[0].Rows.Count > 0) { Dialog.WinFormsTouch.frmGenericSearch Osearch = new Dialog.WinFormsTouch.frmGenericSearch(dsTransfer.Tables[0], null, "Transfer Order Id"); Osearch.ShowDialog(); DataRow dr = Osearch.SelectedDataRow; if (dr != null) { txtTransferId.Text = Convert.ToString(dr["TransferId"]); } } } } catch (Exception ex) { } }
/// <summary> /// DEV BY RIPAN HOSSAIN ON 06032013 -- to counter searching /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnToCounterSearch_Click(object sender, EventArgs e) { DataTable dtCounter = new DataTable(); DataRow drCounter = null; SqlConnection conn = new SqlConnection(); conn = application.Settings.Database.Connection; if (conn.State == ConnectionState.Closed) { conn.Open(); } string commandText = string.Empty; if (string.IsNullOrEmpty(txtFromCounter.Text)) { commandText = "SELECT A.COUNTERCODE AS CODE,B.COUNTERDESC AS DESCRIPTION FROM RETAILSTORECOUNTERTABLE A" + " INNER JOIN COUNTERMASTER B ON A.COUNTERCODE = B.COUNTERCODE WHERE A.RETAILSTOREID = '" + ApplicationSettings.Terminal.StoreId.Trim() + "' "; } else { commandText = "SELECT A.COUNTERCODE AS CODE,B.COUNTERDESC AS DESCRIPTION FROM RETAILSTORECOUNTERTABLE A" + " INNER JOIN COUNTERMASTER B ON A.COUNTERCODE = B.COUNTERCODE" + " WHERE A.RETAILSTOREID = '" + ApplicationSettings.Terminal.StoreId.Trim() + "' AND A.COUNTERCODE <> '" + Convert.ToString(txtFromCounter.Text) + "'"; } SqlCommand command = new SqlCommand(commandText, conn); command.CommandTimeout = 0; SqlDataAdapter adapter = new SqlDataAdapter(commandText, conn); adapter.Fill(dtCounter); if (conn.State == ConnectionState.Open) { conn.Close(); } Dialog.WinFormsTouch.frmGenericSearch oSearch = new Dialog.WinFormsTouch.frmGenericSearch(dtCounter, drCounter = null, "Counter Search"); oSearch.ShowDialog(); drCounter = oSearch.SelectedDataRow; if (drCounter != null) { txtToCounter.Text = string.Empty; txtToCounter.Text = Convert.ToString(drCounter["CODE"]); } }
private void btnGSSSearch_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtCustAcc.Text.Trim())) { try { SqlConnection connection = new SqlConnection(); if (application != null) { connection = application.Settings.Database.Connection; } else { connection = ApplicationSettings.Database.LocalConnection; } string sQry = "SELECT GSSACCOUNTNO AS [GSSNumber] FROM GSSACCOUNTOPENINGPOSTED" + " WHERE GSSMATURED = 0 and CustAccount='" + txtCustAcc.Text.Trim() + "'"; // Changes on 01/05/2014 SqlCommand cmd = new SqlCommand(sQry, connection); cmd.CommandTimeout = 0; DataTable dtGSSNo = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dtGSSNo); if (dtGSSNo != null && dtGSSNo.Rows.Count > 0) { Dialog.WinFormsTouch.frmGenericSearch oSearch = new Dialog.WinFormsTouch.frmGenericSearch(dtGSSNo, drGSS, "GSS Number"); oSearch.ShowDialog(); drGSS = oSearch.SelectedDataRow; if (drGSS != null) { txtGSSNumber.Text = Convert.ToString(drGSS[0]); } } } catch (Exception ex) { } } else { MessageBox.Show("Please select customer account."); } }
private void btnSKUSearch_Click(object sender, EventArgs e) { try { if (PosApplication.Instance.TransactionServices.CheckConnection()) { ReadOnlyCollection <object> containerArray; string sStoreId = ApplicationSettings.Terminal.StoreId; containerArray = PosApplication.Instance.TransactionServices.InvokeExtension("GetSKUNumber"); dsSKU = new DataSet(); StringReader srTransDetail = new StringReader(Convert.ToString(containerArray[3])); if (Convert.ToString(containerArray[3]).Trim().Length > 38) { dsSKU.ReadXml(srTransDetail); } if (dsSKU != null && dsSKU.Tables[0].Rows.Count > 0) { Dialog.WinFormsTouch.frmGenericSearch Osearch = new Dialog.WinFormsTouch.frmGenericSearch(dsSKU.Tables[0], null, "SKU"); Osearch.ShowDialog(); DataRow dr = Osearch.SelectedDataRow; DataRow drSKU; if (dr != null) { txtSKUNo.Text = Convert.ToString(dr["itemid"]); drSKU = dtSelectedSKU.NewRow(); drSKU["STOREID"] = ApplicationSettings.Terminal.StoreId; drSKU["TWH"] = sInventLocationId; drSKU["SKUNumber"] = Convert.ToString(dr["itemid"]); dtSelectedSKU.Rows.Add(drSKU); dtSelectedSKU.AcceptChanges(); grItems.DataSource = dtSelectedSKU.DefaultView; } } } } catch (Exception ex) { } }
private void btnGTId_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(txtVendorAc.Text)) { MessageBox.Show("Select vendor"); return; } if (string.IsNullOrEmpty(sInventLocationId)) { MessageBox.Show("Select warehouse"); return; } try { if (PosApplication.Instance.TransactionServices.CheckConnection()) { ReadOnlyCollection <object> containerArray; containerArray = PosApplication.Instance.TransactionServices.InvokeExtension("GetGTIdFGTransfer", txtVendorAc.Text, sInventLocationId); DataSet dsGTId = new DataSet(); StringReader srTransDetail = new StringReader(Convert.ToString(containerArray[3])); if (Convert.ToString(containerArray[3]).Trim().Length > 38) { dsGTId.ReadXml(srTransDetail); } if (dsGTId != null && dsGTId.Tables[0].Rows.Count > 0) { Dialog.WinFormsTouch.frmGenericSearch Osearch = new Dialog.WinFormsTouch.frmGenericSearch(dsGTId.Tables[0], null, "Goods Transferred Id"); Osearch.ShowDialog(); DataRow dr = Osearch.SelectedDataRow; if (dr != null) { txtGTId.Text = Convert.ToString(dr["GTID"]); } } } } catch (Exception ex) { } }
private void btnSearchCustomer_Click(object sender, EventArgs e) // added on 01/05/2014 on req of S.Sharma { try { SqlConnection connection = new SqlConnection(); if (application != null) { connection = application.Settings.Database.Connection; } else { connection = ApplicationSettings.Database.LocalConnection; } string sQry = "SELECT distinct CUSTACCOUNT,CUSTNAME FROM GSSACCOUNTOPENINGPOSTED WHERE GSSMATURED = 0 and isnull(CUSTACCOUNT,'')<>''"; SqlCommand cmd = new SqlCommand(sQry, connection); cmd.CommandTimeout = 0; DataTable dtGSSCust = new DataTable(); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(dtGSSCust); if (dtGSSCust != null && dtGSSCust.Rows.Count > 0) { Dialog.WinFormsTouch.frmGenericSearch oSearch = new Dialog.WinFormsTouch.frmGenericSearch(dtGSSCust, drGSSCust, "Customer Search"); oSearch.ShowDialog(); drGSSCust = oSearch.SelectedDataRow; if (drGSSCust != null) { txtCustAcc.Text = Convert.ToString(drGSSCust[0]); txtCustName.Text = Convert.ToString(drGSSCust[1]); } } } catch (Exception ex) { } }
private void btnGSSNo_Click(object sender, EventArgs e) { if (dtGoldSS != null && dtGoldSS.Rows.Count > 0) { Dialog.WinFormsTouch.frmGenericSearch oSearch = new Dialog.WinFormsTouch.frmGenericSearch(dtGoldSS, drGoldSS, "GSS Number"); oSearch.ShowDialog(); drGoldSS = oSearch.SelectedDataRow; if (drGoldSS != null) { txtGSSNo.Text = string.Empty; txtGSSNo.Text = Convert.ToString(drGoldSS["GSSACCOUNTNO."]); txtGSSNo.ReadOnly = true; if (Convert.ToString(drGoldSS["SCHEMETYPE"]).ToUpper().Trim() == "FIXED") { txtAmount.Text = !string.IsNullOrEmpty(txtAmount.Text) ? txtAmount.Text : string.Empty; txtMonths.Text = string.Empty; txtMonths.Enabled = true; txtAmount.ReadOnly = true; } else { txtAmount.Text = !string.IsNullOrEmpty(txtAmount.Text) ? txtAmount.Text : string.Empty; txtMonths.Text = string.Empty; txtMonths.Enabled = false; txtAmount.ReadOnly = false; } if (drGoldSS["DEPOSITTYPE"].ToString().ToUpper().Trim() == "GOLD") { GoldFixing = true; } } } else { LSRetailPosis.POSControls.POSFormsManager.ShowPOSMessageDialog(999990); } }
public DataRow AmountToBeAdjusted(string custAccount, bool isTranIdExists = false, string custaccount = null, string ordernum = null) { string TransID = string.Empty; #region Multiple Adjustment if (custaccount != null && ordernum != null) { BlankOperations oBlank = new BlankOperations(); DataTable dt = oBlank.CustomerAdvanceData(custAccount); RetailTransaction retailTrans = pos as RetailTransaction; string order = Convert.ToString(retailTrans.PartnerData.AdjustmentOrderNum); string cust = Convert.ToString(retailTrans.PartnerData.AdjustmentCustAccount); DataRow drReturn = null; foreach (DataRow drNew in dt.Select("ORDERNUM='" + order + "' AND CustomerAccount='" + cust + "' AND ISADJUSTED=0")) { if (string.IsNullOrEmpty(TransID)) { TransID = "'" + Convert.ToString(drNew["TransactionID"]) + "'"; } else { TransID += ",'" + Convert.ToString(drNew["TransactionID"]) + "'"; } drNew["ISADJUSTED"] = 1; drReturn = drNew; break; } return(drReturn); } #endregion #region Single Adjustment else { System.Collections.Generic.LinkedList <LSRetailPosis.Transaction.Line.SaleItem.SaleLineItem> saleline = new System.Collections.Generic.LinkedList <LSRetailPosis.Transaction.Line.SaleItem.SaleLineItem>(((LSRetailPosis.Transaction.RetailTransaction)(pos)).SaleItems); if (isTranIdExists) { foreach (var sale in saleline) { if (sale.ItemType == LSRetailPosis.Transaction.Line.SaleItem.SaleLineItem.ItemTypes.Service && !sale.Voided) { if (string.IsNullOrEmpty(TransID)) { TransID = "'" + sale.PartnerData.ServiceItemCashAdjustmentTransactionID + "'"; } else { TransID += ",'" + sale.PartnerData.ServiceItemCashAdjustmentTransactionID + "'"; } } } } SqlConnection SqlCon = new SqlConnection(ApplicationSettings.Database.LocalConnectionString); SqlCon.Open(); // Create a Command SqlCommand SqlComm = new SqlCommand(); SqlComm.Connection = SqlCon; SqlComm.CommandType = CommandType.Text; DataRow drSelected = null; #region Commented qUERY //SqlComm.CommandText = " SELECT RETAILTRANSACTIONTABLE.TRANSACTIONID AS [Transaction ID], RETAILTRANSACTIONTABLE.CUSTACCOUNT AS [Customer Account], " + // " DIRPARTYTABLE.NAMEALIAS AS [Customer Name], CAST(SUM(RETAILTRANSACTIONPAYMENTTRANS.AMOUNTCUR) AS NUMERIC(28,3)) AS [Total Amount] " + // " FROM DIRPARTYTABLE INNER JOIN CUSTTABLE ON DIRPARTYTABLE.RECID = CUSTTABLE.PARTY INNER JOIN " + // " RETAILTRANSACTIONTABLE INNER JOIN RETAILTRANSACTIONPAYMENTTRANS ON RETAILTRANSACTIONTABLE.TRANSACTIONID = RETAILTRANSACTIONPAYMENTTRANS.TRANSACTIONID ON " + // " CUSTTABLE.ACCOUNTNUM = RETAILTRANSACTIONTABLE.CUSTACCOUNT WHERE (RETAILTRANSACTIONTABLE.CUSTACCOUNT = '" + custAccount + "') " + // " AND (RETAILTRANSACTIONPAYMENTTRANS.isAdjusted = 0) AND (RETAILTRANSACTIONTABLE.[TYPE] = 3) "; //if (isTranIdExists && !string.IsNullOrEmpty(TransID)) //{ // SqlComm.CommandText += " AND (RETAILTRANSACTIONPAYMENTTRANS.TRANSACTIONID NOT IN (" + TransID + ")) "; //} //SqlComm.CommandText += " GROUP BY RETAILTRANSACTIONTABLE.TRANSACTIONID, RETAILTRANSACTIONTABLE.CUSTACCOUNT,DIRPARTYTABLE.NAMEALIAS "; #endregion ////SqlComm.CommandText = " SELECT RETAILADJUSTMENTTABLE.TRANSACTIONID AS [TransactionID], " + //// " RETAILADJUSTMENTTABLE.CUSTACCOUNT AS [CustomerAccount], " + //// " DIRPARTYTABLE.NAMEALIAS AS [CustomerName], " + //// //" CAST(RETAILADJUSTMENTTABLE.AMOUNT AS NUMERIC(28,3)) AS [TotalAmount] " + //// " CAST(RETAILADJUSTMENTTABLE.AMOUNT AS NUMERIC(28,2)) AS [TotalAmount],ISNULL(GOLDFIXING,0) AS GoldFixing,(CASE WHEN GOLDFIXING = 0 THEN 0 ELSE CAST(ISNULL(GOLDQUANTITY,0) AS NUMERIC(28,3)) END) AS GoldQty " + // Avg Gold Rate Adjustment //// " ,ISNULL(RETAILADJUSTMENTTABLE.RETAILSTOREID,'') AS RETAILSTOREID,ISNULL(RETAILADJUSTMENTTABLE.RETAILTERMINALID,'') AS RETAILTERMINALID" + //// " FROM DIRPARTYTABLE INNER JOIN " + //// " CUSTTABLE ON DIRPARTYTABLE.RECID = CUSTTABLE.PARTY INNER JOIN " + //// " RETAILADJUSTMENTTABLE ON CUSTTABLE.ACCOUNTNUM = RETAILADJUSTMENTTABLE.CUSTACCOUNT " + //// " WHERE (RETAILADJUSTMENTTABLE.ISADJUSTED = 0) AND (RETAILADJUSTMENTTABLE.RETAILDEPOSITTYPE = 1) " + //// " AND (RETAILADJUSTMENTTABLE.CUSTACCOUNT = '" + custAccount + "') "; try { if (PosApplication.Instance.TransactionServices.CheckConnection()) { ReadOnlyCollection <object> containerArray; string sStoreId = ApplicationSettings.Terminal.StoreId; containerArray = PosApplication.Instance.TransactionServices.InvokeExtension("getUnadjustedAdvance", custAccount); DataSet dsWH = new DataSet(); StringReader srTransDetail = new StringReader(Convert.ToString(containerArray[3])); if (Convert.ToString(containerArray[3]).Trim().Length > 38) { dsWH.ReadXml(srTransDetail); } if (dsWH != null && dsWH.Tables[0].Rows.Count > 0) { Dialog.WinFormsTouch.frmGenericSearch OSearch = new Dialog.WinFormsTouch.frmGenericSearch(dsWH.Tables[0], drSelected, "Advance Adjustment"); OSearch.ShowDialog(); drSelected = OSearch.SelectedDataRow; } else { using (LSRetailPosis.POSProcesses.frmMessage dialog = new LSRetailPosis.POSProcesses.frmMessage("No Active Deposit found for the selected customer.", MessageBoxButtons.OK, MessageBoxIcon.Error)) { LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog); } } } } catch (Exception ex) { } return(drSelected); //DataRow drSelected = null; //DataTable AdjustmentDT = new DataTable(); //SqlDataAdapter SqlDa = new SqlDataAdapter(SqlComm); //SqlDa.Fill(AdjustmentDT); //if (AdjustmentDT != null && AdjustmentDT.Rows.Count > 0) //{ // Dialog.WinFormsTouch.frmGenericSearch OSearch = new Dialog.WinFormsTouch.frmGenericSearch(AdjustmentDT, drSelected, "Advance Adjustment"); // OSearch.ShowDialog(); // drSelected = OSearch.SelectedDataRow; // return drSelected; //} //else //{ // using (LSRetailPosis.POSProcesses.frmMessage dialog = new LSRetailPosis.POSProcesses.frmMessage("No Active Deposit found for the selected customer.", MessageBoxButtons.OK, MessageBoxIcon.Error)) // { // LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSForm(dialog); // } // return null; //} } #endregion }
/// <summary> /// DEV BY RIPAN HOSSAIN ON 06032013 -- pos skuproduct(item) search here /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnPOSItemSearch_Click(object sender, EventArgs e) { DataTable dtProduct = new DataTable(); DataRow drProduct = null; SqlConnection conn = new SqlConnection(); conn = application.Settings.Database.Connection; if (conn.State == ConnectionState.Closed) { conn.Open(); } string commandText = string.Empty; if (cmbTransferType.Text.ToUpper().Trim() == "STOCKIN") { commandText = "SELECT CAST(SKUNUMBER AS NVARCHAR (30)) AS SKUNUMBER,CAST(CAST(QTY AS NUMERIC(28,3)) AS NVARCHAR (50)) AS QTY" + " FROM SKUTable_Posted WHERE SKUNUMBER NOT IN (SELECT SKUNUMBER FROM SKUTableTrans) UNION " + " SELECT CAST(SKUNUMBER AS NVARCHAR (30)) AS SKUNUMBER,CAST(CAST(QTY AS NUMERIC(28,3)) AS NVARCHAR (50)) AS QTY" + " FROM SKUTableTrans WHERE ISAVAILABLE=0" ; } else if (cmbTransferType.Text.ToUpper().Trim() == "INTER") { if (string.IsNullOrEmpty(txtFromCounter.Text)) { MessageBox.Show("Please select From Counter"); return; } else { commandText = "SELECT CAST(SKUNUMBER AS NVARCHAR (30)) AS SKUNUMBER, CAST(CAST(QTY AS NUMERIC(28,3)) AS NVARCHAR (50)) AS QTY FROM SKUTableTrans WHERE ISAVAILABLE=1 AND TOCOUNTER = '" + txtFromCounter.Text + "'"; } } else { commandText = "SELECT CAST(SKUNUMBER AS NVARCHAR (30)) AS SKUNUMBER, CAST(CAST(QTY AS NUMERIC(28,3)) AS NVARCHAR (50)) AS QTY FROM SKUTableTrans WHERE ISAVAILABLE=1"; } SqlCommand command = new SqlCommand(commandText, conn); command.CommandTimeout = 0; SqlDataAdapter adapter = new SqlDataAdapter(commandText, conn); adapter.Fill(dtProduct); if (conn.State == ConnectionState.Open) { conn.Close(); } Dialog.WinFormsTouch.frmGenericSearch oSearch = new Dialog.WinFormsTouch.frmGenericSearch(dtProduct, drProduct = null, "Product Search"); oSearch.ShowDialog(); drProduct = oSearch.SelectedDataRow; if (drProduct != null) { txtItemId.Text = string.Empty; txtItemId.Text = Convert.ToString(drProduct["SKUNUMBER"]); getSkuDetails(Convert.ToString(txtItemId.Text)); } }