public Boolean updateStatusReconcilation(RECONCILIATION_STATUSRECONCILIATION[][] statusList) { bool succes = true; using (DatabaseContext databaseContext = new DatabaseContext()) { foreach (var status in statusList) { foreach (var state in status) { Reconcilations reconcilation = databaseContext.reconcilations.Find(state.UUID); if (reconcilation != null) { reconcilation.status = state.STATUS; reconcilation.statusCode = state.STATUS_CODE; reconcilation.createDate = state.CREATE_DATE; if (databaseContext.SaveChanges() != 1) { succes = false; } } else { succes = false; } } } return(succes); } }
public Boolean updateReconcilationIsSend(List <string> uuidArr, bool isSend) { bool succes = true; using (DatabaseContext databaseContext = new DatabaseContext()) { foreach (string uuid in uuidArr) { Reconcilations reconcilation = databaseContext.reconcilations.Find(uuid); if (reconcilation != null) { reconcilation.isSend = isSend; if (databaseContext.SaveChanges() != 1) { succes = false; } } else { succes = false; } } return(succes); } }
public int addReconcilation(Reconcilations reconcilation) { using (DatabaseContext databaseContext = new DatabaseContext()) { databaseContext.reconcilations.Add(reconcilation); return(databaseContext.SaveChanges()); } }
public Boolean updateStatusReconcilation(RECONCILIATION_STATUSRECONCILIATION[][] statusList) { bool succes = true; using (DatabaseContext databaseContext = new DatabaseContext()) { foreach (var reconcilationStates in statusList) { foreach (var reconcilationState in reconcilationStates) { Reconcilations reconcilation = databaseContext.reconcilations.Find(reconcilationState.UUID); if (reconcilation != null) { reconcilation.status = reconcilationState.STATUS; reconcilation.statusCode = reconcilationState.STATUS_CODE; reconcilation.createDate = reconcilationState.CREATE_DATE; reconcilation.emailStatusCode = reconcilationState.EMAIL.First().EMAIL_STATUS.First().STATUS_CODE; //emailde kullanıcının yaptıgı butun email loayları emaıl arrayının ıcınde bırden //c*k emaılstatus bulunabılır ben son yapılan emaıl durumunu cektıgım ıcın //first() dıyorum(en son yapılan degısıklık en basa gelır) reconcilation.emailStatus = reconcilationState.EMAIL.First().EMAIL_STATUS.First().STATUS; reconcilation.emailStatusDate = reconcilationState.EMAIL.First().EMAIL_STATUS.First().SEND_DATE; if (databaseContext.SaveChanges() != 1) { succes = false; } } else { succes = false; } } } return(succes); } }
private void BtnCreate_Click(object sender, EventArgs e) { if (isEmptyComponent()) { try { Reconcilations reconcilation = new Reconcilations(); reconcilation.uuid = Guid.NewGuid().ToString(); reconcilation.customerTitle = txtReceiverTitle.Text; reconcilation.customerID = msdReceiverVkn.Text; reconcilation.email = txtMail.Text; reconcilation.type = reconcilationType; reconcilation.createDate = DateTime.Now; if (reconcilationType.Equals(EI.Reconcilation.CM.ToString()))//carı mutabakt { reconcilation.currentAmount = Convert.ToDecimal(txtCurrentAmount.Text); if (cmbAccountType.SelectedIndex == 0)//alacak { reconcilation.accountType = EI.ReconcilationAmountType.ALACAK.ToString(); } else//borclu { reconcilation.accountType = EI.ReconcilationAmountType.BORC.ToString(); } reconcilation.cmDate = dateReconcilation.Value; } else //ba bs mutabakat { reconcilation.baDocPiece = Convert.ToInt32(nmBaDocPiece.Value); reconcilation.bsDocPiece = Convert.ToInt32(nmBsDocPiece.Value); reconcilation.baDocAmount = Convert.ToDecimal(txtBaAmount.Text); reconcilation.bsDocAmount = Convert.ToDecimal(txtBsAmount.Text); reconcilation.period = txtPeriod.Text; } if (Singl.reconcilationDalGet.addReconcilation(reconcilation) == 1) { MessageBox.Show(Lang.succesful); } } catch (System.Data.Entity.Infrastructure.DbUpdateException ex) { MessageBox.Show(Lang.dbFault + ex.InnerException.Message.ToString(), "DataBaseFault", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (System.Data.DataException ex) { MessageBox.Show(ex.Message.ToString()); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } else { MessageBox.Show(Lang.dontEmpty); } }