private string DeleteGrant() { Dst_stu_grant grant = new Dst_stu_grant(); var code = Get("id"); if (string.IsNullOrEmpty(code)) { return("主键为空,不允许删除操作"); } grant.OID = code; ds.RetrieveObject(grant); bool bDel = false; var transaction = ImplementFactory.GetDeleteTransaction <Dst_stu_grant>("Dst_stu_grantDeleteTransaction"); transaction.EntityList.Add(grant); bDel = transaction.Commit(); if (!bDel) { return("删除失败!"); } else { return(""); } }
private string SaveGrant() { try { Dst_stu_grant grant = new Dst_stu_grant(); grant.OID = Post("OID"); if (grant.OID == "") { grant.OID = Guid.NewGuid().ToString(); } ds.RetrieveObject(grant); grant.SEQ_NO = Get("seq_no"); grant.ITEM = Post("ITEM"); grant.RANK = Post("RANK"); grant.SCHOOL_YEAR = Post("SCHOOL_YEAR"); ds.UpdateObject(grant); return(grant.OID + ";" + grant.SEQ_NO); } catch (Exception ex) { return(string.Empty); } }