public void GetRoomDesignerKJLRelation()
        {
            try
            {
                if (string.IsNullOrEmpty(Request["DesignID"]))
                {
                    throw new Exception("DesignID:调用参数无效。");
                }
                using (ProxyBE op = new ProxyBE())
                {
                    SaveRoomDesignerKJLRelationArgs args  = new SaveRoomDesignerKJLRelationArgs();
                    RoomDesignerKJLRelation         model = new RoomDesignerKJLRelation();
                    model.KJLDesignID = Request["DesignID"].ToString();

                    args.RoomDesignerKJLRelation = model;
                    RoomDesignerKJLRelation roomDesignerKJLRelation = op.Client.LoadRoomDesignerKJLRelatioByDesignID(SenderUser, args);
                    if (roomDesignerKJLRelation != null)
                    {
                        Response.Write(JSONHelper.Object2JSON(roomDesignerKJLRelation));
                    }
                    else
                    {
                        Response.Write(JSONHelper.Object2JSON(null));
                    }
                }
            }
            catch (Exception ex)
            {
                PLogger.LogError(ex);
                WriteError(ex.Message);
            }
        }
        public void SaveRoomDesigner()
        {
            using (ProxyBE p = new ProxyBE())
            {
                try
                {
                    if (Request["DesignNo"] == null)
                    {
                        throw new Exception("设计号不能为空");
                    }
                    if (Request["DesignID"] == null)
                    {
                        throw new Exception("方案ID不能为空");
                    }
                    SaveRoomDesignerKJLRelationArgs args  = new SaveRoomDesignerKJLRelationArgs();
                    RoomDesignerKJLRelation         model = new RoomDesignerKJLRelation();
                    model.DesignerNo  = parm.DesignerNo;
                    model.KJLDesignID = parm.KJLDesignID;

                    args.RoomDesignerKJLRelation = model;
                    RoomDesignerKJLRelation roomDesignerKJLRelation = p.Client.LoadRoomDesignerKJLRelatioByDesignID(SenderUser, args);
                    if (roomDesignerKJLRelation != null)
                    {
                        throw new Exception("该方案已经被绑定");
                    }

                    p.Client.SaveRoomDesignerKJLRelation(SenderUser, args);
                    WriteSuccess();
                }
                catch (Exception ex)
                {
                    WriteError(ex.Message, ex);
                }
            }
        }
Exemplo n.º 3
0
 public RoomDesignerKJLRelation LoadRoomDesignerKJLRelatioByDesignID(Sender sender, SaveRoomDesignerKJLRelationArgs args)
 {
     try
     {
         using (ObjectProxy op = new ObjectProxy())
         {
             RoomDesignerKJLRelation obj = new RoomDesignerKJLRelation();
             obj.KJLDesignID = args.RoomDesignerKJLRelation.KJLDesignID;
             obj.DesignerNo  = args.RoomDesignerKJLRelation.DesignerNo;
             if (op.LoadRoomDesignerKJLRelatioByDesignID(obj) == 0)
             {
                 return(null);
             }
             return(obj);
         }
     }
     catch (Exception ex)
     {
         PLogger.LogError(ex);
         throw ex;
     }
 }