/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); ID = BaseBusinessLogic.ConvertToDecimal(dr[TAB_EMPLOYEEEntity.Field_ID]); OWNER_SITE = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_OWNER_SITE]); TRANSFER_ADD_FEE = BaseBusinessLogic.ConvertToDecimal(dr[TAB_EMPLOYEEEntity.Field_TRANSFER_ADD_FEE]); EMPLOYEE_CODE = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_EMPLOYEE_CODE]); OWNER_RANGE = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_OWNER_RANGE]); CARDNUM = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_CARDNUM]); BL_DISPATCH_GAIN = BaseBusinessLogic.ConvertToDecimal(dr[TAB_EMPLOYEEEntity.Field_BL_DISPATCH_GAIN]); BL_SEND_GAIN = BaseBusinessLogic.ConvertToDecimal(dr[TAB_EMPLOYEEEntity.Field_BL_SEND_GAIN]); ID_CARD = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_ID_CARD]); UPDATETIME = BaseBusinessLogic.ConvertToDateTime(dr[TAB_EMPLOYEEEntity.Field_UPDATETIME]); BAR_PASSWORD = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_BAR_PASSWORD]); EMPLOYEE_TYPE = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_EMPLOYEE_TYPE]); DISPATCH__ADD_FEE = BaseBusinessLogic.ConvertToDecimal(dr[TAB_EMPLOYEEEntity.Field_DISPATCH__ADD_FEE]); DEPT_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_DEPT_NAME]); ADDRESS = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_ADDRESS]); PHONE = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_PHONE]); EMPLOYEE_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_EMPLOYEE_NAME]); DELETIONSTATECODE = BaseBusinessLogic.ConvertToDecimal(dr[TAB_EMPLOYEEEntity.Field_DELETIONSTATECODE]); GROUP_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_GROUP_NAME]); DISPATCH_ADD_FEE_OPERA = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_DISPATCH_ADD_FEE_OPERA]); TRANSFER_ADD_FEE_OPERA = BaseBusinessLogic.ConvertToString(dr[TAB_EMPLOYEEEntity.Field_TRANSFER_ADD_FEE_OPERA]); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); if (dr.ContainsColumn(ZtoPrintHistoryEntity.FieldId)) { Id = BaseBusinessLogic.ConvertToDecimal(dr[ZtoPrintHistoryEntity.FieldId]); } if (dr.ContainsColumn(ZtoPrintHistoryEntity.FieldReceiveCompany)) { ReceiveCompany = BaseBusinessLogic.ConvertToString(dr[ZtoPrintHistoryEntity.FieldReceiveCompany]); } if (dr.ContainsColumn(ZtoPrintHistoryEntity.FieldReceiveMan)) { ReceiveMan = BaseBusinessLogic.ConvertToString(dr[ZtoPrintHistoryEntity.FieldReceiveMan]); } if (dr.ContainsColumn(ZtoPrintHistoryEntity.FieldExpressType)) { ExpressType = BaseBusinessLogic.ConvertToNullableDateTime(dr[ZtoPrintHistoryEntity.FieldExpressType]); } if (dr.ContainsColumn(ZtoPrintHistoryEntity.FieldCreateOn)) { CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[ZtoPrintHistoryEntity.FieldCreateOn]); } if (dr.ContainsColumn(ZtoPrintHistoryEntity.FieldBillCode)) { BillCode = BaseBusinessLogic.ConvertToString(dr[ZtoPrintHistoryEntity.FieldBillCode]); } return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { Id = BaseBusinessLogic.ConvertToDecimal(dr[BaseOrganizeExpressEntity.FieldID]); NotDispatchRange = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldNotDispatchRange]); ScanSelect = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldScanSelect]); SitePrior = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldSitePrior]); ModifiedUserId = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldModifiedUserId]); PrivateRemark = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldPrivateRemark]); PublicRemark = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldPublicRemark]); DispatchTimeLimit = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldDispatchTimeLimit]); AgentMoneyLimited = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldAgentMoneyLimited]); CreateBy = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldCreateBy]); DefaultSendPlace = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldDefaultSendPlace]); CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseOrganizeExpressEntity.FieldCreateOn]); DispatchRange = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldDispatchRange]); AllowToPayment = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldAllowToPayment]); CreateUserId = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldCreateUserId]); AllowAgentMoney = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldAllowAgentMoney]); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseOrganizeExpressEntity.FieldModifiedOn]); DispatchOutRangeFee = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldDispatchOutRangeFee]); Currency = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldCurrency]); DispatchRangeFee = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldDispatchRangeFee]); ModifiedBy = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldModifiedBy]); DispatchMoneyDesc = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldDispatchMoneyDesc]); WebSiteName = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldWebSiteName]); WebEnabled = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldWebEnabled]); InternalDispatch = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeExpressEntity.FieldInternalDispatch]); IsTransferCenter = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeExpressEntity.FieldIsTransferCenter]); IsErpOpen = BaseBusinessLogic.ConvertToInt(dr[BaseOrganizeExpressEntity.FieldIsErpOpen]); IsReceiveOrder = BaseBusinessLogic.ConvertToInt(dr[BaseOrganizeExpressEntity.FieldIsReceiveOrder]); IsReceiveComplain = BaseBusinessLogic.ConvertToInt(dr[BaseOrganizeExpressEntity.FieldIsReceiveComplain]); // 获取扩展属性 GetFromExpand(dr); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); Id = BaseBusinessLogic.ConvertToDecimal(dr[BaseOrganize_ExpressEntity.FieldID]); Not_Dispatch_Range = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldNot_Dispatch_Range]); Scan_Select = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganize_ExpressEntity.FieldScan_Select]); Site_Prior = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganize_ExpressEntity.FieldSite_Prior]); ModifiedUserId = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldModifiedUserId]); Private_Remark = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldPrivate_Remark]); Public_Remark = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldPublic_Remark]); Dispatch_Time_Limit = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldDispatch_Time_Limit]); Agent_Money_Limited = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganize_ExpressEntity.FieldAgent_Money_Limited]); CreateBy = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldCreateBy]); Default_Send_Place = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldDefault_Send_Place]); CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseOrganize_ExpressEntity.FieldCreateOn]); Dispatch_Range = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldDispatch_Range]); Allow_ToPayment = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganize_ExpressEntity.FieldAllow_ToPayment]); CreateUserId = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldCreateUserId]); Allow_Agent_Money = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganize_ExpressEntity.FieldAllow_Agent_Money]); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseOrganize_ExpressEntity.FieldModifiedOn]); Dispatch_OutRange_Fee = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganize_ExpressEntity.FieldDispatch_OutRange_Fee]); Currency = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldCurrency]); Dispatch_Range_Fee = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganize_ExpressEntity.FieldDispatch_Range_Fee]); ModifiedBy = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldModifiedBy]); Dispatch_Money_Desc = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldDispatch_Money_Desc]); WebSiteName = BaseBusinessLogic.ConvertToString(dr[BaseOrganize_ExpressEntity.FieldWebSiteName]); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); MENU_GUID = BaseBusinessLogic.ConvertToString(dr[TAB_USERPOPEDOMEntity.FieldMENU_GUID]); OWNER_SITE = BaseBusinessLogic.ConvertToString(dr[TAB_USERPOPEDOMEntity.FieldOWNER_SITE]); USER_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_USERPOPEDOMEntity.FieldUSER_NAME]); BL_DELETE = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USERPOPEDOMEntity.FieldBL_DELETE]); BL_UPDATE = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USERPOPEDOMEntity.FieldBL_UPDATE]); BL_INSERT = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USERPOPEDOMEntity.FieldBL_INSERT]); return(this); }
/// <summary> /// 设为默认发件人 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void tspSetDefaultSendMan_Click(object sender, EventArgs e) { if (gvSendMan.RowCount > 0) { for (var rowIndex = 0; rowIndex < gvSendMan.RowCount; rowIndex++) { var objValue = gvSendMan.GetRowCellValue(rowIndex, gvSendMan.Columns["Check"]); if (objValue == null) { continue; } bool isCheck; bool.TryParse(objValue.ToString(), out isCheck); if (isCheck) { var selectedId = BaseBusinessLogic.ConvertToDecimal(gvSendMan.GetRowCellValue(rowIndex, "Id").ToString()); ZtoUserManager userManager = new ZtoUserManager(BillPrintHelper.DbHelper); userManager.SetProperty(new KeyValuePair <string, object>(ZtoUserEntity.FieldIssendorreceive, 1), new KeyValuePair <string, object>(ZtoUserEntity.FieldIsDefault, 0)); var result = userManager.SetProperty(new KeyValuePair <string, object>(ZtoUserEntity.FieldId, selectedId), new KeyValuePair <string, object>(ZtoUserEntity.FieldIsDefault, 1)); if (result > 0) { SendManDataBind(); XtraMessageBox.Show("设置成功", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { XtraMessageBox.Show("设置失败", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); } break; } } } //var list = GetCheckedUserRecord(gvSendMan); //if (list.Any()) //{ // if (list.Count > 1) // { // XtraMessageBox.Show(@"请勿选择多条发件人记录。", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); // return; // } // ZtoUserManager userManager = new ZtoUserManager(BillPrintHelper.DbHelper); // userManager.SetProperty(new KeyValuePair<string, object>(ZtoUserEntity.FieldId, list.First().Id), // new KeyValuePair<string, object>(ZtoUserEntity.FieldIsDefault, 1)); // var selectedId = gvSendMan.GetRowCellValue(rowIndex, gvSendMan.Columns["Id"]).ToString(); //} //else //{ // XtraMessageBox.Show(@"请添加发件人数据。", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); //} }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { Id = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldId]); // 2016-03-02 吉日嘎拉 防止程序出错,没有这个字段也可以正常运行 if (dr.ContainsColumn(BaseUserLogOnEntity.FieldCompanyId)) { CompanyId = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldCompanyId]); } ChangePasswordDate = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldChangePasswordDate]); UserPassword = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldUserPassword]); Enabled = BaseBusinessLogic.ConvertToInt(dr[BaseUserLogOnEntity.FieldEnabled]); OpenId = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldOpenId]); OpenIdTimeout = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldOpenIdTimeout]); Salt = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldSalt]); /* * CommunicationPassword = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldCommunicationPassword]); * SignedPassword = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldSignedPassword]); * PublicKey = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldPublicKey]); */ AllowStartTime = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldAllowStartTime]); AllowEndTime = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldAllowEndTime]); SystemCode = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldSystemCode]); LockStartDate = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldLockStartDate]); LockEndDate = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldLockEndDate]); FirstVisit = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldFirstVisit]); PreviousVisit = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldPreviousVisit]); LastVisit = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldLastVisit]); MultiUserLogin = BaseBusinessLogic.ConvertToInt(dr[BaseUserLogOnEntity.FieldMultiUserLogin]); CheckIPAddress = BaseBusinessLogic.ConvertToInt(dr[BaseUserLogOnEntity.FieldCheckIPAddress]); LogOnCount = BaseBusinessLogic.ConvertToInt(dr[BaseUserLogOnEntity.FieldLogOnCount]); ShowCount = BaseBusinessLogic.ConvertToInt(dr[BaseUserLogOnEntity.FieldShowCount]); PasswordErrorCount = BaseBusinessLogic.ConvertToInt(dr[BaseUserLogOnEntity.FieldPasswordErrorCount]); UserOnLine = BaseBusinessLogic.ConvertToInt(dr[BaseUserLogOnEntity.FieldUserOnLine]); IPAddress = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldIPAddress]); IPAddressName = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldIPAddressName]); MACAddress = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldMACAddress]); ComputerName = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldComputerName]); Question = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldQuestion]); AnswerQuestion = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldAnswerQuestion]); PasswordStrength = BaseBusinessLogic.ConvertToDecimal(dr[BaseUserLogOnEntity.FieldPasswordStrength]); NeedModifyPassword = BaseBusinessLogic.ConvertToInt(dr[BaseUserLogOnEntity.FieldNeedModifyPassword]); CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldCreateOn]); CreateUserId = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldCreateUserId]); CreateBy = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldCreateBy]); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserLogOnEntity.FieldModifiedOn]); ModifiedUserId = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldModifiedUserId]); ModifiedBy = BaseBusinessLogic.ConvertToString(dr[BaseUserLogOnEntity.FieldModifiedBy]); // 获取扩展属性 GetFromExpand(dr); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { Id = BaseBusinessLogic.ConvertToDecimal(dr[BaseUserLogonExtendEntity.FieldId]); EmailRemind = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserLogonExtendEntity.FieldEmailRemind]); QrCodeLogon = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserLogonExtendEntity.FieldQrCodeLogon]); JixinRemind = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserLogonExtendEntity.FieldJixinRemind]); WechatRemind = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserLogonExtendEntity.FieldWechatRemind]); DynamicCodeLogon = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserLogonExtendEntity.FieldDynamicCodeLogon]); MobileRemind = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserLogonExtendEntity.FieldMobileRemind]); UsernamePasswordLogon = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserLogonExtendEntity.FieldUsernamePasswordLogon]); // 获取扩展属性 GetFromExpand(dr); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); ID = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_ID]); COMPUT_ID = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_COMPUT_ID]); EMPLOYEE_CODE = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_EMPLOYEE_CODE]); OWNER_ROLE = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_OWNER_ROLE]); BL_REC_PLACARD = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_BL_REC_PLACARD]); USER_SITE = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_USER_SITE]); ROLEID = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_ROLEID]); MODIFIER = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_MODIFIER]); USER_WEBPOWER = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_USER_WEBPOWER]); OWNER_CENTER = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_OWNER_CENTER]); MODIFIER_CODE = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_MODIFIER_CODE]); CREATE_SITE = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_CREATE_SITE]); IM_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_IM_NAME]); USER_PART = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_USER_PART]); BL_CHECK_COMPUTER = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_BL_CHECK_COMPUTER]); DEPT_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_DEPT_NAME]); //USER_PASSWORD = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_USER_PASSWORD]); USER_PASSWD = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_USER_PASSWD]); CALL_CENTER_ID = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_CALL_CENTER_ID]); EMPLOYEE_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_EMPLOYEE_NAME]); DELETIONSTATECODE = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_DELETIONSTATECODE]); OWNER_GROUP = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_OWNER_GROUP]); MODIFY_SITE = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_MODIFY_SITE]); BL_LOCK_FLAG = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_BL_LOCK_FLAG]); OWNER_SITE = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_OWNER_SITE]); CREATE_DATE = BaseBusinessLogic.ConvertToDateTime(dr[TAB_USER_Entity.Field_CREATE_DATE]); CREATE_USER = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_CREATE_USER]); USER_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_USER_NAME]); REMARK = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_REMARK]); BL_AO = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_BL_AO]); BL_TYPE = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_BL_TYPE]); LOGINNAME = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_LOGINNAME]); OWNER_GROUP = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_OWNER_GROUP]); MOBILE = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_MOBILE]); ONLY_USER_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_ONLY_USER_NAME]); ID_CARD = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_ID_CARD]); MODIFIER_DATE = BaseBusinessLogic.ConvertToDateTime(dr[TAB_USER_Entity.Field_MODIFIER_DATE]); CHECK_NAME_DATE = BaseBusinessLogic.ConvertToDateTime(dr[TAB_USER_Entity.Field_CHECK_NAME_DATE]); BL_CHECK_NAME = BaseBusinessLogic.ConvertToDecimal(dr[TAB_USER_Entity.Field_BL_CHECK_NAME]); POSITION_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_POSITION_NAME]); REAL_NAME = BaseBusinessLogic.ConvertToString(dr[TAB_USER_Entity.Field_REAL_NAME]); USER_DATE = BaseBusinessLogic.ConvertToDateTime(dr[TAB_USER_Entity.Field_USER_DATE]); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); ID = BaseBusinessLogic.ConvertToDecimal(dr[BaseStaff_ExpressEntity.FieldID]); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseStaff_ExpressEntity.FieldModifiedOn]); TRANSFER_ADD_FEE = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseStaff_ExpressEntity.FieldTRANSFER_ADD_FEE]); OWNER_RANGE = BaseBusinessLogic.ConvertToString(dr[BaseStaff_ExpressEntity.FieldOWNER_RANGE]); ModifiedUserId = BaseBusinessLogic.ConvertToString(dr[BaseStaff_ExpressEntity.FieldModifiedUserId]); DISPATCH_ADD_FEE = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseStaff_ExpressEntity.FieldDISPATCH_ADD_FEE]); ModifiedBy = BaseBusinessLogic.ConvertToString(dr[BaseStaff_ExpressEntity.FieldModifiedBy]); CreateBy = BaseBusinessLogic.ConvertToString(dr[BaseStaff_ExpressEntity.FieldCreateBy]); CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseStaff_ExpressEntity.FieldCreateOn]); CreateUserId = BaseBusinessLogic.ConvertToString(dr[BaseStaff_ExpressEntity.FieldCreateUserId]); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { Id = BaseBusinessLogic.ConvertToDecimal(dr[BaseOrganizeGisEntity.FieldId]); Latitude = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeGisEntity.FieldLatitude]); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseOrganizeGisEntity.FieldModifiedOn]); ModifiedUserId = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeGisEntity.FieldModifiedUserId]); RegionLabelEnable = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeGisEntity.FieldRegionLabelEnable]); Address = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeGisEntity.FieldAddress]); WebShowEnable = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseOrganizeGisEntity.FieldWebShowEnable]); Longitude = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeGisEntity.FieldLongitude]); ModifiedBy = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeGisEntity.FieldModifiedBy]); CreateBy = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeGisEntity.FieldCreateBy]); CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseOrganizeGisEntity.FieldCreateOn]); CreateUserId = BaseBusinessLogic.ConvertToString(dr[BaseOrganizeGisEntity.FieldCreateUserId]); // 获取扩展属性 GetFromExpand(dr); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); Id = BaseBusinessLogic.ConvertToDecimal(dr[BaseTemplateEntity.FieldId]); ExpressId = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseTemplateEntity.FieldExpressId]); CreateUserName = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldCreateUserName]); ModifiedUserName = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldModifiedUserName]); CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseTemplateEntity.FieldCreateOn]); Length = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldLength]); Remark = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldRemark]); Name = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldName]); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseTemplateEntity.FieldModifiedOn]); BackgroundImagePath = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldBackgroundImagePath]); Width = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldWidth]); Layer = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldLayer]); FilePath = BaseBusinessLogic.ConvertToString(dr[BaseTemplateEntity.FieldFilePath]); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); Id = BaseBusinessLogic.ConvertToDecimal(dr[BaseExpressEntity.FieldId]); CreateUserName = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldCreateUserName]); CityId = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldCityId]); ModifiedUserName = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldModifiedUserName]); CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseExpressEntity.FieldCreateOn]); County = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldCounty]); CountyId = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldCountyId]); Remark = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldRemark]); Name = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldName]); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseExpressEntity.FieldModifiedOn]); ProvinceId = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldProvinceId]); City = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldCity]); Address = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldAddress]); Layer = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FieldLayer]); ShortName = BaseBusinessLogic.ConvertToString(dr[BaseExpressEntity.FiledShortName]); return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserIdentityAuditEntity.FieldModifiedOn]); IdcardPhotoHand = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldIdcardPhotoHand]); OrganizeFullname = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldOrganizeFullname]); CreateOn = BaseBusinessLogic.ConvertToDateTime(dr[BaseUserIdentityAuditEntity.FieldCreateOn]); AuditDate = BaseBusinessLogic.ConvertToNullableDateTime(dr[BaseUserIdentityAuditEntity.FieldAuditDate]); AuditStatus = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldAuditStatus]); InterfaceDayLimit = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserIdentityAuditEntity.FieldInterfaceDayLimit]); NickName = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldNickName]); UserRealName = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldUserRealName]); Idcard = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldIdcard]); AuditUserId = BaseBusinessLogic.ConvertToNullableDecimal(dr[BaseUserIdentityAuditEntity.FieldAuditUserId]); Id = BaseBusinessLogic.ConvertToDecimal(dr[BaseUserIdentityAuditEntity.FieldId]); AuditIdea = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldAuditIdea]); AuditUserRealName = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldAuditUserRealName]); OrganizeId = BaseBusinessLogic.ConvertToDecimal(dr[BaseUserIdentityAuditEntity.FieldOrganizeId]); AuditUserNickName = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldAuditUserNickName]); IdcardPhotoFront = BaseBusinessLogic.ConvertToString(dr[BaseUserIdentityAuditEntity.FieldIdcardPhotoFront]); return(this); }
/// <summary> /// 获取到选择的收件人实体 /// </summary> /// <param name="gridView"></param> /// <returns></returns> public List <ZtoUserEntity> GetCheckedUserRecord(GridView gridView) { var list = new List <ZtoUserEntity>(); if (gridView.RowCount > 0) { for (var rowIndex = 0; rowIndex < gridView.RowCount; rowIndex++) { var objValue = gridView.GetRowCellValue(rowIndex, gridView.Columns["Check"]); if (objValue == null) { continue; } bool isCheck; bool.TryParse(objValue.ToString(), out isCheck); if (isCheck) { var entity = new ZtoUserEntity { Id = BaseBusinessLogic.ConvertToDecimal(gridView.GetRowCellValue(rowIndex, "Id").ToString()), Realname = gridView.GetRowCellValue(rowIndex, "姓名").ToString(), Province = gridView.GetRowCellValue(rowIndex, "省份").ToString(), City = gridView.GetRowCellValue(rowIndex, "城市").ToString(), County = gridView.GetRowCellValue(rowIndex, "区县").ToString(), Address = gridView.GetRowCellValue(rowIndex, "详细地址").ToString(), Company = gridView.GetRowCellValue(rowIndex, "单位").ToString(), Department = gridView.GetRowCellValue(rowIndex, "部门").ToString(), TelePhone = gridView.GetRowCellValue(rowIndex, "电话").ToString(), Mobile = gridView.GetRowCellValue(rowIndex, "手机").ToString(), Postcode = gridView.GetRowCellValue(rowIndex, "邮编").ToString() }; list.Add(entity); } } } return(list); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); Id = BaseBusinessLogic.ConvertToDecimal(dr[ItemsSystemEntity.FieldId]); ParentId = BaseBusinessLogic.ConvertToNullableDecimal(dr[ItemsSystemEntity.FieldParentId]); Description = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldDescription]); Enabled = BaseBusinessLogic.ConvertToDecimal(dr[ItemsSystemEntity.FieldEnabled]); ModifiedUserId = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldModifiedUserId]); SortCode = BaseBusinessLogic.ConvertToNullableDecimal(dr[ItemsSystemEntity.FieldSortCode]); Ispublic = BaseBusinessLogic.ConvertToDecimal(dr[ItemsSystemEntity.FieldIspublic]); CreateBy = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldCreateby]); CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[ItemsSystemEntity.FieldCreateon]); ItemValue = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldItemValue]); CreateUserId = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldCreateUserId]); Logonurl = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldLogonUrl]); AllowDelete = BaseBusinessLogic.ConvertToDecimal(dr[ItemsSystemEntity.FieldAllowDelete]); ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[ItemsSystemEntity.FieldModifiedOn]); itemName = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldItemName]); AllowEdit = BaseBusinessLogic.ConvertToDecimal(dr[ItemsSystemEntity.FieldAllowEdit]); ModifiedBy = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldModifiedBy]); itemCode = BaseBusinessLogic.ConvertToString(dr[ItemsSystemEntity.FieldItemCode]); DeletionStateCode = BaseBusinessLogic.ConvertToNullableDecimal(dr[ItemsSystemEntity.FieldDeletionStateCode]); return(this); }
/// <summary> /// 保存本地 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSaveBill_Click(object sender, EventArgs e) { //构建实体 ZtoPrintBillEntity printBillEntity = BuildPrintEntity(); //if (!string.IsNullOrEmpty(PrintBillId)) //{ // printBillEntity = new ZtoPrintBillManager(BillPrintHelper.DbHelper).GetObject(PrintBillId); //} //printBillEntity.SendMan = txtSendMan.Text; //printBillEntity.SendPhone = txtSendPhone.Text; //printBillEntity.SendCompany = txtSendCompany.Text; //printBillEntity.SendAddress = txtSendAddress.Text; //printBillEntity.SendDate = string.IsNullOrEmpty(txtSendDate.Text) ? DateTime.Now.ToString(BaseSystemInfo.DateFormat) : txtSendDate.Text; //if (!string.IsNullOrEmpty(dgvSendArea.Text)) //{ // var sendAreaArray = dgvSendArea.Text.Split('-'); // printBillEntity.SendProvince = sendAreaArray[0]; // printBillEntity.SendCity = sendAreaArray[1]; // printBillEntity.SendCounty = sendAreaArray[2]; //} //printBillEntity.ReceiveMan = txtReceiveMan.Text; //printBillEntity.ReceivePhone = txtReceivePhone.Text; //printBillEntity.ReceiveCompany = txtReceiveCompany.Text; //printBillEntity.ReceiveAddress = txtReceiveAddress.Text; //if (!string.IsNullOrEmpty(dgvReceiveArea.Text)) //{ // var receiveAreaArray = dgvReceiveArea.Text.Split('-'); // printBillEntity.ReceiveProvince = receiveAreaArray[0]; // printBillEntity.ReceiveCity = receiveAreaArray[1]; // printBillEntity.ReceiveCounty = receiveAreaArray[2]; //} //printBillEntity.GoodsName = cmbGoodsName.Text; //printBillEntity.Weight = txtGoodsWeight.Text; //printBillEntity.GOODS_PAYMENT = string.IsNullOrEmpty(txtGoodsPayment.Text) ? 0 : decimal.Parse(txtGoodsPayment.Text); //printBillEntity.TOPAYMENT = string.IsNullOrEmpty(txtToPayMent.Text) ? 0 : decimal.Parse(txtToPayMent.Text); //printBillEntity.Remark = txtRemark.Text; //printBillEntity.BigPen = txtBigPen.Text; var ztoPrintBillManager = new ZtoPrintBillManager(BillPrintHelper.DbHelper); // 表示更新 if (!string.IsNullOrEmpty(PrintBillId)) { printBillEntity.Id = BaseBusinessLogic.ConvertToDecimal(PrintBillId); ztoPrintBillManager.Update(printBillEntity); XtraMessageBox.Show("更新成功", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); } else { _list.Clear(); var saveCount = int.Parse(cmbPrintNumber.Text); if (saveCount == 0) { cmbPrintNumber.Text = "1"; saveCount = 1; } // 这里要有订单号可以输入,不能系统生成,这样不科学,2016年6月15日22:33:11,杨恒连 // 如果他大于1条的话,后面的订单号要系统生成了 // 最好检查这个订单号有么有重复使用,重复使用就不好了,这样获取到用过的单号是要罚款的 if (!string.IsNullOrEmpty(txtOrderNumber.Text)) { saveCount = saveCount - 1; printBillEntity.OrderNumber = txtOrderNumber.Text; ztoPrintBillManager.Add(printBillEntity, true); _list.Add(printBillEntity); } for (int i = 0; i < saveCount; i++) { printBillEntity.OrderNumber = Guid.NewGuid().ToString("N").ToLower(); ztoPrintBillManager.Add(printBillEntity, true); _list.Add(printBillEntity); } XtraMessageBox.Show(string.Format("新增成功{0}条记录", cmbPrintNumber.Text), AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void CheckZtoElecInfo() { ZtoElecUserInfoEntity elecUserInfoEntity = BillPrintHelper.GetElecUserInfoEntity(); if (elecUserInfoEntity != null) { if (_list == null || _list.Count == 0) { MessageUtil.ShowWarning("请认真填写好发件人和收件人的姓名、电话、省市区、地址"); return; } var list = ZtoElecBillHelper.BindElecBillByCustomerId(_list, elecUserInfoEntity); if (list != null && list.Any()) { txtBillCode.Text = list.First().BillCode; txtBigPen.Text = list.First().BigPen; _list.First().BillCode = txtBillCode.Text; _list.First().BigPen = txtBigPen.Text; var printBillManager = new ZtoPrintBillManager(BillPrintHelper.DbHelper); // 表示更新 if (!string.IsNullOrEmpty(PrintBillId)) { list.First().Id = BaseBusinessLogic.ConvertToDecimal(PrintBillId); printBillManager.Update(list.First()); MessageUtil.ShowTips("获取成功,已更新本地"); } else { // 新增 printBillManager.Add(list.First(), true); MessageUtil.ShowTips("获取成功,已保存本地"); } } else { MessageUtil.ShowError("全部获取电子面单单号失败"); } } else { // 在默认发件人那边修改个人的商家ID信息 // 获取系统是否有默认发件人,如果有救修改,如果没有就新增 ZtoUserManager userManager = new ZtoUserManager(BillPrintHelper.DbHelper); var userList = userManager.GetList <ZtoUserEntity>(new KeyValuePair <string, object>(ZtoUserEntity.FieldIsDefault, 1), new KeyValuePair <string, object>(ZtoUserEntity.FieldIssendorreceive, 1)); if (!userList.Any()) { XtraMessageBox.Show("系统未绑定默认发件人和商家ID,请进行绑定", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); FrmAddSendMan addSendMan = new FrmAddSendMan(); addSendMan.ShowDialog(); addSendMan.Dispose(); } else { XtraMessageBox.Show("默认发件人未绑定商家ID,请进行绑定", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); FrmAddSendMan frmSendMan = new FrmAddSendMan { Id = userList.First().Id.ToString() }; frmSendMan.ShowDialog(); frmSendMan.Dispose(); } } }
/// <summary> /// 构建打印实体 /// </summary> /// <returns></returns> private ZtoPrintBillEntity BuildPrintBillEntity() { ZtoPrintBillEntity printBillEntity = null; if (!string.IsNullOrEmpty(SelectedId)) { printBillEntity = _printBillManager.GetObject(SelectedId); } if (printBillEntity == null) { // 表示新增 printBillEntity = new ZtoPrintBillEntity { SendMan = txtSendMan.Text.Trim(), SendDeparture = txtSendDeparture.Text.Trim(), SendAddress = txtSendAddress.Text.Trim(), SendPhone = txtSendPhone.Text.Trim(), SendCompany = txtSendCompany.Text.Trim(), SendDate = "", ReceiveMan = txtReceiveMan.Text.Trim(), ReceiveDestination = txtReceiveDestination.Text.Trim(), ReceiveAddress = txtReceiveAddress.Text.Trim(), ReceiveCompany = txtReceiveCompany.Text.Trim(), ReceivePhone = txtReceivePhone.Text.Trim(), TotalNumber = string.IsNullOrEmpty(txtNumber.Text.Trim()) ? "" : txtNumber.Text, Remark = txtRemark.Text.Trim(), Weight = string.IsNullOrEmpty(txtWeight.Text.Trim()) ? "" : txtWeight.Text, TranFee = txtGoodsPayMent.Text.Trim(), GoodsName = txtGoodsName.Text, }; printBillEntity.GOODS_PAYMENT = BaseBusinessLogic.ConvertToDecimal(txtGoodsPayMent.Text); } else { // 修改 printBillEntity.SendMan = txtSendMan.Text.Trim(); printBillEntity.SendDeparture = txtSendDeparture.Text.Trim(); printBillEntity.SendAddress = txtSendAddress.Text.Trim(); printBillEntity.SendPhone = txtSendPhone.Text.Trim(); printBillEntity.SendCompany = txtSendCompany.Text.Trim(); printBillEntity.SendDate = ""; printBillEntity.ReceiveMan = txtReceiveMan.Text.Trim(); printBillEntity.ReceiveDestination = txtReceiveDestination.Text.Trim(); printBillEntity.ReceiveAddress = txtReceiveAddress.Text.Trim(); printBillEntity.ReceiveCompany = txtReceiveCompany.Text.Trim(); printBillEntity.ReceivePhone = txtReceivePhone.Text.Trim(); printBillEntity.TotalNumber = string.IsNullOrEmpty(txtNumber.Text.Trim()) ? "" : txtNumber.Text; printBillEntity.Remark = txtRemark.Text.Trim(); printBillEntity.Weight = string.IsNullOrEmpty(txtWeight.Text.Trim()) ? "" : txtWeight.Text; printBillEntity.TranFee = txtGoodsPayMent.Text.Trim(); printBillEntity.GoodsName = txtGoodsName.Text; } if (ckTodaySend.Checked) { printBillEntity.SendDate = DateTime.Now.ToString(BaseSystemInfo.DateFormat); } else { printBillEntity.SendDate = txtSendDate.Text; } if (!string.IsNullOrEmpty(dgvSearchSendArea.Text.Trim())) { var sendAreaArray = dgvSearchSendArea.Text.Split('-'); printBillEntity.SendProvince = sendAreaArray[0]; printBillEntity.SendCity = sendAreaArray[1]; printBillEntity.SendCounty = sendAreaArray[2]; } if (!string.IsNullOrEmpty(dgvSearchReceiveArea.Text.Trim())) { var receiveAreaArray = dgvSearchReceiveArea.Text.Split('-'); printBillEntity.ReceiveProvince = receiveAreaArray[0]; printBillEntity.ReceiveCity = receiveAreaArray[1]; printBillEntity.ReceiveCounty = receiveAreaArray[2]; } printBillEntity.BigPen = txtPrintMark.Text.Trim(); return(printBillEntity); }
/// <summary> /// 导入Excel数据到本地数据库 /// </summary> public bool Import() { if (string.IsNullOrEmpty(txtFileFullPath.Text.Trim())) { XtraMessageBox.Show(@"请选择录单模板", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); btnOpenExcel_Click(this, null); return(false); } if (!File.Exists(txtFileFullPath.Text)) { XtraMessageBox.Show(@"选中文件不存在,请重新选择导入Excel文件", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Information); btnOpenExcel_Click(this, null); return(false); } var startDateTime = DateTime.Now; StartDt = startDateTime; if (!splashScreenManagerImportExcel.IsSplashFormVisible) { splashScreenManagerImportExcel.ShowWaitForm(); } Application.DoEvents(); splashScreenManagerImportExcel.SetWaitFormCaption("请稍后"); splashScreenManagerImportExcel.SetWaitFormDescription("开始导入Excel数据..."); try { DataTable chooseDt = ExcelHelper.ExcelToDataTable(txtFileFullPath.Text.Trim(), 38, 0, 3); if (chooseDt != null && chooseDt.Rows.Count > 0) { var list = new List <ZtoPrintBillEntity>(); int temp = 0; var defaultUserList = new ZtoUserManager(BillPrintHelper.DbHelper).GetList <ZtoUserEntity>(new KeyValuePair <string, object>(ZtoUserEntity.FieldIsDefault, 1), new KeyValuePair <string, object>(ZtoUserEntity.FieldIssendorreceive, 1)); ZtoUserEntity defaultUserEntity = null; if (defaultUserList.Any()) { defaultUserEntity = defaultUserList.First(); } foreach (DataRow dr in chooseDt.Rows) { ++temp; splashScreenManagerImportExcel.SetWaitFormDescription(string.Format("正在导入Excel数据:{0}/{1}", temp, chooseDt.Rows.Count)); ZtoPrintBillEntity entity = new ZtoPrintBillEntity(); if (ckTodaySend.Checked) { entity.SendDate = DateTime.Now.ToString(BaseSystemInfo.DateFormat); } if (ckUserDefaultSendMan.Checked) { if (defaultUserEntity != null) { entity.SendMan = defaultUserEntity.Realname; entity.SendPhone = defaultUserEntity.Mobile + " " + defaultUserEntity.TelePhone; entity.SendProvince = defaultUserEntity.Province; entity.SendCity = defaultUserEntity.City; entity.SendCounty = defaultUserEntity.County; entity.SendAddress = defaultUserEntity.Address; entity.SendSite = ""; entity.SendDeparture = entity.SendProvince; entity.SendCompany = defaultUserEntity.Company; entity.SendDepartment = defaultUserEntity.Department; entity.SendPostcode = defaultUserEntity.Postcode; } } else { if (this.Tag != null) { var sendUserEntity = this.Tag as ZtoUserEntity; // 表示选择了一个发件人的信息,这样也不用读取Excel里面的发件人了 if (sendUserEntity != null) { entity.SendMan = sendUserEntity.Realname; entity.SendPhone = sendUserEntity.Mobile + " " + sendUserEntity.TelePhone; entity.SendProvince = sendUserEntity.Province; entity.SendCity = sendUserEntity.City; entity.SendCounty = sendUserEntity.County; entity.SendAddress = sendUserEntity.Address; entity.SendSite = ""; entity.SendDeparture = sendUserEntity.Province; entity.SendCompany = sendUserEntity.Company; entity.SendDepartment = sendUserEntity.Department; entity.SendPostcode = sendUserEntity.Postcode; } } else { entity.SendMan = BaseBusinessLogic.ConvertToString(dr[2]); entity.SendPhone = BaseBusinessLogic.ConvertToString(dr[3]); entity.SendProvince = BaseBusinessLogic.ConvertToString(dr[4]); entity.SendCity = BaseBusinessLogic.ConvertToString(dr[5]); entity.SendCounty = BaseBusinessLogic.ConvertToString(dr[6]); entity.SendAddress = BaseBusinessLogic.ConvertToString(dr[7]); entity.SendSite = ""; entity.SendDeparture = BaseBusinessLogic.ConvertToString(dr[26]); if (string.IsNullOrEmpty(entity.SendDeparture)) { entity.SendDeparture = entity.SendProvince; } entity.SendCompany = BaseBusinessLogic.ConvertToString(dr[27]); entity.SendDepartment = BaseBusinessLogic.ConvertToString(dr[28]); entity.SendPostcode = BaseBusinessLogic.ConvertToString(dr[29]); } } entity.ReceiveMan = BaseBusinessLogic.ConvertToString(dr[8]); entity.ReceivePhone = BaseBusinessLogic.ConvertToString(dr[9]); entity.ReceiveProvince = BaseBusinessLogic.ConvertToString(dr[10]); entity.ReceiveCity = BaseBusinessLogic.ConvertToString(dr[11]); entity.ReceiveCounty = BaseBusinessLogic.ConvertToString(dr[12]); entity.ReceiveAddress = BaseBusinessLogic.ConvertToString(dr[13]); entity.ReceiveDestination = BaseBusinessLogic.ConvertToString(dr[30]); if (string.IsNullOrEmpty(entity.ReceiveDestination)) { entity.ReceiveDestination = entity.ReceiveProvince; } entity.ReceiveCompany = BaseBusinessLogic.ConvertToString(dr[31]); entity.ReceivePostcode = BaseBusinessLogic.ConvertToString(dr[32]); entity.GoodsName = BaseBusinessLogic.ConvertToString(dr[14]); entity.Weight = BaseBusinessLogic.ConvertToString(dr[15]); entity.TranFee = BaseBusinessLogic.ConvertToString(dr[16]); entity.GOODS_PAYMENT = BaseBusinessLogic.ConvertToDecimal(dr[17]); entity.TOPAYMENT = BaseBusinessLogic.ConvertToDecimal(dr[18]); entity.Length = BaseBusinessLogic.ConvertToString(dr[33]); entity.Width = BaseBusinessLogic.ConvertToString(dr[34]); entity.Height = BaseBusinessLogic.ConvertToString(dr[35]); entity.TotalNumber = BaseBusinessLogic.ConvertToString(dr[36]); entity.OrderNumber = BaseBusinessLogic.ConvertToString(dr[37]); entity.Remark = BaseBusinessLogic.ConvertToString(dr[22]); entity.CreateUserName = ""; entity.CreateSite = ""; entity.CreateOn = DateTime.Now; entity.PaymentType = "现金"; // 如果Excel里面没有填写订单号系统自动生成一个订单号,这样提取电子面单单号就不用怕了,2016-1-23 14:07:12 if (string.IsNullOrEmpty(entity.OrderNumber)) { // 导入自动生成订单号(电子面单)79170-南昌昌南 18779176845 这个qq提供的思路,2016-1-20 20:08:50 entity.OrderNumber = Guid.NewGuid().ToString("N").ToLower(); } if (!ckGetServerPrintMark.Checked) { entity.BigPen = string.Format("{0} {1} {2}", entity.ReceiveProvince, entity.ReceiveCity, entity.ReceiveCounty); } else { entity.BigPen = ""; } list.Add(entity); } if (!ckGetServerPrintMark.Checked) { var manager = new ZtoPrintBillManager(BillPrintHelper.DbHelper); foreach (ZtoPrintBillEntity ztoPrintBillEntity in list) { manager.Add(ztoPrintBillEntity, true); } if (splashScreenManagerImportExcel != null && splashScreenManagerImportExcel.IsSplashFormVisible) { splashScreenManagerImportExcel.CloseWaitForm(); } GridDataBind(); var ts = DateTime.Now - startDateTime; lblTime.Text = string.Format("耗时:{0}时{1}分{2}秒{3}毫秒", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds); Close(); } else { splashScreenManagerImportExcel.SetWaitFormDescription("正在联网获取大头笔信息,请稍后......"); // 开线程去读取大头笔的 CheckBillCode(list); } } else { XtraMessageBox.Show(@"模板没有填写任何数据,导入失败", AppMessage.MSG0000, MessageBoxButtons.OK, MessageBoxIcon.Error); return(false); } } catch (Exception ex) { ProcessException(ex); return(false); } finally { if (splashScreenManagerImportExcel != null && splashScreenManagerImportExcel.IsSplashFormVisible) { splashScreenManagerImportExcel.CloseWaitForm(); } } return(true); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); if (dr.ContainsColumn(ZtoPrintBillEntity.FieldId)) { Id = BaseBusinessLogic.ConvertToDecimal(dr[ZtoPrintBillEntity.FieldId]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendPostcode)) { SendPostcode = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendPostcode]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceiveMan)) { ReceiveMan = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceiveMan]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceiveProvince)) { ReceiveProvince = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceiveProvince]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldCreateUserName)) { CreateUserName = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldCreateUserName]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldModifiedSite)) { ModifiedSite = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldModifiedSite]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldModifiedUserName)) { ModifiedUserName = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldModifiedUserName]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldPaymentType)) { PaymentType = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldPaymentType]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldLength)) { Length = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldLength]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendMan)) { SendMan = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendMan]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldModifiedOn)) { ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[ZtoPrintBillEntity.FieldModifiedOn]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceiveAddress)) { ReceiveAddress = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceiveAddress]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceivePostcode)) { ReceivePostcode = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceivePostcode]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceivePhone)) { ReceivePhone = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceivePhone]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendDepartment)) { SendDepartment = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendDepartment]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendDate)) { SendDate = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendDate]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendProvince)) { SendProvince = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendProvince]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldTranFee)) { TranFee = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldTranFee]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendDeparture)) { SendDeparture = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendDeparture]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendPhone)) { SendPhone = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendPhone]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendCity)) { SendCity = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendCity]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldGoodsName)) { GoodsName = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldGoodsName]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldWeight)) { Weight = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldWeight]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldHeight)) { Height = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldHeight]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceiveCounty)) { ReceiveCounty = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceiveCounty]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceiveDestination)) { ReceiveDestination = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceiveDestination]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendCompany)) { SendCompany = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendCompany]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldCreateOn)) { CreateOn = BaseBusinessLogic.ConvertToDateTime(dr[ZtoPrintBillEntity.FieldCreateOn]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldBillCode)) { BillCode = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldBillCode]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldTotalNumber)) { TotalNumber = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldTotalNumber]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldRemark)) { Remark = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldRemark]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldCreateSite)) { CreateSite = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldCreateSite]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendSite)) { SendSite = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendSite]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldWidth)) { Width = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldWidth]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceiveCity)) { ReceiveCity = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceiveCity]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendAddress)) { SendAddress = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendAddress]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldSendCounty)) { SendCounty = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldSendCounty]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldReceiveCompany)) { ReceiveCompany = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldReceiveCompany]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldBigPen)) { BigPen = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldBigPen]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldOrderNumber)) { OrderNumber = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldOrderNumber]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldExpressId)) { ExpressId = BaseBusinessLogic.ConvertToString(dr[ZtoPrintBillEntity.FieldExpressId]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldToPayMent)) { TOPAYMENT = BaseBusinessLogic.ConvertToDecimal(dr[ZtoPrintBillEntity.FieldToPayMent]); } if (dr.ContainsColumn(ZtoPrintBillEntity.FieldGoodsPayMent)) { GOODS_PAYMENT = BaseBusinessLogic.ConvertToDecimal(dr[ZtoPrintBillEntity.FieldGoodsPayMent]); } return(this); }
/// <summary> /// 从数据行读取 /// </summary> /// <param name="dr">数据行</param> protected override BaseEntity GetFrom(IDataRow dr) { GetFromExpand(dr); if (dr.ContainsColumn(ZtoUserEntity.FieldId)) { Id = BaseBusinessLogic.ConvertToDecimal(dr[ZtoUserEntity.FieldId]); } if (dr.ContainsColumn(ZtoUserEntity.FieldPostcode)) { Postcode = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldPostcode]); } if (dr.ContainsColumn(ZtoUserEntity.FieldRealname)) { Realname = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldRealname]); } if (dr.ContainsColumn(ZtoUserEntity.FieldCreateUserName)) { CreateUserName = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldCreateUserName]); } if (dr.ContainsColumn(ZtoUserEntity.FieldCityId)) { CityId = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldCityId]); } if (dr.ContainsColumn(ZtoUserEntity.FieldModifiedUserName)) { ModifiedUserName = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldModifiedUserName]); } if (dr.ContainsColumn(ZtoUserEntity.FieldCreateOn)) { CreateOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[ZtoUserEntity.FieldCreateOn]); } if (dr.ContainsColumn(ZtoUserEntity.FieldDepartment)) { Department = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldDepartment]); } if (dr.ContainsColumn(ZtoUserEntity.FieldProvince)) { Province = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldProvince]); } if (dr.ContainsColumn(ZtoUserEntity.FieldCounty)) { County = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldCounty]); } if (dr.ContainsColumn(ZtoUserEntity.FieldCountyId)) { CountyId = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldCountyId]); } if (dr.ContainsColumn(ZtoUserEntity.FieldRemark)) { Remark = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldRemark]); } if (dr.ContainsColumn(ZtoUserEntity.FieldModifiedOn)) { ModifiedOn = BaseBusinessLogic.ConvertToNullableDateTime(dr[ZtoUserEntity.FieldModifiedOn]); } if (dr.ContainsColumn(ZtoUserEntity.FieldProvinceId)) { ProvinceId = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldProvinceId]); } if (dr.ContainsColumn(ZtoUserEntity.FieldCity)) { City = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldCity]); } if (dr.ContainsColumn(ZtoUserEntity.FieldAddress)) { Address = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldAddress]); } if (dr.ContainsColumn(ZtoUserEntity.FieldIssendorreceive)) { Issendorreceive = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldIssendorreceive]); } if (dr.ContainsColumn(ZtoUserEntity.FieldTelePhone)) { TelePhone = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldTelePhone]); } if (dr.ContainsColumn(ZtoUserEntity.FieldMobile)) { Mobile = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldMobile]); } if (dr.ContainsColumn(ZtoUserEntity.FieldCompany)) { Company = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldCompany]); } if (dr.ContainsColumn(ZtoUserEntity.FieldIsDefault)) { IsDefault = BaseBusinessLogic.ConvertToString(dr[ZtoUserEntity.FieldIsDefault]); } return(this); }