public Boolean InsertIndentGeneralHeaderAndDetail(indentgeneralheader igh, List <indentgeneraldetail> IGDetail) { Boolean status = true; string utString = ""; string updateSQL = ""; try { igh.TemporaryNo = DocumentNumberDB.getNumber(igh.DocumentID, 1); if (igh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + igh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + igh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into IndentGeneralHeader " + "(DocumentID,TemporaryNo,TemporaryDate,DocumentNo,DocumentDate,ReferenceNo,CurrencyID," + "ExchangeRate,ProductValue,ProductValueINR,TargetDate,PurchaseSource," + "Status,DocumentStatus,CreateTime,CreateUser, CommentStatus,Comments,ForwarderList)" + " values (" + "'" + igh.DocumentID + "'," + igh.TemporaryNo + "," + "'" + igh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + igh.DocumentNo + "," + "'" + igh.DocumentDate.ToString("yyyy-MM-dd") + "'," + "'" + igh.ReferenceNo + "'," + "'" + igh.CurrencyID + "'," + igh.ExchangeRate + "," + igh.ProductValue + "," + igh.ProductValueINR + "," + "'" + igh.TargetDate.ToString("yyyy-MM-dd") + "'," + "'" + igh.PurchaseSource + "'," + igh.Status + "," + igh.DocumentStatus + "," + "GETDATE()" + "," + "'" + Login.userLoggedIn + "'," + "'" + igh.CommentStatus + "'," + "'" + igh.Comments + "'," + "'" + igh.ForwarderList + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "IndentGeneralHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from IndentGeneralDetail where DocumentID='" + igh.DocumentID + "'" + " and TemporaryNo=" + igh.TemporaryNo + " and TemporaryDate='" + igh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "IndentGeneralDetail", "", updateSQL) + Main.QueryDelimiter; foreach (indentgeneraldetail igd in IGDetail) { updateSQL = "insert into IndentGeneralDetail " + "(DocumentID,TemporaryNo,TemporaryDate,ItemDetail,Quantity,ExpectedPurchasePrice,WarrantyDays) " + "values ('" + igd.DocumentID + "'," + igh.TemporaryNo + "," + "'" + igd.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + igd.ItemDetail + "'," + igd.Quantity + "," + igd.ExpectedPurchasePrice + " ," + igd.WarrantyDays + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "IndentGeneralDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertAccHeaderAndDetail(AccountOBheader newacc, List <AccountOBdetail> AccDetail) { Boolean status = true; string utString = ""; string updateSQL = ""; try { newacc.DocumentNo = DocumentNumberDB.getNumber(newacc.DocumentID, 1); if (newacc.DocumentNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + newacc.DocumentNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + newacc.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into AccountOBHeader " + " (DocumentID,FYID,DocumentDate,DocumentNo," + "CreateUser,CreateTime)" + "values (" + "'" + newacc.DocumentID + "','" + newacc.FYID + "'," + "'" + newacc.DocumentDate.ToString("yyyy-MM-dd") + "'," + "'" + newacc.DocumentNo + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE())"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "AccountOBHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from AccountOBDetail where DocumentID='" + newacc.DocumentID + "'" + " and DocumentNo=" + newacc.DocumentNo + " and DocumentDate='" + newacc.DocumentDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "AccountOBDetail", "", updateSQL) + Main.QueryDelimiter; foreach (AccountOBdetail acc in AccDetail) { updateSQL = "insert into AccountOBDetail " + "(DocumentID,DocumentNo,DocumentDate,SerialNo,AccountCode,BalanceDebit,BalanceCredit,FYID) " + "values ('" + acc.DocumentID + "'," + newacc.DocumentNo + "," + "'" + acc.DocumentDate.ToString("yyyy-MM-dd") + "'," + "'" + acc.SerialNo + "'," + acc.AccountCode + "," + "'" + acc.BalanceDebit + "'," + "'" + acc.BalanceCredit + "','" + acc.FYID + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "AccountOBDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertSHHeaderAndDetail(stockholdingheader shh, List <stockholdingdetail> StockHoldingHeaderDetails) { Boolean status = true; string utString = ""; string updateSQL = ""; try { shh.TemporaryNo = DocumentNumberDB.getNumber(shh.DocumentID, 1); if (shh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + shh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + shh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into StockHoldingHeader " + "(DocumentID,TemporaryNo,TemporaryDate,DocumentNo,DocumentDate," + "StoreLocationID,Remarks,Comments,CommentStatus,CreateUser," + "CreateTime,ForwarderList,Status,DocumentStatus)" + " values (" + "'" + shh.DocumentID + "'," + shh.TemporaryNo + "," + "'" + shh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + shh.DocumentNo + "," + "'" + shh.DocumentDate.ToString("yyyy-MM-dd") + "'," + "'" + shh.StoreLocationID + "'," + "'" + shh.Remarks + "'," + "'" + shh.Comments + "'," + "'" + shh.CommentStatus + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + "," + "'" + shh.ForwarderList + "'," + +shh.Status + "," + +shh.DocumentStatus + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "StockHoldingHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from StockHoldingDetail where DocumentID='" + shh.DocumentID + "'" + " and TemporaryNo=" + shh.TemporaryNo + " and TemporaryDate='" + shh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "StockHoldingDetail", "", updateSQL) + Main.QueryDelimiter; foreach (stockholdingdetail shd in StockHoldingHeaderDetails) { updateSQL = "insert into StockHoldingDetail " + "(DocumentID,TemporaryNo,TemporaryDate,StockItemID,ModelNo,Quantity,InwardDocumentID,InwardDocumentNo,InwardDocumentdate,StockReferenceNo) " + "values ('" + shd.DocumentID + "'," + shh.TemporaryNo + "," + "'" + shd.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + shd.StockItemID + "'," + "'" + shd.ModelNo + "'," + shd.Quantity + "," + "'" + shd.InwardDocumentID + "'," + shd.InwardDocumentNo + "," + "'" + shd.InwardDocumentDate.ToString("yyyy-MM-dd") + "'," + shd.StockReferenceNo + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "StockHoldingDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertCreditHeaderAndDetail(CreditNoteHeader cnh, List <CreditNoteDetail> CNDetails) { Boolean status = true; string utString = ""; string updateSQL = ""; try { cnh.TemporaryNo = DocumentNumberDB.getNumber(cnh.DocumentID, 1); if (cnh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + cnh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + cnh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into CreditNoteHeader " + "(DocumentID,TemporaryNo,TemporaryDate,CreditNoteNo,CreditNoteDate,AccountCredit,AmountCredit,SLCode,SLType, RefNo, RefDate,Narration," + "Comments,CommentStatus,CreateUser,CreateTime,ForwarderList,DocumentStatus,Status)" + " values (" + "'" + cnh.DocumentID + "'," + cnh.TemporaryNo + "," + "'" + cnh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + cnh.CreditNoteNo + "," + "'" + cnh.CreditNoteDate.ToString("yyyy-MM-dd") + "'," + "'" + cnh.AccountCredit + "'," + cnh.AmountCredit + "," + "'" + cnh.SLCode + "'," + "'" + cnh.SLType + "'," + "'" + cnh.ReferenceNo + "'," + "'" + cnh.ReferenceDate + "'," + "'" + cnh.Narration + "'," + "'" + cnh.Comments + "'," + "'" + cnh.CommentStatus + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + "," + "'" + cnh.ForwarderList + "'," + cnh.DocumentStatus + "," + cnh.status + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "CreditNoteHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from CreditNoteDetail where DocumentID='" + cnh.DocumentID + "'" + " and TemporaryNo=" + cnh.TemporaryNo + " and TemporaryDate='" + cnh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "CreditNoteDetail", "", updateSQL) + Main.QueryDelimiter; foreach (CreditNoteDetail cnd in CNDetails) { updateSQL = "insert into CreditNoteDetail " + "(DocumentID,TemporaryNo,TemporaryDate,AccountDebit,AmountDebit) " + "values ('" + cnd.DocumentID + "'," + cnh.TemporaryNo + "," + "'" + cnd.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + cnd.AccountDebit + "'," + cnd.AmountDebit + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "CreditNoteDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertRVHeaderAndDetail(ReceiptVoucherHeader rvh, List <ReceiptVoucherDetail> RVDetails, List <invoiceoutreceipts> receiveList) { Boolean status = true; string utString = ""; string updateSQL = ""; try { rvh.TemporaryNo = DocumentNumberDB.getNumber(rvh.DocumentID, 1); if (rvh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + rvh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + rvh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into ReceiptVoucherHeader " + "(DocumentID,CreationMode,ProjectID,OfficeID,TemporaryNo,TemporaryDate,VoucherNo,VoucherDate,VoucherType,BookType," + "BillDetails,SLType,SLCode,BankTransactionMode,CurrencyID,ExchangeRate," + "VoucherAmount,VoucherAmountINR,Narration," + "Comments,CommentStatus,CreateUser,CreateTime,ForwarderList,DocumentStatus,Status)" + " values (" + "'" + rvh.DocumentID + "'," + "1," + "'" + rvh.ProjectID + "'," + "'" + rvh.OfficeID + "'," + rvh.TemporaryNo + "," + "'" + rvh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + rvh.VoucherNo + "," + "'" + rvh.VoucherDate.ToString("yyyy-MM-dd") + "'," + "'" + rvh.VoucherType + "'," + "'" + rvh.BookType + "'," + "'" + rvh.BillDetails + "'," + "'" + rvh.SLType + "'," + "'" + rvh.SLCode + "'," + "'" + rvh.BankTransactionMode + "'," + "'" + rvh.CurrencyID + "'," + rvh.ExchangeRate + "," + rvh.VoucherAmount + "," + rvh.VoucherAmountINR + "," + "'" + rvh.Narration + "'," + "'" + rvh.Comments + "'," + "'" + rvh.CommentStatus + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + "," + "'" + rvh.ForwarderList + "'," + rvh.DocumentStatus + "," + rvh.status + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "ReceiptVoucherHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from ReceiptVoucherDetail where DocumentID='" + rvh.DocumentID + "'" + " and TemporaryNo=" + rvh.TemporaryNo + " and TemporaryDate='" + rvh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "ReceiptVoucherDetail", "", updateSQL) + Main.QueryDelimiter; foreach (ReceiptVoucherDetail rvd in RVDetails) { updateSQL = "insert into ReceiptVoucherDetail " + "(DocumentID,TemporaryNo,TemporaryDate,AccountCode,AmountDebit,AmountDebitINR,AmountCredit," + "AmountCreditINR,ChequeNo,ChequeDate) " + "values ('" + rvh.DocumentID + "'," + rvh.TemporaryNo + "," + "'" + rvh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + rvd.AccountCode + "'," + rvd.AmountDebit + "," + rvd.AmountDebitINR + "," + rvd.AmountCredit + "," + rvd.AmountCreditINR + "," + "'" + rvd.ChequeNo + "'," + "'" + rvd.ChequeDate.ToString("yyyy-MM-dd") + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "ReceiptVoucherDetail", "", updateSQL) + Main.QueryDelimiter; } updateSQL = "Delete from InvoiceOutReceipts where RVTemporaryNo='" + rvh.TemporaryNo + "'" + " and RVTemporaryDate='" + rvh.TemporaryDate.ToString("yyyy-MM-dd") + "' and RVDocumentID = '" + rvh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "InvoiceOutReceipts", "", updateSQL) + Main.QueryDelimiter; foreach (invoiceoutreceipts rec in receiveList) { updateSQL = "insert into InvoiceOutReceipts " + "(InvoiceDocumentID,CustomerID,InvoiceOutNo,InvoiceOutDate,InvoiceOutTemporaryNo,InvoiceOutTemporaryDate,RVDocumentID,RVTemporaryNo,RVTemporaryDate,RVNo,RVDate,Amount,TDSAmount) " + "values ('" + rec.InvoiceDocumentID + "'," + "'" + rec.CustomerID + "'," + rec.InvoiceOutNo + "," + "'" + rec.InvoiceOutDate.ToString("yyyy-MM-dd") + "'," + rec.InvoiceOutTemporaryNo + "," + "'" + rec.InvoiceOutTemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + rvh.DocumentID + "'," + +rvh.TemporaryNo + "," + "'" + rvh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "0," + "'" + Convert.ToDateTime("1900-01-01").ToString("yyyy-MM-dd") + "'," + rec.Amount + "," + rec.TDSAmount + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "InvoiceOutReceipts", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertStockHeaderAndDetail(stockObNewHeader sobh, List <stockObNewDetail> StockDetail) { Boolean status = true; string utString = ""; string updateSQL = ""; try { sobh.DocumentNo = DocumentNumberDB.getNumber(sobh.DocumentID, 1); if (sobh.DocumentNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + sobh.DocumentNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + sobh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into StockOBHeader " + " (DocumentID,FYID,DocumentDate,DocumentNo,StoreLocation, Value, Status, DocumentStatus,Remarks," + "CreateUser,CreateTime)" + "values (" + "'" + sobh.DocumentID + "','" + sobh.FYID + "'," + "'" + sobh.DocumentDate.ToString("yyyy-MM-dd") + "'," + +sobh.DocumentNo + "," + "'" + sobh.StoreLocation + "'," + sobh.Value + "," + sobh.Status + "," + sobh.DocumentStatus + "," + "'" + sobh.Remarks + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE())"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "StockOBHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from StockOBDetail where DocumentID='" + sobh.DocumentID + "'" + " and DocumentNo=" + sobh.DocumentNo + " and DocumentDate='" + sobh.DocumentDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "StockOBDetail", "", updateSQL) + Main.QueryDelimiter; foreach (stockObNewDetail sobd in StockDetail) { updateSQL = "insert into StockOBDetail " + "(DocumentID,DocumentNo,DocumentDate,StockItemID,ModelNo,Quantity,Price) " + "values ('" + sobd.DocumentID + "'," + sobh.DocumentNo + "," + "'" + sobd.DocumentDate.ToString("yyyy-MM-dd") + "'," + "'" + sobd.StockItemID + "'," + "'" + sobd.ModelNo + "'," + sobd.Quantity + "," + sobd.Price + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "StockOBDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertPTHeaderAndDetail(producttesttemplateheader pttemp, List <producttesttemplatedetail> PTTestDetail) { Boolean status = true; string utString = ""; string updateSQL = ""; try { pttemp.TemplateNo = DocumentNumberDB.getNumber(pttemp.DocumentID, 1); if (pttemp.TemplateNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + pttemp.TemplateNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + pttemp.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into ProductTestTemplateHeader " + " (DocumentID,TemplateNo,TemplateDate,StockItemID,ModelNo," + "CreateUser,CreateTime)" + "values (" + "'" + pttemp.DocumentID + "'," + pttemp.TemplateNo + "," + "'" + pttemp.TemplateDate.ToString("yyyy-MM-dd") + "'," + "'" + pttemp.StockItemID + "'," + "'" + pttemp.ModelNo + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE())"; //"'" + pheader.ForwardUser + "'," + //"'" + pheader.ApproveUser + "'," + utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "ProductTestTemplateHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from ProductTestTemplateDetail where DocumentID='" + pttemp.DocumentID + "'" + " and TemplateNo=" + pttemp.TemplateNo + " and TemplateDate='" + pttemp.TemplateDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "ProductTestTemplateDetail", "", updateSQL) + Main.QueryDelimiter; foreach (producttesttemplatedetail PTTemp in PTTestDetail) { updateSQL = "insert into ProductTestTemplateDetail " + "(DocumentID,TemplateNo,TemplateDate,TestDescriptionID,SlNo,ExpectedResult,Remarks) " + "values ('" + PTTemp.DocumentID + "'," + pttemp.TemplateNo + "," + "'" + PTTemp.TemplateDate.ToString("yyyy-MM-dd") + "'," + "'" + PTTemp.TestDescriptionID + "'," + PTTemp.SlNo + "," + "'" + PTTemp.ExpectedResult + "'," + "'" + PTTemp.Remark + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "ProductTestTemplateDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertPVHeaderAndDetail(paymentvoucher vh, List <paymentvoucherdetail> VDetails) { Boolean status = true; string utString = ""; string updateSQL = ""; try { vh.TemporaryNo = DocumentNumberDB.getNumber(vh.DocumentID, 1); if (vh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + vh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + vh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into PaymentVoucherHeader " + "(DocumentID,CreationMode,ProjectID,OfficeID,TemporaryNo,TemporaryDate,VoucherNo,VoucherDate,VoucherType,BookType," + "SLType,SLCode,BankTransactionMode,CurrencyID,ExchangeRate," + "VoucherAmount,VoucherAmountINR,Narration,BillDetails," + "Comments,CommentStatus,CreateUser,CreateTime,ForwarderList,DocumentStatus,Status)" + " values (" + "'" + vh.DocumentID + "'," + "1," + "'" + vh.ProjectID + "'," + "'" + vh.OfficeID + "'," + vh.TemporaryNo + "," + "'" + vh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + vh.VoucherNo + "," + "'" + vh.VoucherDate.ToString("yyyy-MM-dd") + "'," + "'" + vh.VoucherType + "'," + "'" + vh.BookType + "'," + "'" + vh.SLType + "'," + "'" + vh.SLCode + "'," + "'" + vh.BankTransactionMode + "'," + "'" + vh.CurrencyID + "'," + vh.ExchangeRate + "," + vh.VoucherAmount + "," + vh.VoucherAmountINR + "," + "'" + vh.Narration + "'," + "'" + vh.BillDetails + "'," + "'" + vh.Comments + "'," + "'" + vh.CommentStatus + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + "," + "'" + vh.ForwarderList + "'," + vh.DocumentStatus + "," + vh.status + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "PaymentVoucherHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from PaymentVoucherDetail where DocumentID='" + vh.DocumentID + "'" + " and TemporaryNo=" + vh.TemporaryNo + " and TemporaryDate='" + vh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "PaymentVoucherDetail", "", updateSQL) + Main.QueryDelimiter; foreach (paymentvoucherdetail vd in VDetails) { updateSQL = "insert into PaymentVoucherDetail " + "(DocumentID,TemporaryNo,TemporaryDate,AccountCode,AmountDebit,AmountDebitINR,AmountCredit," + "AmountCreditINR,ChequeNo,ChequeDate) " + "values ('" + vh.DocumentID + "'," + vh.TemporaryNo + "," + "'" + vh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + vd.AccountCode + "'," + vd.AmountDebit + "," + vd.AmountDebitINR + "," + vd.AmountCredit + "," + vd.AmountCreditINR + "," + "'" + vd.ChequeNo + "'," + "'" + vd.ChequeDate.ToString("yyyy-MM-dd") + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "PaymentVoucherDetail", "", updateSQL) + Main.QueryDelimiter; } //return false; if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertQIHeaderAndDetail(qiheader qih, List <qidetail> QIDetail) { Boolean status = true; string utString = ""; string updateSQL = ""; try { qih.TemporaryNo = DocumentNumberDB.getNumber(qih.DocumentID, 1); if (qih.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + qih.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + qih.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into QIHeader " + "(DocumentID,CustomerID,TemporaryNo, TemporaryDate,DocumentNo,DocumentDate," + "QuotationNo,QuotationDate,ValidityDays,CurrencyID,PaymentTerms,PaymentMode,CreditPeriod,Status,DocumentStatus,CreateUser,CreateTime," + "Comments,ForwarderList,CommentStatus)" + " values (" + "'" + qih.DocumentID + "'," + "'" + qih.CustomerID + "'," + qih.TemporaryNo + "," + "'" + qih.TemporaryDate.ToString("yyyy-MM-dd") + "'," + qih.DocumentNo + "," + "'" + qih.DocumentDate.ToString("yyyy-MM-dd") + "'," + "'" + qih.QuotationNo + "'," + "'" + qih.QuotationDate.ToString("yyyy-MM-dd") + "'," + qih.ValidityDays + "," + "'" + qih.CurrencyID + "'," + "'" + qih.PaymentTerms + "'," + "'" + qih.PaymentMode + "'," + qih.CreditPeriod + "," + qih.Status + "," + qih.DocumentStatus + "," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + ",'" + qih.Comments + "'," + "'" + qih.ForwarderList + "'," + "'" + qih.CommentStatus + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "QIHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from QIDetail where DocumentID='" + qih.DocumentID + "'" + " and TemporaryNo=" + qih.TemporaryNo + " and TemporaryDate='" + qih.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "QIDetail", "", updateSQL) + Main.QueryDelimiter; foreach (qidetail qid in QIDetail) { updateSQL = "insert into QIDetail " + "(DocumentID,TemporaryNo,TemporaryDate,StockItemID,ModelNo,ModelDetails,Quantity,Price,TaxCode,Tax,WarrantyDays,TaxDetails) " + "values ('" + qid.DocumentID + "'," + qih.TemporaryNo + "," + "'" + qid.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + qid.StockItemID + "'," + "'" + qid.ModelNo + "'," + "'" + qid.ModelDetails + "'," + qid.Quantity + "," + qid.Price + " ," + "'" + qid.TaxCode + "'," + qid.Tax + "," + qid.WarrantyDays + "," + "'" + qid.TaxDetails + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "QIDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertPTRHeaderAndDetail(producttestreportheader ptrh, List <producttestreportdetail> PTRDetail) { Boolean status = true; string utString = ""; string updateSQL = ""; try { ptrh.TemporaryNo = DocumentNumberDB.getNumber(ptrh.DocumentID, 1); if (ptrh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + ptrh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + ptrh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into ProductTestReportHeader " + "(DocumentID,TemporaryNo,TemporaryDate,ReportNo,ReportDate,ProductionPlanNo,ProductionPlanDate,ProductSerialNo,DocumentStatus," + "CreateTime,CreateUser,ForwarderList)" + " values (" + "'" + ptrh.DocumentID + "'," + ptrh.TemporaryNo + "," + "'" + ptrh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + ptrh.ReportNo + "," + "'" + ptrh.ReportDate.ToString("yyyy-MM-dd") + "'," + ptrh.ProductionPalnNo + "," + "'" + ptrh.ProductionPlanDate.ToString("yyyy-MM-dd") + "'," + "'" + ptrh.ProductSerialNo + "'," + ptrh.DocumentStatus + "," + "GETDATE()" + "," + "'" + Login.userLoggedIn + "'," + "'" + ptrh.ForwarderList + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "ProductTestReportHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from ProductTestReportDetail where DocumentID='" + ptrh.DocumentID + "'" + " and TemporaryNo=" + ptrh.TemporaryNo + " and TemporaryDate='" + ptrh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "ProductTestReportDetail", "", updateSQL) + Main.QueryDelimiter; foreach (producttestreportdetail ptrd in PTRDetail) { updateSQL = "insert into ProductTestReportDetail " + "(DocumentID,TemporaryNo,TemporaryDate,SLNo,TestDescriptionID,ExpectedResult,ActualResult,TestStatus) " + "values ('" + ptrd.DocumentID + "'," + ptrh.TemporaryNo + "," + "'" + ptrd.TemporaryDate.ToString("yyyy-MM-dd") + "'," + ptrd.SLNo + "," + "'" + ptrd.TestDescriptionID + "' ," + "'" + ptrd.ExpectedResult + "' ," + "'" + ptrd.ActualResult + "'," + ptrd.TestStatus + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "ProductTestReportDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertPSRHeaderAndDetail(productservicereportheader psrh, List <productservicereportdetail> PSRDetail) { Boolean status = true; string utString = ""; string updateSQL = ""; try { psrh.TemporaryNo = DocumentNumberDB.getNumber(psrh.DocumentID, 1); if (psrh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + psrh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + psrh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into ProductServiceReportHeader " + "(DocumentID,ReportType,ReportNo,ReportDate,TemporaryNo, TemporaryDate," + "SMRNHeaderTempNo,SMRNHeaderTempDate,SMRNNo,SMRNDate,JobIDNo,CreateUser,CreateTime,Status)" + " values (" + "'" + psrh.DocumentID + "'," + "'" + psrh.ReportType + "'," + psrh.ReportNo + "," + "'" + psrh.ReportDate.ToString("yyyy-MM-dd") + "'," + psrh.TemporaryNo + "," + "'" + psrh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + psrh.SMRNHeaderTempNo + "," + "'" + psrh.SMRNHeaderTempDate.ToString("yyyy-MM-dd") + "'," + +psrh.SMRNNo + "," + "'" + psrh.SMRNDate.ToString("yyyy-MM-dd") + "'," + psrh.jobIDNo + "," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + "," + psrh.Status + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "ProductServiceReportHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from ProductServiceReportDetail where DocumentID='" + psrh.DocumentID + "'" + " and TemporaryNo=" + psrh.TemporaryNo + " and TemporaryDate='" + psrh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "ProductServiceReportDetail", "", updateSQL) + Main.QueryDelimiter; foreach (productservicereportdetail psrd in PSRDetail) { updateSQL = "insert into ProductServiceReportDetail " + "(DocumentID,TemporaryNo,TemporaryDate,TestDescriptionID,TestResult,TestRemarks) " + "values ('" + psrh.DocumentID + "'," + psrh.TemporaryNo + "," + "'" + psrh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + psrd.TestDescriptionID + "' ," + "'" + psrd.TestResult + "' ," + "'" + psrd.TestRemarks + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "ProductServiceReportDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertInvoiceINHeaderAndDetail(invoiceinheader inh, List <invoiceindetail> indList, out int Tno) { Boolean status = true; string utString = ""; string updateSQL = ""; Tno = 0; try { inh.TemporaryNo = DocumentNumberDB.getNumber(inh.DocumentID, 1); Tno = inh.TemporaryNo; if (inh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + inh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + inh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into InvoiceInHeader " + "(DocumentID,TemporaryNo,TemporaryDate,DocumentNo,DocumentDate,MRNNO,MRNDate,SupplierInvoiceNo,SupplierInvoiceDate," + "CurrencyID,ExchangeRate,FreightCharge,ProductValue,ProductValueINR,ProductTax,ProductTaxINR,InvoiceValue,InvoiceValueINR,AdvancePaymentVouchers,Remarks,Comments,CommentStatus," + "CreateUser,CreateTime,ForwarderList,DocumentStatus,Status)" + " values (" + "'" + inh.DocumentID + "'," + inh.TemporaryNo + "," + "'" + inh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + inh.DocumentNo + "," + "'" + inh.DocumentDate.ToString("yyyy-MM-dd") + "'," + inh.MRNNo + "," + "'" + inh.MRNDate.ToString("yyyy-MM-dd") + "','" + inh.SupplierInvoiceNo + "'," + "'" + inh.SupplierInvoiceDate.ToString("yyyy-MM-dd") + "'," + "'" + inh.CurrencyID + "'," + +inh.ExchangeRate + "," + +inh.FreightCharge + "," + +inh.ProductValue + "," + +inh.ProductValueINR + "," + +inh.ProductTax + "," + +inh.ProductTaxINR + "," + +inh.InvoiceValue + "," + +inh.InvoiceValueINR + "," + "'" + inh.AdvancePaymentVouchers + "'," + "'" + inh.Remarks + "'," + "'" + inh.Comments + "'," + "'" + inh.CommentStatus + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + "," + "'" + inh.ForwarderList + "'," + inh.DocumentStatus + "," + inh.status + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "InvoiceInHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from InvoiceInDetail where DocumentID='" + inh.DocumentID + "'" + " and TemporaryNo=" + inh.TemporaryNo + " and TemporaryDate='" + inh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "InvoiceInDetail", "", updateSQL) + Main.QueryDelimiter; foreach (invoiceindetail ind in indList) { updateSQL = "insert into InvoiceInDetail " + "(DocumentID,TemporaryNo,TemporaryDate,StockItemID,ModelNo,TaxCode,Quantity,Price,Tax,TaxDetails,ReferenceNo) " + "values ('" + ind.DocumentID + "'," + inh.TemporaryNo + "," + "'" + ind.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + ind.StockItemID + "'," + "'" + ind.ModelNo + "'," + "'" + ind.TaxCode + "'," + ind.Quantity + "," + ind.Price + "," + ind.Tax + "," + "'" + ind.TaxDetails + "'," + ind.ItemReferenceNo + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "InvoiceInDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean ApproveInvoiceInHeader(invoiceinheader inh) { Boolean status = true; string utString = ""; try { string updateSQL = "update InvoiceInHeader set DocumentStatus=99, status=1 " + ", ApproveUser='******'" + ", commentStatus='" + inh.CommentStatus + "'" + ", DocumentNo=" + inh.DocumentNo + ", DocumentDate=convert(date, getdate())" + " where DocumentID='" + inh.DocumentID + "'" + " and TemporaryNo=" + inh.TemporaryNo + " and TemporaryDate='" + inh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "InvoiceInHeader", "", updateSQL) + Main.QueryDelimiter; string narration = "Puchase against Invoice No " + inh.DocumentNo + "," + "Dated " + UpdateTable.getSQLDateTime().ToString("dd-MM-yyyy") + "," + "Party:" + inh.CustomerName; int PJVNo = 0; //Journal No DateTime PJVDate = DateTime.Parse("1900-01-01"); //Journal Date //int SJVTempNo = 0; //Temporary No //DateTime SJVTempDate = DateTime.Parse("1900-01-01"); //Temporary Date if (inh.PJVNo == 0 && inh.PJVTNo > 0) // JV Available but not approved { PJVNo = DocumentNumberDB.getNewNumber("PJV", 2); PJVDate = UpdateTable.getSQLDateTime(); } else //JV Available and approved // JV Not available { PJVNo = inh.PJVNo; PJVDate = inh.PJVDate; } updateSQL = "update PJVHeader set DocumentStatus=99, status=1 ,InvReferenceNo = " + inh.RowID + ", ApproveUser='******'" + ", JournalNo=" + PJVNo + ", JournalDate= '" + PJVDate.ToString("yyyy-MM-dd") + "', Narration='" + narration + "'" + " where InvDocumentID='" + inh.DocumentID + "'" + " and InvTempNo=" + inh.TemporaryNo + " and InvTempDate='" + inh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "PJVHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "update InvoiceInHeader set PJVNo='" + PJVNo + "'" + ", PJVDate='" + PJVDate.ToString("yyyy-MM-dd") + "'" + " where DocumentID='" + inh.DocumentID + "'" + " and TemporaryNo=" + inh.TemporaryNo + " and TemporaryDate='" + inh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "InvoiceInHeader", "", updateSQL) + Main.QueryDelimiter; if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception) { status = false; } return(status); }
public Boolean InsertIndentServiceHeaderAndDetail(indentserviceheader ish, List <indentservicedetail> ISDetail) { Boolean status = true; string utString = ""; string updateSQL = ""; try { ish.TemporaryNo = DocumentNumberDB.getNumber(ish.DocumentID, 1); if (ish.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + ish.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + ish.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into WORequestHeader " + "(DocumentID,TemporaryNo,TemporaryDate,WORequestNo,WORequestDate,ReferenceInternalOrder,CustomerID,CurrencyID," + "ExchangeRate,StartDate,TargetDate,PaymentTerms,PaymentMode,ServiceValue,TaxAmount,TotalAmount,ServiceValueINR,TaxAmountINR,TotalAmountINR," + "Remarks,Status,DocumentStatus,CreateTime,CreateUser, CommentStatus,Comments,ContractorReference,ForwarderList)" + " values (" + "'" + ish.DocumentID + "'," + ish.TemporaryNo + "," + "'" + ish.TemporaryDate.ToString("yyyy-MM-dd") + "'," + ish.WORequestNo + "," + "'" + ish.WORequestDate.ToString("yyyy-MM-dd") + "'," + "'" + ish.ReferenceInternalOrder + "'," + "'" + ish.CustomerID + "'," + "'" + ish.CurrencyID + "'," + ish.ExchangeRate + "," + "'" + ish.StartDate.ToString("yyyy-MM-dd") + "'," + "'" + ish.TargetDate.ToString("yyyy-MM-dd") + "'," + "'" + ish.PaymentTerms + "'," + "'" + ish.PaymentMode + "'," + ish.ServiceValue + "," + ish.TaxAmount + "," + ish.TotalAmount + "," + ish.ServiceValueINR + "," + ish.TaxAmountINR + "," + ish.TotalAmountINR + "," + "'" + ish.Remarks + "'," + ish.Status + "," + ish.DocumentStatus + "," + "GETDATE()" + "," + "'" + Login.userLoggedIn + "'," + "'" + ish.CommentStatus + "'," + "'" + ish.Comments + "'," + "'" + ish.ContractorReference + "'," + "'" + ish.ForwarderList + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "WORequestHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from WORequestDetail where DocumentID='" + ish.DocumentID + "'" + " and TemporaryNo=" + ish.TemporaryNo + " and TemporaryDate='" + ish.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "WORequestDetail", "", updateSQL) + Main.QueryDelimiter; foreach (indentservicedetail isd in ISDetail) { updateSQL = "insert into WORequestDetail " + "(DocumentID,TemporaryNo,TemporaryDate,StockItemID,WorkDescription,TaxCode,WorkLocation,Quantity,Price,Tax,POItemReferenceNo,WarrantyDays,TaxDetails) " + "values ('" + isd.DocumentID + "'," + ish.TemporaryNo + "," + "'" + isd.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + isd.StockItemID + "'," + "'" + isd.WorkDescription + "'," + "'" + isd.TaxCode + "'," + "'" + isd.WorkLocation + "'," + isd.Quantity + "," + isd.Rate + " ," + isd.Tax + "," + isd.POItemRefNo + "," + isd.WarrantyDays + "," + "'" + isd.TaxDetails + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "WORequestDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertPRHeaderAndDetail(purchasereturnheader prh, List <purchasereturndetail> PRDetails) { Boolean status = true; string utString = ""; string updateSQL = ""; try { prh.TemporaryNo = DocumentNumberDB.getNumber(prh.DocumentID, 1); if (prh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + prh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + prh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into PurchaseReturnHeader " + "(DocumentID,TemporaryNo,TemporaryDate,PurchaseReturnNo,PurchaseReturnDate,MRNNO,MRNDate," + "CustomerID,ProductValue,TaxAmount,PurchaseReturnValue,Remarks," + "Comments,CommentStatus,CreateUser,CreateTime,ForwarderList,DocumentStatus,Status)" + " values (" + "'" + prh.DocumentID + "'," + prh.TemporaryNo + "," + "'" + prh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + prh.PRNo + "," + "'" + prh.PRDate.ToString("yyyy-MM-dd") + "'," + prh.MRNNo + "," + "'" + prh.MRNDate.ToString("yyyy-MM-dd") + "'," + "'" + prh.CustomerID + "'," + prh.ProductValue + "," + prh.TaxAmount + "," + prh.PRValue + "," + "'" + prh.Remarks + "'," + "'" + prh.Comments + "'," + "'" + prh.CommentStatus + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + "," + "'" + prh.ForwarderList + "'," + prh.DocumentStatus + "," + prh.status + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "PurchaseReturnHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from PurchaseReturnDetail where DocumentID='" + prh.DocumentID + "'" + " and TemporaryNo=" + prh.TemporaryNo + " and TemporaryDate='" + prh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "PurchaseReturnDetail", "", updateSQL) + Main.QueryDelimiter; foreach (purchasereturndetail prd in PRDetails) { updateSQL = "insert into PurchaseReturnDetail " + "(DocumentID,TemporaryNo,TemporaryDate,StockItemID,ModelNo,TaxCode,Quantity,Price,Tax,TaxDetails,BatchNo,SerialNo,ExpiryDate,StoreLocationID,StockReferenceNo) " + "values ('" + prh.DocumentID + "'," + prh.TemporaryNo + "," + "'" + prh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + prd.StockItemID + "'," + "'" + prd.ModelNo + "'," + "'" + prd.TaxCode + "'," + prd.Quantity + "," + prd.Price + "," + prd.Tax + "," + "'" + prd.TaxDetails + "'," + "'" + prd.BatchNo + "'," + "'" + prd.SerialNo + "'," + "'" + prd.ExpiryDate.ToString("yyyy-MM-dd") + "'," + "'" + prd.StoreLocationID + "'," + prd.StockReferenceNo + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "PurchaseReturnDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean insertInvGatePassHEaderAndDetail(gatepassheader gtnh, List <gatepassdetail> getpassdetails) { Boolean status = true; string utString = ""; string updateSQL = ""; try { gtnh.TemporaryNo = DocumentNumberDB.getNumber(gtnh.DocumentID, 1); if (gtnh.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + gtnh.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + gtnh.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into InventoryGatepassHeader " + "(DocumentID,TemporaryNo,TemporaryDate,GatePassNo,GatePassDate,FromOffice,ToOffice,CustomerID,Remarks,SpecialNotes," + "Comments,CommentStatus,AcceptanceDate,AcceptedUser,AcceptanceStatus," + "ForwarderList,Status,DocumentStatus,CreateTime,CreateUser)" + " values (" + "'" + gtnh.DocumentID + "'," + gtnh.TemporaryNo + "," + "'" + gtnh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + gtnh.GatePassNo + "," + "'" + gtnh.GatePassDate.ToString("yyyy-MM-dd") + "'," + "'" + gtnh.FromOffice + "'," + "'" + gtnh.ToOffice + "'," + "'" + gtnh.CustomerID + "'," + "'" + gtnh.Remarks + "'," + "'" + gtnh.SpecialNotes + "'," + "'" + gtnh.Comments + "'," + "'" + gtnh.CommentStatus + "'," + "'" + DateTime.Parse("1900-01-01").ToString("yyyy-MM-dd") + "'," + "'" + gtnh.AcceptedUser + "'," + +gtnh.AcceptanceStatus + "," + "'" + gtnh.ForwarderList + "'," + gtnh.Status + "," + gtnh.DocumentStatus + "," + "GETDATE()" + "," + "'" + Login.userLoggedIn + "')"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "InventoryGatepassHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from InventoryGatepassDetail where DocumentID='" + gtnh.DocumentID + "'" + " and TemporaryNo=" + gtnh.TemporaryNo + " and TemporaryDate='" + gtnh.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "InventoryGatepassDetail", "", updateSQL) + Main.QueryDelimiter; foreach (gatepassdetail gtnd in getpassdetails) { updateSQL = "insert into InventoryGatepassDetail " + "(DocumentID,TemporaryNo,TemporaryDate,StockItemID,ModelNo,Quantity,Value,QuantityReturning,QuantityReturned,MRNNo,MRNDate,BatchNo,ExpiryDate,SerialNo,PurchaseQuantity, " + "PurchasePrice,PurchaseTax,SupplierID,StockReferenceNo) " + "values ('" + gtnh.DocumentID + "'," + gtnh.TemporaryNo + "," + "'" + gtnh.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + gtnd.StockitemID + "'," + "'" + gtnd.ModelNo + "'," + gtnd.Quantity + "," + gtnd.Value + "," + gtnd.ReturningQuantity + "," + gtnd.ReturnedQuantity + "," + gtnd.MRNNo + "," + "'" + gtnd.MRNDate.ToString("yyyy-MM-dd") + "'," + "'" + gtnd.BatchNo + "'," + "'" + gtnd.ExpiryDate.ToString("yyyy-MM-dd") + "'," + "'" + gtnd.SerialNo + "'," + gtnd.PurchaseQuantity + "," + gtnd.PurchasePrice + "," + gtnd.PurchaseTax + "," + "'" + gtnd.SupplierID + "'," + +gtnd.refNo + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "InventoryGatepassDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }
public Boolean InsertSIHeaderAndDetail(stockissueheader sih, List <stockissuedetail> SIDetails) { Boolean status = true; string utString = ""; string updateSQL = ""; try { sih.TemporaryNo = DocumentNumberDB.getNumber(sih.DocumentID, 1); if (sih.TemporaryNo <= 0) { MessageBox.Show("Error in Creating New Number"); return(false); } updateSQL = "update DocumentNumber set TempNo =" + sih.TemporaryNo + " where FYID='" + Main.currentFY + "' and DocumentID='" + sih.DocumentID + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("update", "DocumentNumber", "", updateSQL) + Main.QueryDelimiter; updateSQL = "insert into StockIssueHeader " + "(DocumentID,TemporaryNo,TemporaryDate,DocumentNo,DocumentDate,IssueType,ReferenceNo," + "ReferenceDate,ToLocation,Remarks" + ",CreateUser,CreateTime,ForwarderList,DocumentStatus,Status)" + " values (" + "'" + sih.DocumentID + "'," + sih.TemporaryNo + "," + "'" + sih.TemporaryDate.ToString("yyyy-MM-dd") + "'," + sih.DocumentNo + "," + "'" + sih.DocumentDate.ToString("yyyy-MM-dd") + "'," + sih.IssueType + "," + sih.ReferenceNo + "," + "'" + sih.ReferenceDate.ToString("yyyy-MM-dd") + "'," + "'" + sih.ToLocation + "'," + "'" + sih.Remarks + "'," + "'" + Login.userLoggedIn + "'," + "GETDATE()" + "," + "'" + sih.ForwarderList + "'," + sih.DocumentStatus + "," + sih.status + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "StockIssueHeader", "", updateSQL) + Main.QueryDelimiter; updateSQL = "Delete from StockIssueDetail where DocumentID='" + sih.DocumentID + "'" + " and TemporaryNo=" + sih.TemporaryNo + " and TemporaryDate='" + sih.TemporaryDate.ToString("yyyy-MM-dd") + "'"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("delete", "StockIssueDetail", "", updateSQL) + Main.QueryDelimiter; foreach (stockissuedetail sid in SIDetails) { updateSQL = "insert into StockIssueDetail " + "(DocumentID,TemporaryNo,TemporaryDate,StockItemID,ModelNo,IssueQuantity,MRNNo,MRNDate,BatchNo,ExpiryDate,SerialNo,PurchaseQuantity," + "PurchasePrice,PurchaseTax,SupplierID,StockReferenceNo) " + "values ('" + sih.DocumentID + "'," + sih.TemporaryNo + "," + "'" + sih.TemporaryDate.ToString("yyyy-MM-dd") + "'," + "'" + sid.StockItemID + "'," + "'" + sid.ModelNo + "'," + sid.IssueQuantity + "," + sid.MRNNo + "," + "'" + sid.MRNDate.ToString("yyyy-MM-dd") + "'," + "'" + sid.BatchNo + "'," + "'" + sid.ExpiryDate.ToString("yyyy-MM-dd") + "'," + "'" + sid.SerialNo + "'," + sid.PurchaseQuantity + "," + sid.PurchasePrice + "," + sid.PurchaseTax + "," + "'" + sid.SupplierID + "'," + +sid.StockReferenceNo + ")"; utString = utString + updateSQL + Main.QueryDelimiter; utString = utString + ActivityLogDB.PrepareActivityLogQquerString("insert", "StockIssueDetail", "", updateSQL) + Main.QueryDelimiter; } if (!UpdateTable.UT(utString)) { status = false; } } catch (Exception ex) { status = false; MessageBox.Show("Transaction Exception Occured"); } return(status); }