Exemplo n.º 1
0
        private string DeleteMember()
        {
            bool   bDel = false;
            string oid  = Get("oid");

            if (string.IsNullOrEmpty(oid))
            {
                return("主键为空,不允许删除!");
            }

            Dst_family_members m = new Dst_family_members();

            m.OID = oid;
            ds.RetrieveObject(m);
            var transaction = ImplementFactory.GetDeleteTransaction <Dst_family_members>("Dst_family_membersDeleteTransaction");

            transaction.EntityList.Add(m);
            bDel = transaction.Commit();
            if (bDel)
            {
                string msg;
                if (!FamilySurveyHandleClass.getInstance().CalculateIncome(m.SEQ_NO, out msg))
                {
                    msg = "计算家庭年收入异常";
                }
                return(msg);
            }

            return("删除失败!");
        }
Exemplo n.º 2
0
 private string SaveMember()
 {
     try
     {
         Dst_family_members member = new Dst_family_members();
         member.OID = Post("OID");
         if (member.OID == "")
         {
             member.OID = Guid.NewGuid().ToString();
         }
         ds.RetrieveObject(member);
         member.SEQ_NO      = Get("seq_no");
         member.NAME        = Post("NAME");
         member.AGE         = Post("AGE");
         member.RELATION    = Post("MEMBER_RELATION_TEXT") == "" ? Post("RELATION") : Post("MEMBER_RELATION_TEXT");
         member.WORKPLACE   = Post("WORKPLACE");
         member.PROFESSION  = Post("MEMBER_PROFESSION_TEXT") == "" ? Post("PROFESSION") : Post("MEMBER_PROFESSION_TEXT");
         member.INCOME      = comTran.ToDecimal(Post("INCOME"));
         member.HEALTH      = Post("HEALTH");//Post("MEMBER_HEALTH_TEXT") == "" ? Post("HEALTH") : Post("MEMBER_HEALTH_TEXT");
         member.IDCARDNO    = Post("IDCARDNO");
         member.DISA_DEGREE = Post("MEMBER_DISA_DEGREE");
         member.EDU_LEVEL   = Post("MEMBER_EDU_LEVEL");
         ds.UpdateObject(member);
         string msg;
         if (!FamilySurveyHandleClass.getInstance().CalculateIncome(member.SEQ_NO, out msg))
         {
             msg = "计算家庭年收入异常";
         }
         return(member.OID);
     }
     catch (Exception)
     {
         return("");
     }
 }