public Int64 Insert(PmOrgInfo item, out ErrorEntity ErrInfo) { if (string.IsNullOrEmpty(item.FOrgName)) { ErrInfo = new ErrorEntity("OI010001", "组织名称不能为空!"); return -1; } if (string.IsNullOrEmpty(item.FOrgType)) { ErrInfo = new ErrorEntity("OI010002", "组织类型不能为空!"); return -1; } if (item.FDepartmentID == 0) { ErrInfo = new ErrorEntity("OI010003", "所属部门不能为空!"); return -1; } if (item.FOrgOrder == 0) { ErrInfo = new ErrorEntity("OI010004", "组织显示顺序不能为空!"); return -1; } NameValueCollection parameters = new NameValueCollection(); parameters.Add("FDepartmentID", item.FDepartmentID.ToString()); parameters.Add("FOrgName", item.FOrgName); parameters.Add("FParentOrgId", item.FParentOrgId.ToString()); parameters.Add("FOrgType", item.FOrgType); parameters.Add("FOrgNewDate", item.FOrgNewDate.ToString()); parameters.Add("FOrgOrder", item.FOrgOrder.ToString()); return Insert(parameters, out ErrInfo); }
public void GetParentOrgName(string _parentid, ref string _name) { PmOrgInfo item = new PmOrgInfo(); item = Select(_parentid); if (item == null) { if (string.IsNullOrEmpty(_name)) { _name = "无"; } } else { if (string.IsNullOrEmpty(_name)) { _name = item.FOrgName; } else { _name = item.FOrgName + " - " + _name; } GetParentOrgName(item.FParentOrgId.ToString(), ref _name); } }
public void GetItem() { string _id = Parameters["pid"]; PmOrgInfo item = new PmOrgInfo(); PmOrgInfoBiz biz = new PmOrgInfoBiz(); item = biz.Select(_id); if (item == null) { Response.Write(""); } else { Response.Write(item.ToJson()); } }
public void SaveItem() { string _FOrgId = Parameters["pFOrgId"]; // other paramters fill here string _orgname = Parameters["pFOrgName"]; string _deptid = Parameters["pDeptId"]; string _orgtype = Parameters["pFOrgType"]; string _order = Parameters["pOrder"]; string _parentid = Parameters["pParentId"]; string _newdate = Parameters["pNewDate"]; PmOrgInfo item = new PmOrgInfo(); item.FOrgId = string.IsNullOrEmpty(_FOrgId) ? 0 : Convert.ToInt64(_FOrgId); item.FDepartmentID = Convert.ToInt64(_deptid); item.FOrgName = _orgname; item.FOrgType = _orgtype; item.FParentOrgId = Convert.ToInt32(_parentid); item.FOrgOrder = Convert.ToInt32(_order); item.FOrgNewDate = Convert.ToDateTime(_newdate); PmOrgInfoBiz biz = new PmOrgInfoBiz(); ErrorEntity ErrInfo = new ErrorEntity(); if (item.FOrgId == 0) { biz.Insert(item, out ErrInfo); } else { biz.Update(item, out ErrInfo); } Response.Write(ErrInfo.ToJson()); }
public void GetNowParent() { string _id = Parameters["pid"]; PmOrgInfo item = new PmOrgInfo(); PmOrgInfoBiz biz = new PmOrgInfoBiz(); item = biz.Select(_id); if (item == null) { Response.Write("0"); } else { Response.Write(item.FParentOrgId.ToString()); } }