public void getNew() { string message = "{}"; try { string record = this.Request["record"]; Hashtable ht = JavaScriptConvert.DeserializeObject <Hashtable>(record); List <ColumnInfo> parameters = JavaScriptConvert.DeserializeObject <List <ColumnInfo> >(ht["keycolumns"].ToString()); tatroster obj = JavaScriptConvert.DeserializeObject <tatroster>(ht["params"].ToString()); List <tatrosdtl> listDtl = JavaScriptConvert.DeserializeObject <List <tatrosdtl> >(ht["dtlparams"].ToString()); atrosterBll bll = new atrosterBll(); bll.InsertRoster(obj, listDtl); message = "{status:'success',msg:'" + HRMSRes.Public_Message_EditWell + "'}"; } catch (Exception ex) { message = "{status:'failure',msg:'" + ExceptionPaser.Parse(HRMSRes.Public_Message_EditBad, ex, true) + "'}"; } Response.Write(message); }
public void DeleteRoster(List <ColumnInfo> _parameters) { try { using (TransactionScope scope = new TransactionScope()) { //delete first //List<ColumnInfo> parameters = new List<ColumnInfo>() { new ColumnInfo() { ColumnName = "rscd", ColumnValue = obj.rscd } }; tatroster obj = GetSelectedObject <tatroster>(_parameters); DoMultiDelete <tatrosdtl>(_parameters); //List<tatrosdtl> oldList = GetSelectedRecords<tatrosdtl>(_parameters); //for (int i = 0; i < oldList.Count; i++) //{ // dal.DoDelete<tatrosdtl>(oldList[i]); //} //delete dal.DoDelete <tatroster>(obj); scope.Complete(); } } catch (UtilException ex) { throw ex; } catch (Exception ex) { throw new UtilException(ex.Message, ex); } }
public void InsertRoster(tatroster obj, List <tatrosdtl> list) { try { using (TransactionScope scope = new TransactionScope()) { //insert DoInsert <tatroster>(obj); for (int i = 0; i < list.Count; i++) { DoInsert <tatrosdtl>(list[i]); } scope.Complete(); } } catch (UtilException ex) { throw ex; } catch (Exception ex) { throw new UtilException(ex.Message, ex); } }
public void UpdateRoster(tatroster obj, List <tatrosdtl> list) { try { using (TransactionScope scope = new TransactionScope()) { //delete first List <ColumnInfo> parameters = new List <ColumnInfo>() { new ColumnInfo() { ColumnName = "rscd", ColumnValue = obj.rscd } }; //DoMultiDelete<tatrosdtl>(parameters); List <tatrosdtl> oldList = GetSelectedRecords <tatrosdtl>(parameters); for (int i = 0; i < oldList.Count; i++) { DoDelete <tatrosdtl>(oldList[i]); } //update DoUpdate <tatroster>(obj, parameters); for (int i = 0; i < list.Count; i++) { DoInsert <tatrosdtl>(list[i]); } scope.Complete(); } } catch (UtilException ex) { throw ex; } catch (Exception ex) { throw new UtilException(ex.Message, ex); } }