public void UpdateMUF(string muid, string action) { try { BaseBll bll = new BaseBll(); if (action == "add") { tstmnumuf muf = new tstmnumuf(); muf.apnm = Parameter.APPLICATION_NAME; muf.muid = muid.Trim(); muf.urid = Function.GetCurrentUser(); muf.adtm = DateTime.Now; bll.DoInsert <tstmnumuf>(muf); } if (action == "delete") { List <ColumnInfo> parameters = new List <ColumnInfo>() { new ColumnInfo() { ColumnName = "muid", ColumnValue = muid }, new ColumnInfo() { ColumnName = "apnm", ColumnValue = Parameter.APPLICATION_NAME }, new ColumnInfo() { ColumnName = "urid", ColumnValue = Function.GetCurrentUser() } }; tstmnumuf obj = bll.GetSelectedObject <tstmnumuf>(parameters); if (obj != null) { //bll.DoDelete<tstmnumuf>(parameters); bll.DoDelete <tstmnumuf>(obj); } } } catch (UtilException ex) { throw ex; } catch (Exception ex) { throw new UtilException(ex.Message, ex); } }
public void getDelete <T, P>() where T : class where P : class { string message = "{}"; try { string record = this.Request["record"]; Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record); List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["params"].ToString()); T bll = (T)typeof(T).GetConstructor(new Type[] { }).Invoke(new object[] { }); BaseBll baseBll = bll as BaseBll; baseBll.DoDelete <T>(parameters); message = "{status:'success',msg:'" + HRMSRes.Public_Message_DeleteWell + "'}"; } catch (Exception ex) { message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_DeleteBad, ex, true) + "'}"; } Response.Write(message); }