public BizResult delete(string user) { BizResult res = new BizResult(); if (det1 == null || det1.Id == 0) { res.context = "Data is empty"; } else { if (updating_verify(res, user, det1)) { string sql = string.Format(@"delete from ctm_jobdet1 where Id=@Id"); List <ConnectSql_mb.cmdParameters> list = new List <ConnectSql_mb.cmdParameters>(); list.Add(new ConnectSql_mb.cmdParameters("@Id", det1.Id, SqlDbType.Int)); ConnectSql_mb.sqlResult sqlRes = ConnectSql_mb.ExecuteNonQuery(sql, list); if (sqlRes.status) { res.status = true; CtmJobEventLog lg = new CtmJobEventLog(); lg.Platform_isBackend(); lg.Controller = user; //lg.JobNo = det1.JobNo; //lg.ContainerNo = det1.ContainerNo; //lg.Remark = "ContDelete"; lg.setActionLevel(det1.Id, CtmJobEventLogRemark.Level.Container, 2); lg.log(); System.Collections.ObjectModel.Collection <C2.CtmJobDet2> det2 = C2.Manager.ORManager.GetCollection <C2.CtmJobDet2>("det1Id=" + det1.Id); C2.CtmJobDet2Biz det2Bz = new CtmJobDet2Biz(0); foreach (C2.CtmJobDet2 temp in det2) { det2Bz.setData(temp); det2Bz.delete(user); } //sql = string.Format(@"delete from ctm_jobdet2 where det1Id=@Id"); //ConnectSql_mb.ExecuteNonQuery(sql, list); } } } return(res); }