MapperExtensionKernelMapperCommand Method |
Namespace: NetQuarry.Data
public override void FieldButtonClick(IField sender, EAPEventArgs e) { if (sender.Key == "btn_enable") { IField fldID = sender.Fields["dealer_id"]; IField fldDealershipID = sender.Fields["dealership_id"]; string dealerID = EAPUtil.ToString(fldID.Value); string sql = string.Format("UPDATE dealer SET status_id = 1 WHERE dealer_id = '{0}'", dealerID); if (0 == EAPUtil.ToString(fldDealershipID.Value).Length) { e.Error("You must select a dealership for this dealer before they can be enabled."); return; } sender.Database.Execute(sql); } }