void _view_InsertCommand(object sender, EventArgs e) { try { MissingCashBack item = new MissingCashBack(); item.TransactionDate = _view.TransactionDate; item.MID = _view.MID; //item.UserID = (Guid)Membership.GetUser().ProviderUserKey; item.OrderID = _view.OrderID; item.AmountPaid = _view.AmountPaid; item.CouponCode = _view.CouponCode; item.Details = _view.Details; item.FileUrl = _view.FileUrl; item.ContactNo = _view.ContactNo; item.Status = _view.Status; _model.DBOperation(Constants.Action.Insert, item); _view.strMessage = "Successfully Submitted!!"; LoadViewFromModel(); _view.DataBind(); } catch (Exception ex) { _view.strMessage = ex.Message; } }
void _view_DeleteCommand(object sender, EventArgs e) { try { MissingCashBack c = new MissingCashBack(); _model.DBOperation(Constants.Action.Delete, c, _view.Ids); _view.strMessage = "Successfully Deleted!!!"; LoadViewFromModel(); _view.DataBind(); } catch (Exception ex) { _view.strMessage = ex.Message; } }
public void DBOperation(Constants.Action command, MissingCashBack item = null, List <int> Ids = null, List <MissingCashBack> items = null) { switch (command) { case Constants.Action.Insert: client.InsertCashIssue(item); break; case Constants.Action.Delete: client.DeleteCashIssue(Ids); break; case Constants.Action.Update: client.UpdateCashIssue(item); break; default: break; } }