private void PrintShift() { string strSQL; DataSet _ds; _ds = new DataSet(); ACMS.ACMSBranch.BranchTransaction.rptShiftSettlement myRpt = new ACMS.ACMSBranch.BranchTransaction.rptShiftSettlement(); strSQL = "select * from sv_shift_settlement where nTerminalID=" + TerminalId + " and strBranchCode='" + BranchCode + "' and nShiftID='" + ShiftID + "' and convert(varchar,dtDate,111)= '" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.DataSource = _ds.Tables["table"]; myRpt.fBranch.DataBindings.Add("Text", _ds.Tables["table"], "strBranchName"); myRpt.fPaymentMode.DataBindings.Add("Text", _ds.Tables["table"], "Payment Mode"); myRpt.fAmount.DataBindings.Add("Text", _ds.Tables["table"], "Amount", "{0:$0.00}"); myRpt.fClosingStaff.DataBindings.Add("Text", _ds.Tables["table"], "close_shift_name"); myRpt.fVerifyStaff.DataBindings.Add("Text", _ds.Tables["table"], "verify_name"); myRpt.fDate.DataBindings.Add("Text", _ds.Tables["table"], "dtDate", "{0:dd-MM-yyyy}"); myRpt.fTime.DataBindings.Add("Text", _ds.Tables["table"], "dtCloseTime", "{0:hh:mm tt}"); myRpt.fTitle.DataBindings.Add("Text", _ds.Tables["table"], "SHIFT_DESC"); DataSet _ds1, _ds2; _ds1 = new DataSet(); _ds2 = new DataSet(); strSQL = "Select isnull(nQuantity,0) as nQuantity from tblProductInventory Where strBranchCode = '" + BranchCode + "' and strProductCode = 'MW' "; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds1, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fMWBalance.DataBindings.Add("Text", _ds1.Tables["table"], "nQuantity", "{0:0}"); if (_ds1.Tables[0].Rows.Count == 0) { strSQL = "Select 0 as nQuantity"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds1, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); } strSQL = "select Count(*) as CountLock from tblLocker Where nStatusID = 0 And strBranchCode = '" + BranchCode + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds2, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fLCKBalance.DataBindings.Add("Text", _ds2.Tables["table"], "CountLock", "{0:0}"); myRpt.Print(); }
private void PrintShift() { string strSQL; DataSet _ds; _ds = new DataSet(); ACMS.ACMSBranch.BranchTransaction.rptShiftSettlement myRpt = new ACMS.ACMSBranch.BranchTransaction.rptShiftSettlement(); strSQL = "select * from sv_shift_settlement where nTerminalID=" + TerminalId + " and strBranchCode='" + BranchCode + "' and nShiftID='" + ShiftID + "' and convert(varchar,dtDate,111)= '" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.DataSource = _ds.Tables["table"]; myRpt.fBranch.DataBindings.Add("Text", _ds.Tables["table"], "strBranchName"); myRpt.fPaymentMode.DataBindings.Add("Text", _ds.Tables["table"], "Payment Mode"); myRpt.fAmount.DataBindings.Add("Text", _ds.Tables["table"], "Amount", "{0:$0.00}"); myRpt.fClosingStaff.DataBindings.Add("Text", _ds.Tables["table"], "close_shift_name"); myRpt.fVerifyStaff.DataBindings.Add("Text", _ds.Tables["table"], "verify_name"); myRpt.fDate.DataBindings.Add("Text", _ds.Tables["table"], "dtDate", "{0:dd-MM-yyyy}"); myRpt.fTime.DataBindings.Add("Text", _ds.Tables["table"], "dtCloseTime", "{0:hh:mm tt}"); myRpt.fTitle.DataBindings.Add("Text", _ds.Tables["table"], "SHIFT_DESC"); //myRpt.fTotTrans.DataBindings.Add("Text", _ds.Tables["table"], "total_receipt"); myRpt.fTotTrans.Text = _ds.Tables["table"].Compute("SUM(total_receipt)", "").ToString(); DataSet _ds3; _ds3 = new DataSet(); strSQL = "SELECT ISNULL(SUM(dbo.tblReceiptPayment.mAmount) ,0) AS void_amt, COUNT(dbo.tblReceiptPayment.mAmount) AS total_void " + "FROM dbo.tblShift LEFT OUTER JOIN " + "dbo.tblReceipt ON dbo.tblReceipt.nShiftID = dbo.tblShift.nShiftID AND CONVERT(varchar, dbo.tblReceipt.dtDate, 103) = CONVERT(varchar, dbo.tblShift.dtDate, 103) AND " + "dbo.tblReceipt.nTerminalID = dbo.tblShift.nTerminalID AND dbo.tblReceipt.strBranchCode = dbo.tblShift.strBranchCode LEFT OUTER JOIN " + "dbo.tblReceiptPayment ON dbo.tblReceiptPayment.strReceiptNo = dbo.tblReceipt.strReceiptNo " + "WHERE (dbo.tblReceipt.fVoid = 1) " + "and dbo.tblShift.strBranchCode='" + BranchCode + "' and dbo.tblShift.nShiftID=" + ShiftID + " and convert(varchar,dbo.tblShift.dtDate,111)= '" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "' AND dbo.tblShift.nTerminalID = " + TerminalId; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds3, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fVoidAmt.Text = String.Format("{0:$0.00}", _ds3.Tables["table"].Rows[0]["void_amt"]); myRpt.fNoVoid.Text = _ds3.Tables["table"].Rows[0]["total_void"].ToString(); _ds3.Dispose(); _ds3 = new DataSet(); strSQL = "SELECT dbo.GetBranchDiscount('" + BranchCode + "'," + ShiftID + ",'" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "'," + TerminalId + ") AS total_discount"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds3, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fTotDisc.Text = String.Format("{0:$0.00}", _ds3.Tables["table"].Rows[0]["total_discount"]); _ds3.Dispose(); _ds3 = new DataSet(); strSQL = "select * from sv_shift_settlement_freebie where nTerminalID='" + TerminalId + "' and strBranchCode='" + BranchCode + "' and nShiftID='" + ShiftID + "' and convert(varchar,dtDate,111)='" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds3, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fFreebie.Text = "FREEBIES GIVEN:"; foreach (DataRow dr2 in _ds3.Tables["Table"].Rows) { myRpt.fFreebie.Text += "\n" + dr2["strDescription"].ToString(); myRpt.fFreebieQty.Text += "\n" + dr2["qty"].ToString(); } DataSet _ds1, _ds2; _ds1 = new DataSet(); _ds2 = new DataSet(); //strSQL = "Select isnull(nQuantity,0) as nQuantity from tblProductInventory Where strBranchCode = '" + BranchCode + "' and strProductCode = 'MW' "; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "dw_sp_SCStockReconItem", _ds1, new string[] { "Table" }, new SqlParameter("@BranchCode", BranchCode), new SqlParameter("@strProductCode", "MW")); //SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds1, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fMWBalance.DataBindings.Add("Text", _ds1.Tables["Table"], "nQty", "{0:0}"); if (_ds1.Tables[0].Rows.Count == 0) { strSQL = "Select 0 as nQuantity"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds1, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); } strSQL = "select Count(*) as CountLock from tblLocker Where nStatusID = 0 And strBranchCode = '" + BranchCode + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds2, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fLCKBalance.DataBindings.Add("Text", _ds2.Tables["table"], "CountLock", "{0:0}"); myRpt.Print(); }
private void PrintShift() { string strSQL; DataSet _ds; _ds = new DataSet(); ACMS.ACMSBranch.BranchTransaction.rptShiftSettlement myRpt = new ACMS.ACMSBranch.BranchTransaction.rptShiftSettlement(); strSQL = "select * from sv_shift_settlement where nTerminalID=" + TerminalId + " and strBranchCode='" + BranchCode + "' and nShiftID='" + ShiftID + "' and convert(varchar,dtDate,111)= '" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.DataSource = _ds.Tables["table"]; myRpt.fBranch.DataBindings.Add("Text", _ds.Tables["table"], "strBranchName"); myRpt.fPaymentMode.DataBindings.Add("Text", _ds.Tables["table"], "Payment Mode"); myRpt.fAmount.DataBindings.Add("Text", _ds.Tables["table"], "Amount", "{0:$0.00}"); myRpt.fClosingStaff.DataBindings.Add("Text", _ds.Tables["table"], "close_shift_name"); myRpt.fVerifyStaff.DataBindings.Add("Text", _ds.Tables["table"], "verify_name"); myRpt.fDate.DataBindings.Add("Text", _ds.Tables["table"], "dtDate", "{0:dd-MM-yyyy}"); myRpt.fTime.DataBindings.Add("Text", _ds.Tables["table"], "dtCloseTime", "{0:hh:mm tt}"); myRpt.fTitle.DataBindings.Add("Text", _ds.Tables["table"], "SHIFT_DESC"); //myRpt.fTotTrans.DataBindings.Add("Text", _ds.Tables["table"], "total_receipt"); myRpt.fTotTrans.Text = _ds.Tables["table"].Compute("SUM(total_receipt)", "").ToString(); DataSet _ds3; _ds3 = new DataSet(); strSQL = "SELECT ISNULL(SUM(dbo.tblReceiptPayment.mAmount) ,0) AS void_amt, COUNT(dbo.tblReceiptPayment.mAmount) AS total_void " + "FROM dbo.tblShift LEFT OUTER JOIN " + "dbo.tblReceipt ON dbo.tblReceipt.nShiftID = dbo.tblShift.nShiftID AND CONVERT(varchar, dbo.tblReceipt.dtDate, 103) = CONVERT(varchar, dbo.tblShift.dtDate, 103) AND " + "dbo.tblReceipt.nTerminalID = dbo.tblShift.nTerminalID AND dbo.tblReceipt.strBranchCode = dbo.tblShift.strBranchCode LEFT OUTER JOIN " + "dbo.tblReceiptPayment ON dbo.tblReceiptPayment.strReceiptNo = dbo.tblReceipt.strReceiptNo " + "WHERE (dbo.tblReceipt.fVoid = 1) " + "and dbo.tblShift.strBranchCode='" + BranchCode + "' and dbo.tblShift.nShiftID=" + ShiftID + " and convert(varchar,dbo.tblShift.dtDate,111)= '" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "' AND dbo.tblShift.nTerminalID = " + TerminalId; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds3, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fVoidAmt.Text = String.Format("{0:$0.00}", _ds3.Tables["table"].Rows[0]["void_amt"]); myRpt.fNoVoid.Text = _ds3.Tables["table"].Rows[0]["total_void"].ToString(); _ds3.Dispose(); _ds3 = new DataSet(); strSQL = "SELECT dbo.GetBranchDiscount('" + BranchCode + "'," + ShiftID + ",'" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "'," + TerminalId + ") AS total_discount"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds3, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fTotDisc.Text = String.Format("{0:$0.00}", _ds3.Tables["table"].Rows[0]["total_discount"]); _ds3.Dispose(); _ds3 = new DataSet(); strSQL = "select * from sv_shift_settlement_freebie where nTerminalID='" + TerminalId + "' and strBranchCode='" + BranchCode + "' and nShiftID='" + ShiftID + "' and convert(varchar,dtDate,111)='" + string.Format("{0:yyyy/MM/dd}", Convert.ToDateTime(ShiftDate)) + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds3, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fFreebie.Text = "FREEBIES GIVEN:"; foreach (DataRow dr2 in _ds3.Tables["Table"].Rows) { myRpt.fFreebie.Text += "\n" + dr2["strDescription"].ToString(); myRpt.fFreebieQty.Text += "\n" + dr2["qty"].ToString(); } DataSet _ds1, _ds2; _ds1 = new DataSet(); _ds2 = new DataSet(); //strSQL = "Select isnull(nQuantity,0) as nQuantity from tblProductInventory Where strBranchCode = '" + BranchCode + "' and strProductCode = 'MW' "; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "dw_sp_SCStockReconItem", _ds1, new string[] { "Table" }, new SqlParameter("@BranchCode", BranchCode), new SqlParameter("@strProductCode", "MW")); //SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds1, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fMWBalance.DataBindings.Add("Text", _ds1.Tables["Table"], "nQty", "{0:0}"); if (_ds1.Tables[0].Rows.Count == 0) { strSQL = "Select 0 as nQuantity"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds1, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); } strSQL = "select Count(*) as CountLock from tblLocker Where nStatusID = 0 And strBranchCode = '" + BranchCode + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA", _ds2, new string[] { "Table" }, new SqlParameter("@strSQL", strSQL)); myRpt.fLCKBalance.DataBindings.Add("Text", _ds2.Tables["table"], "CountLock", "{0:0}"); myRpt.Print(); }
private void PrintShift() { string strSQL; DataSet _ds; _ds = new DataSet(); ACMS.ACMSBranch.BranchTransaction.rptShiftSettlement myRpt = new ACMS.ACMSBranch.BranchTransaction.rptShiftSettlement(); strSQL = "select * from sv_shift_settlement where nTerminalID=" + TerminalId + " and strBranchCode='" + BranchCode + "' and nShiftID='" + ShiftID + "' and convert(varchar,dtDate,111)= '" + string.Format("{0:yyyy/MM/dd}",Convert.ToDateTime(ShiftDate)) + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA",_ds,new string[] {"Table"}, new SqlParameter("@strSQL", strSQL) ); myRpt.DataSource = _ds.Tables["table"]; myRpt.fBranch.DataBindings.Add("Text",_ds.Tables["table"],"strBranchName"); myRpt.fPaymentMode.DataBindings.Add("Text",_ds.Tables["table"],"Payment Mode"); myRpt.fAmount.DataBindings.Add("Text",_ds.Tables["table"],"Amount","{0:$0.00}"); myRpt.fClosingStaff.DataBindings.Add("Text",_ds.Tables["table"],"close_shift_name"); myRpt.fVerifyStaff.DataBindings.Add("Text",_ds.Tables["table"],"verify_name"); myRpt.fDate.DataBindings.Add("Text",_ds.Tables["table"],"dtDate","{0:dd-MM-yyyy}"); myRpt.fTime.DataBindings.Add("Text",_ds.Tables["table"],"dtCloseTime","{0:hh:mm tt}"); myRpt.fTitle.DataBindings.Add("Text",_ds.Tables["table"],"SHIFT_DESC"); DataSet _ds1,_ds2; _ds1 = new DataSet(); _ds2 = new DataSet(); strSQL = "Select isnull(nQuantity,0) as nQuantity from tblProductInventory Where strBranchCode = '" + BranchCode + "' and strProductCode = 'MW' "; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA",_ds1,new string[] {"Table"}, new SqlParameter("@strSQL", strSQL) ); myRpt.fMWBalance.DataBindings.Add("Text",_ds1.Tables["table"],"nQuantity","{0:0}"); if(_ds1.Tables[0].Rows.Count==0) { strSQL = "Select 0 as nQuantity"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA",_ds1,new string[] {"Table"}, new SqlParameter("@strSQL", strSQL) ); } strSQL = "select Count(*) as CountLock from tblLocker Where nStatusID = 0 And strBranchCode = '" + BranchCode + "'"; SqlHelper.FillDataset(connection, CommandType.StoredProcedure, "UP_GETDATA",_ds2,new string[] {"Table"}, new SqlParameter("@strSQL", strSQL) ); myRpt.fLCKBalance.DataBindings.Add("Text",_ds2.Tables["table"],"CountLock","{0:0}"); myRpt.Print(); }