protected void btnUpdatePaymentType_Click(object sender, EventArgs e) { //Get and Insert Data Mst_PaymentTypeData data = new Mst_PaymentTypeData(); ITransaction tran = factory.GetLoadObject(data, drpUpdatePayment.SelectedValue); Execute(tran); if (!HasError) { //Get Data data = (Mst_PaymentTypeData)tran.Result; data.Name = txtPaymentType.Text; tran = factory.GetUpdateObject(data); Execute(tran); if (!HasError) { OperationLogger.WriteInfo(Constants.LogOperationAlbumId, Constants.LogActionUpdateId, updateSuccess, Page.User.Identity.Name); mvMessage.SetCompleteMessage(updateSuccess); DbHelper.FillList(drpPaymentType, "Select * from Mst_PaymentType", "Name", "id"); ShowData(); } else { OperationLogger.WriteError(Constants.LogOperationAlbumId, Constants.LogActionUpdateId, updateUnSuccess, Page.User.Identity.Name); mvMessage.AddError(updateUnSuccess); } } }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAddPaymentType_Click(object sender, EventArgs e) { //Get and Insert Data Mst_PaymentTypeData data = new Mst_PaymentTypeData(); ITransaction tran = factory.GetInsertObject(data); data.Name = txtPaymentType.Text.Trim(); //data.BuildingId = Func.ParseString(Session["__BUILDINGID__"]); data.ModifiedBy = Page.User.Identity.Name; data.CreatedBy = Page.User.Identity.Name; data.Created = DateTime.Now.ToString("yyyyMMddHHmmss"); data.Modified = DateTime.Now.ToString("yyyyMMddHHmmss"); data.DelFlag = "0"; Execute(tran); if (!HasError) { OperationLogger.WriteInfo(Constants.LogOperationAlbumId, Constants.LogActionInsertId, addSuccess, Page.User.Identity.Name); mvMessage.SetCompleteMessage(addSuccess); DbHelper.FillList(drpPaymentType, "Select * from Mst_PaymentType", "Name", "id"); ShowData(); } else { OperationLogger.WriteError(Constants.LogOperationAlbumId, Constants.LogActionInsertId, addUnSuccess, Page.User.Identity.Name); mvMessage.AddError(addUnSuccess); } }