public int UpdateMiscBilling(MiscBillingChargeUpdateArgs args) { using (var cmd = NewCommand("sselData.dbo.MiscBillingCharge_Update")) { cmd.Parameters.AddWithValue("ExpID", args.ExpID, SqlDbType.Int); cmd.Parameters.AddWithValue("Description", args.Description, SqlDbType.NVarChar, 100); cmd.Parameters.AddWithValue("Period", args.Period, SqlDbType.DateTime); cmd.Parameters.AddWithValue("Quantity", args.Quantity, SqlDbType.Float); cmd.Parameters.AddWithValue("UnitCost", args.UnitCost, SqlDbType.Decimal); cmd.Connection.Open(); var result = cmd.ExecuteNonQuery(); cmd.Connection.Close(); return(result); } }
protected void GvMiscCharge_RowUpdating(object sender, GridViewUpdateEventArgs e) { int expId = Convert.ToInt32(e.Keys[0]); var mbc = Provider.Billing.Misc.GetMiscBillingCharge(expId); var txtActDate = (TextBox)gvMiscCharge.Rows[e.RowIndex].FindControl("txtActDate"); var actDate = Convert.ToDateTime(txtActDate.Text); var period = actDate.FirstOfMonth(); var args = new MiscBillingChargeUpdateArgs { ExpID = expId, Period = period, Description = Convert.ToString(e.NewValues["Description"]), Quantity = Convert.ToDouble(e.NewValues["Quantity"]), UnitCost = Convert.ToDecimal(e.NewValues["UnitCost"]) }; var updated = Provider.Billing.Misc.UpdateMiscBilling(args); if (updated == 0) { SetDebugError($"Cannot find record with ExpID = {expId}"); } else { RecalculateSubsidy(period, mbc.ClientID); if (period != mbc.Period) { RecalculateSubsidy(mbc.Period, mbc.ClientID); } } gvMiscCharge.EditIndex = -1; LoadGrid(); }
public int UpdateMiscBilling(MiscBillingChargeUpdateArgs args) { return(Post <int>("webapi/billing/misc/update", args)); }
public int UpdateMiscBilling([FromBody] MiscBillingChargeUpdateArgs args) { // Always recalculate subsidy after updating a MiscBillingCharge. using (DA.StartUnitOfWork()) return(ServiceProvider.Current.Billing.Misc.UpdateMiscBilling(args)); }