protected void btnOK_Click(object sender, EventArgs e) { int ParcelId = Convert.ToInt16(Request.QueryString["ParcelId"].ToString()); ParcelsManager pManager = new ParcelsManager(this); Parcel originalParcel = pManager.GetParcel(ParcelId, Company.CompanyId); Parcel parcel = pManager.GetParcel(ParcelId, Company.CompanyId); parcel.EffectedAmount = Convert.ToDecimal(txtEffectedAmount.Text); parcel.EffectedDate = Convert.ToDateTime(txtEffectedDate.Text); try { pManager.Update(originalParcel, parcel); } catch (Exception ex) { throw ex; } if (chkRecurrent.Checked) { parcel.IsRecurrent = true; if (RadioButton1.Checked) parcel.RecurrentPeriod = 7; else if (RadioButton2.Checked) parcel.RecurrentPeriod = 15; else if (RadioButton3.Checked) parcel.RecurrentPeriod = 30; else parcel.RecurrentPeriod = 365; pManager.Insert(parcel, new FinancierCondition()); } Page.ClientScript.RegisterStartupScript(this.GetType(), "modal", "top.$.modal.Hide();", true); }
protected void btnOK_Click(object sender, EventArgs e) { int ParcelId = Convert.ToInt16(Request.QueryString["ParcelId"].ToString()); ParcelsManager pManager = new ParcelsManager(this); Parcel originalParcel = pManager.GetParcel(ParcelId, Company.CompanyId); Parcel parcel = pManager.GetParcel(ParcelId, Company.CompanyId); parcel.EffectedAmount = Convert.ToDecimal(txtEffectedAmount.Text); parcel.EffectedDate = Convert.ToDateTime(txtEffectedDate.Text); try { pManager.Update(originalParcel, parcel); } catch (Exception ex) { throw ex; } if (chkRecurrent.Checked) { parcel.IsRecurrent = true; if (RadioButton1.Checked) { parcel.RecurrentPeriod = 7; } else if (RadioButton2.Checked) { parcel.RecurrentPeriod = 15; } else if (RadioButton3.Checked) { parcel.RecurrentPeriod = 30; } else { parcel.RecurrentPeriod = 365; } pManager.Insert(parcel, new FinancierCondition()); } Page.ClientScript.RegisterStartupScript(this.GetType(), "modal", "top.$.modal.Hide();", true); }
protected void btnRegister_Click(object sender, EventArgs e) { var parcelsManager = new ParcelsManager(this); Parcel parcel; CheckBox registered; foreach (GridViewRow row in grdAccountRegister.Rows) { var parcelId = (Int32)grdAccountRegister.DataKeys[row.RowIndex]["ParcelId"]; registered = (row.Cells[0].Controls[1] as CheckBox); if (registered != null) { if (registered.Checked) { parcel = parcelsManager.GetParcel(parcelId, Company.CompanyId); if (parcel == null) { return; } var ucDtDateMov = (row.Cells[4].Controls[3] as Date); parcel.EffectedAmount = parcel.Amount; parcel.OperationDate = parcel.DueDate; parcel.OperationDate = ucDtDateMov.DateTime; parcel.AccountId = Convert.ToInt32(cboAccount.SelectedValue); parcelsManager.Update(parcel, parcel); } } } grdAccountRegister.DataBind(); CalculateBalance(); }
protected void btnRegister_Click(object sender, EventArgs e) { var parcelsManager = new ParcelsManager(this); Parcel parcel; CheckBox registered; foreach (GridViewRow row in grdAccountRegister.Rows) { var parcelId = (Int32)grdAccountRegister.DataKeys[row.RowIndex]["ParcelId"]; registered = (row.Cells[0].Controls[1] as CheckBox); if (registered != null) if (registered.Checked) { parcel = parcelsManager.GetParcel(parcelId, Company.CompanyId); if (parcel == null) return; var ucDtDateMov = (row.Cells[4].Controls[3] as Date); parcel.EffectedAmount = parcel.Amount; parcel.OperationDate = parcel.DueDate; parcel.OperationDate = ucDtDateMov.DateTime; parcel.AccountId = Convert.ToInt32(cboAccount.SelectedValue); parcelsManager.Update(parcel, parcel); } } grdAccountRegister.DataBind(); CalculateBalance(); }