public Int64 Insert(PmOrgLeader item, out ErrorEntity ErrInfo)
        {
            if (string.IsNullOrEmpty(item.FLeaderName))
            {
                ErrInfo = new ErrorEntity("PL010001", "领导姓名不能为空!");
                return -1;
            }
            if(string.IsNullOrEmpty(item.FLeaderPostion))
            {
                ErrInfo = new ErrorEntity("PL010002","领导职务不能为空!");
                return -1;
            }
            if (item.FLeaderOrder == 0)
            {
                ErrInfo = new ErrorEntity("PL010003", "领导显示顺序不能为空!");
                return -1;
            }

            NameValueCollection parameters = new NameValueCollection();
            parameters.Add("FOrgId", item.FOrgId.ToString());
            parameters.Add("FLeaderName", item.FLeaderName);
            parameters.Add("FLeaderPostion", item.FLeaderPostion);
            parameters.Add("FLeaderOrder", item.FLeaderOrder.ToString());
            return Insert(parameters, out ErrInfo);
        }
 public void GetItem()
 {
     string _id = Parameters["pid"];
     PmOrgLeader item = new PmOrgLeader();
     PmOrgLeaderBiz biz = new PmOrgLeaderBiz();
     item = biz.Select(_id);
     if (item == null)
     {
         Response.Write("");
     }
     else
     {
         Response.Write(item.ToJson());
     }
 }
 public void SaveItem()
 {
     string _FLeaderId = Parameters["pFLeaderId"];
     // other paramters fill here
     string _name = Parameters["pName"];
     string _position = Parameters["pPosition"];
     string _order = Parameters["pOrder"];
     string _deptid = Parameters["pDeptid"];
     PmOrgLeader item = new PmOrgLeader();
     item.FLeaderId = string.IsNullOrEmpty(_FLeaderId) ? 0 : Convert.ToInt64(_FLeaderId);
     item.FOrgId = Convert.ToInt64(_deptid);
     item.FLeaderName = _name;
     item.FLeaderPostion = _position;
     item.FLeaderOrder = string.IsNullOrEmpty(_order) ? 0 : Convert.ToInt32(_order);
     PmOrgLeaderBiz biz = new PmOrgLeaderBiz();
     ErrorEntity ErrInfo = new ErrorEntity();
     if (item.FLeaderId == 0)
     {
         biz.Insert(item, out ErrInfo);
     }
     else
     {
         biz.Update(item, out ErrInfo);
     }
     Response.Write(ErrInfo.ToJson());
 }