void NewSave() { try { Functions.TBL_BANKMOVEMENT bank = new Functions.TBL_BANKMOVEMENT(); bank.Amount = decimal.Parse(txtAmount.Text); bank.BankID = BankID; bank.CurrentID = CurrentID; bank.Description = txtDescription.Text; bank.DocumentNo = txtDocumentNo.Text; bank.DocumentType = txtTransferType.SelectedItem.ToString(); if (radioInflow.Checked) { bank.GCCode = "G"; } if (radioOutflow.Checked) { bank.GCCode = "C"; } bank.Date = DateTime.Parse(txtDate.Text); bank.SaveDate = DateTime.Now; bank.SaveUser = frmMain.UserID; DB.TBL_BANKMOVEMENTs.InsertOnSubmit(bank); DB.SubmitChanges(); Functions.TBL_CurrentMovement current = new Functions.TBL_CurrentMovement(); current.Description = txtDescription.Text; if (radioInflow.Checked) { current.Credit = decimal.Parse(txtAmount.Text); } if (radioInflow.Checked) { current.Debt = decimal.Parse(txtAmount.Text); } current.CurrentID = CurrentID; current.DocumentID = bank.Id; current.DocumentType = txtTransferType.SelectedItem.ToString(); current.Date = DateTime.Parse(txtDate.Text); if (txtTransferType.SelectedIndex == 0) { current.Type = "BH"; } if (txtTransferType.SelectedIndex == 1) { current.Type = "EFT"; } current.SaveDate = DateTime.Now; current.SaveUser = frmMain.UserID; DB.TBL_CurrentMovements.InsertOnSubmit(current); DB.SubmitChanges(); messages.NewRecord("Para transfer kaydı işlendi."); Clear(); } catch (Exception e) { messages.Error(e); } }
void Update() { try { Functions.TBL_BANKMOVEMENT bank = DB.TBL_BANKMOVEMENTs.First(s => s.Id == ProcessID); bank.Amount = decimal.Parse(txtAmount.Text); bank.BankID = BankID; bank.CurrentID = CurrentID; bank.Description = txtDescription.Text; bank.DocumentNo = txtDocumentNo.Text; bank.DocumentType = txtTransferType.SelectedItem.ToString(); if (radioInflow.Checked) { bank.GCCode = "G"; } if (radioOutflow.Checked) { bank.GCCode = "C"; } bank.Date = DateTime.Parse(txtDate.Text); bank.EditDate = DateTime.Now; bank.EditUser = frmMain.UserID; DB.SubmitChanges(); Functions.TBL_CurrentMovement current = DB.TBL_CurrentMovements.First(s => s.DocumentType == txtTransferType.SelectedItem.ToString() && s.DocumentID == ProcessID); current.Description = txtDescription.Text; if (radioInflow.Checked) { current.Credit = decimal.Parse(txtAmount.Text); } if (radioInflow.Checked) { current.Debt = decimal.Parse(txtAmount.Text); } current.CurrentID = CurrentID; current.DocumentID = bank.Id; current.DocumentType = txtTransferType.SelectedItem.ToString(); current.Date = DateTime.Parse(txtDate.Text); if (txtTransferType.SelectedIndex == 0) { current.Type = "BH"; } if (txtTransferType.SelectedIndex == 1) { current.Type = "EFT"; } current.EditDate = DateTime.Now; current.EditUser = frmMain.UserID; DB.SubmitChanges(); messages.Update(true); Clear(); } catch (Exception e) { messages.Error(e); } }
void NewInvoiceSave() { try { Functions.TBL_INVOICE invoice = new Functions.TBL_INVOICE(); invoice.Description = txtDescription.Text; invoice.CurrentCode = txtCurrentCode.Text; invoice.InvoiceNo = txtInvoiceNo.Text; invoice.InvoiceType = "Satış Faturası"; invoice.TopTotal = decimal.Parse(txtTopTotal.Text); invoice.WaybillID = WaybillID; /*ToDo*/ invoice.PaymentType = PaymentPlace; invoice.PaymentID = PaymentID; invoice.Date = DateTime.Parse(txtInvoiceDate.Text); invoice.SaveDate = DateTime.Now; invoice.SaveUser = frmMain.UserID; db.TBL_INVOICEs.InsertOnSubmit(invoice); db.SubmitChanges(); InvoiceID = invoice.Id; if (WaybillID < 0) { Functions.TBL_WAYBILL waybill = new Functions.TBL_WAYBILL(); waybill.Description = txtDescription.Text; waybill.CurrentCode = txtCurrentCode.Text; waybill.InvoiceID = invoice.Id; waybill.WaybillNo = txtWaybillNo.Text; waybill.Date = DateTime.Parse(txtWaybillDate.Text); waybill.SaveDate = DateTime.Now; waybill.SaveUser = frmMain.UserID; db.TBL_WAYBILLs.InsertOnSubmit(waybill); db.SubmitChanges(); WaybillID = waybill.Id; } Functions.TBL_STOCKMOVEMENT[] stockMovement = new Functions.TBL_STOCKMOVEMENT[gridView1.RowCount]; for (int i = 0; i < gridView1.RowCount; i++) { stockMovement[i] = new Functions.TBL_STOCKMOVEMENT(); stockMovement[i].UnitPrice = decimal.Parse(gridView1.GetRowCellValue(i, "UnitPrice").ToString()); stockMovement[i].InvoiceID = invoice.Id; stockMovement[i].GCCode = "C"; stockMovement[i].WaybillID = WaybillID; stockMovement[i].TAX = decimal.Parse(gridView1.GetRowCellValue(i, "TAX").ToString()); stockMovement[i].Quantity = int.Parse(gridView1.GetRowCellValue(i, "Quantity").ToString()); stockMovement[i].StockCode = gridView1.GetRowCellValue(i, "StockCode").ToString(); stockMovement[i].Type = "Satış Faturası"; stockMovement[i].SaveDate = DateTime.Now; stockMovement[i].SaveUser = frmMain.UserID; db.TBL_STOCKMOVEMENTs.InsertOnSubmit(stockMovement[i]); } db.SubmitChanges(); Functions.TBL_CurrentMovement currentMovement = new Functions.TBL_CurrentMovement(); currentMovement.Description = txtInvoiceNo.Text + " no'lu satış faturası tutarı"; if (txtInvoiceType.SelectedIndex == 0) { currentMovement.Credit = 0; currentMovement.Debt = decimal.Parse(txtTopTotal.Text); } else if (txtInvoiceType.SelectedIndex == 1) { currentMovement.Debt = decimal.Parse(txtTopTotal.Text); currentMovement.Credit = decimal.Parse(txtTopTotal.Text); } currentMovement.CurrentID = CurrentID; currentMovement.Date = DateTime.Now; currentMovement.Type = "SF"; currentMovement.DocumentType = "Satış Faturası"; currentMovement.DocumentID = invoice.Id; currentMovement.SaveDate = DateTime.Now; currentMovement.SaveUser = frmMain.UserID; db.TBL_CurrentMovements.InsertOnSubmit(currentMovement); db.SubmitChanges(); messages.NewRecord("Yeni Fatura Kaydı Başarı ile Yapılmıştır..."); Clear(); } catch (Exception EX) { messages.Error(EX); } }
void Update() { try { Functions.TBL_SafeMovement safeMovement = DB.TBL_SafeMovements.First(s => s.ID == ProcessID); safeMovement.Desciption = txtDescription.Text; safeMovement.DocumentNo = txtDocumentNo.Text; safeMovement.CurrentID = CurrentID; safeMovement.DocumentType = txtProcessType.SelectedItem.ToString(); if (txtProcessType.SelectedIndex == 0) { safeMovement.GCCode = "G"; } if (txtProcessType.SelectedIndex == 1) { safeMovement.GCCode = "C"; } safeMovement.SafeID = SafeID; safeMovement.EditUser = frmMain.UserID; safeMovement.EditDate = DateTime.Now; safeMovement.Date = DateTime.Parse(txtDate.Text); safeMovement.Amount = decimal.Parse(txtAmount.Text); DB.SubmitChanges(); messages.Update(true); Functions.TBL_CurrentMovement currentMovement = DB.TBL_CurrentMovements.First(s => s.ID == CurrentMovementID); currentMovement.Description = txtDocumentNo.Text + "Belge numaralı " + txtProcessType.SelectedItem.ToString() + " işlemi"; if (txtProcessType.SelectedIndex == 0) { currentMovement.Credit = decimal.Parse(txtAmount.Text); } if (txtProcessType.SelectedIndex == 1) { currentMovement.Debt = decimal.Parse(txtAmount.Text); } currentMovement.CurrentID = CurrentID; currentMovement.DocumentID = safeMovement.ID; currentMovement.DocumentType = txtProcessType.SelectedItem.ToString(); currentMovement.Date = DateTime.Parse(txtDate.Text); if (txtProcessType.SelectedIndex == 0) { currentMovement.Type = "KT"; } if (txtProcessType.SelectedIndex == 1) { currentMovement.Type = "KÖ"; } currentMovement.EditDate = DateTime.Now; currentMovement.EditUser = frmMain.UserID; DB.SubmitChanges(); messages.Update(true); Clear(); } catch (Exception e) { messages.Error(e); } }
void newSave() { try { Functions.TBL_SafeMovement safeMovement = new Functions.TBL_SafeMovement(); safeMovement.Desciption = txtDescription.Text; safeMovement.DocumentNo = txtDocumentNo.Text; safeMovement.CurrentID = CurrentID; safeMovement.DocumentType = txtProcessType.SelectedItem.ToString(); if (txtProcessType.SelectedIndex == 0) { safeMovement.GCCode = "G"; } if (txtProcessType.SelectedIndex == 1) { safeMovement.GCCode = "C"; } safeMovement.SafeID = SafeID; safeMovement.SaveUser = frmMain.UserID; safeMovement.SaveDate = DateTime.Now; safeMovement.Date = DateTime.Parse(txtDate.Text); safeMovement.Amount = decimal.Parse(txtAmount.Text); DB.TBL_SafeMovements.InsertOnSubmit(safeMovement); DB.SubmitChanges(); messages.NewRecord(txtProcessType.SelectedItem.ToString() + " yeni kasa hareketi olarak işlenmiştir."); Functions.TBL_CurrentMovement currentMovement = new Functions.TBL_CurrentMovement(); currentMovement.Description = txtDocumentNo.Text + "Belge numaralı " + txtProcessType.SelectedItem.ToString() + "işlemi"; if (txtProcessType.SelectedIndex == 0) { currentMovement.Credit = decimal.Parse(txtAmount.Text); } if (txtProcessType.SelectedIndex == 1) { currentMovement.Debt = decimal.Parse(txtAmount.Text); } currentMovement.CurrentID = CurrentID; currentMovement.DocumentID = safeMovement.ID; currentMovement.DocumentType = txtProcessType.SelectedItem.ToString(); currentMovement.Date = DateTime.Parse(txtDate.Text); if (txtProcessType.SelectedIndex == 0) { currentMovement.Type = "KT"; } if (txtProcessType.SelectedIndex == 1) { currentMovement.Type = "KÖ"; } currentMovement.SaveDate = DateTime.Now; currentMovement.SaveUser = frmMain.UserID; DB.TBL_CurrentMovements.InsertOnSubmit(currentMovement); DB.SubmitChanges(); messages.NewRecord(txtProcessType.SelectedItem.ToString() + " yeni cari hareketi olarak işlenmiştir."); Clear(); } catch (Exception e) { messages.Error(e); } }