public Int64 Insert(SysMember item, out ErrorEntity ErrInfo) { if (string.IsNullOrEmpty(item.FBirthDateStr)) { ErrInfo = new ErrorEntity("MB010001", "出生日期不能为空!"); return -1; } if (item.FDepartmentId == 0) { ErrInfo = new ErrorEntity("MB010002", "所属部门不能为空!"); return -1; } if (item.FEductionId == 0) { ErrInfo = new ErrorEntity("MB010003", "人员学历不能为空!"); return -1; } if (string.IsNullOrEmpty(item.FIDNumber)) { ErrInfo = new ErrorEntity("MB010004", "人员身份证号码不能为空!"); return -1; } if (!ChkMemberIdNumber(item.FMemberId.ToString(), item.FIDNumber)) { ErrInfo = new ErrorEntity("MB010005", "人员身份证号码已经存在,不能重复!"); return -1; } if (string.IsNullOrEmpty(item.FMemberCode)) { ErrInfo = new ErrorEntity("MB010006", "人员编号不能为空!"); return -1; } if (!ChkMemberCode(item.FMemberId.ToString(), item.FMemberCode)) { ErrInfo = new ErrorEntity("MB010007", "人员编号已经存在,不能重复!"); return -1; } if (string.IsNullOrEmpty(item.FMemberName)) { ErrInfo = new ErrorEntity("MB010008", "人员姓名不能为空!"); return -1; } if (string.IsNullOrEmpty(item.FMobile)) { ErrInfo = new ErrorEntity("MB010009", "移动电话不能为空!"); return -1; } if (item.FNationId == 0) { ErrInfo = new ErrorEntity("MB010010", "人员民族不能为空!"); return -1; } NameValueCollection parameters = new NameValueCollection(); parameters.Add("FBirthDate", item.FBirthDate.ToString()); parameters.Add("FDepartmentId", item.FDepartmentId.ToString()); parameters.Add("FEductionId", item.FEductionId.ToString()); parameters.Add("FIDNumber", item.FIDNumber); parameters.Add("FMemberCode", item.FMemberCode); parameters.Add("FMemberGendor", item.FMemberGendor); parameters.Add("FMemberName", item.FMemberName); parameters.Add("FMobile", item.FMobile); parameters.Add("FNationId", item.FNationId.ToString()); parameters.Add("FPicPath", item.FPicPathStr); parameters.Add("FPosition", item.FPosition); parameters.Add("FStatus", "1"); return Insert(parameters, out ErrInfo); }
public void GetPic() { string _id = Parameters["pid"]; SysMember item = new SysMember(); SysMemberBiz biz = new SysMemberBiz(); item = biz.Select(_id); if (item == null) { Response.Write("../../images/defphoto.png"); } else { Response.Write(item.FPicPathStr); } }
public void SaveItem() { string _FMemberId = Parameters["pFMemberId"]; // other paramters fill here string _FMemberCode = Parameters["pFMemberCode"]; string _FMemberName = Parameters["pFMemberName"]; string _FEductionId = Parameters["pFEductionId"]; string _FNationId = Parameters["pFNationId"]; string _FDepartmentId = Parameters["pFDepartmentId"]; string _FMemberGendor = Parameters["pFMemberGendor"]; string _FBirthDate = Parameters["pFBirthDate"]; string _FPosition = Parameters["pFPosition"]; string _FMobile = Parameters["pFMobile"]; string _FIDNumber = Parameters["pFIDNumber"]; string _FPicPath = Parameters["pFPicPath"]; SysMember item = new SysMember(); item.FMemberId = string.IsNullOrEmpty(_FMemberId) ? 0 : Convert.ToInt64(_FMemberId); item.FBirthDate = string.IsNullOrEmpty(_FBirthDate) ? new DateTime() : Convert.ToDateTime(_FBirthDate); item.FDepartmentId = string.IsNullOrEmpty(_FDepartmentId) ? 0 : Convert.ToInt64(_FDepartmentId); item.FEductionId = string.IsNullOrEmpty(_FEductionId) ? 0 : Convert.ToInt64(_FEductionId); item.FIDNumber = _FIDNumber; item.FMemberCode = _FMemberCode; item.FMemberGendor = _FMemberGendor; item.FMemberName = _FMemberName; item.FMobile = _FMobile; item.FNationId = string.IsNullOrEmpty(_FNationId) ? 0 : Convert.ToInt64(_FNationId); item.FPicPath = _FPicPath; item.FPosition = _FPosition; SysMemberBiz biz = new SysMemberBiz(); ErrorEntity ErrInfo = new ErrorEntity(); if (item.FMemberId == 0) { biz.Insert(item, out ErrInfo); } else { biz.Update(item, out ErrInfo); } Response.Write(ErrInfo.ToJson()); }
public void GetItem() { string _id = Parameters["pid"]; SysMember item = new SysMember(); SysMemberBiz biz = new SysMemberBiz(); item = biz.Select(_id); if (item == null) { Response.Write(""); } else { Response.Write(item.ToJson()); } }