new void Update() { try { Functions.TBL_SafeMovement movement = DB.TBL_SafeMovements.First(s => s.ID == ProcessID); movement.Desciption = txtDescription.Text; movement.DocumentNo = txtDocumentNo.Text; movement.DocumentType = "Kasa Devir Kartı"; if (radioOutside.Checked) { movement.GCCode = "C"; } if (radioInside.Checked) { movement.GCCode = "G"; } movement.SafeID = SafeID; movement.Date = DateTime.Parse(txtDate.Text); movement.Amount = decimal.Parse(txtAmount.Text); movement.EditDate = DateTime.Now; movement.EditUser = frmMain.UserID; DB.SubmitChanges(); messages.Update(true); Clear(); } catch (Exception e) { messages.Error(e); } }
void NewSave() { try { Functions.TBL_SafeMovement movement = new Functions.TBL_SafeMovement(); movement.Desciption = txtDescription.Text; movement.DocumentNo = txtDocumentNo.Text; movement.DocumentType = "Kasa Devir Kartı"; if (radioOutside.Checked) { movement.GCCode = "C"; } if (radioInside.Checked) { movement.GCCode = "G"; } movement.SafeID = SafeID; movement.Date = DateTime.Parse(txtDate.Text); movement.Amount = decimal.Parse(txtAmount.Text); movement.SaveDate = DateTime.Now; movement.SaveUser = frmMain.UserID; DB.TBL_SafeMovements.InsertOnSubmit(movement); DB.SubmitChanges(); messages.NewRecord("Devir Kartı Hareket Kaydı İşlenmiştir."); Clear(); } catch (Exception e) { messages.Error(e); } }
public void Open(int ID) { try { ProcessID = ID; Edit = true; Functions.TBL_SafeMovement movement = DB.TBL_SafeMovements.First(s => s.ID == ProcessID); txtAmount.Text = movement.Amount.ToString(); txtDate.Text = movement.Date.Value.ToShortDateString(); txtDescription.Text = movement.Desciption; txtDocumentNo.Text = movement.DocumentNo; OpenSafe(movement.SafeID.Value); if (movement.GCCode == "G") { radioInside.Checked = true; } else { radioOutside.Checked = true; } } catch (Exception e) { messages.Error(e); } }
public void Open(int MovementID) { try { Edit = true; ProcessID = MovementID; Functions.TBL_SafeMovement safeMovement = DB.TBL_SafeMovements.First(s => s.ID == ProcessID); CurrentMovementID = DB.TBL_CurrentMovements.First(s => s.DocumentType == safeMovement.DocumentType && s.DocumentID == ProcessID).ID; MessageBox.Show("Cari Hareket ID : " + CurrentMovementID.ToString()); txtDescription.Text = safeMovement.Desciption; txtDocumentNo.Text = safeMovement.DocumentNo; if (safeMovement.DocumentType == "Kasa Tahsilat") { txtProcessType.SelectedIndex = 0; } if (safeMovement.DocumentType == "Kasa Ödeme") { txtProcessType.SelectedIndex = 1; } txtDate.Text = safeMovement.Date.Value.ToShortDateString(); txtAmount.Text = safeMovement.Amount.Value.ToString(); OpenSafe(safeMovement.SafeID.Value); OpenCurrent(safeMovement.CurrentID.Value); } catch (Exception e) { Clear(); messages.Error(e); } }
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); } }