public bool SetManagerExchangeUnitInfo(LoggingManager loggingManager, UnitInfo unitInfo, int TypeId) { try { UnitInfo utInfo = new UnitInfo(); if (TypeId.ToString().Equals("1") || TypeId.ToString().Equals("2")) { if (unitInfo.CityId != null && (!unitInfo.CityId.Equals(""))) { //获取城市 CityService cityService = new CityService(); CityInfo cityInfo = new CityInfo(); cityInfo = cityService.GetCityById(loggingManager, unitInfo.CityId); utInfo.ProvinceName = cityInfo.City1_Name; utInfo.CityName = cityInfo.City3_Name; utInfo.StateName = cityInfo.City2_Name; } utInfo.Id = unitInfo.Id; utInfo.Code = unitInfo.Code; utInfo.Name = unitInfo.Name; utInfo.EnglishName = unitInfo.EnglishName; utInfo.ShortName = unitInfo.ShortName; utInfo.Address = unitInfo.Address; utInfo.Postcode = unitInfo.Postcode; utInfo.Contact = unitInfo.Contact; utInfo.Telephone = unitInfo.Telephone; utInfo.Fax = unitInfo.Fax; utInfo.Email = unitInfo.Email; utInfo.Remark = unitInfo.Remark; utInfo.Status_Desc = unitInfo.Status_Desc; utInfo.longitude = unitInfo.longitude; utInfo.dimension = unitInfo.dimension; } if (TypeId.ToString().Equals("3") || TypeId.ToString().Equals("4")) { utInfo.Id = unitInfo.Id; utInfo.Status_Desc = unitInfo.Status_Desc; } string strUnitInfo = cXMLService.Serialiaze(utInfo); cPos.WebServices.CustomerDataExchangeWebService.CustomerDataExchangeService cdxService = new WebServices.CustomerDataExchangeWebService.CustomerDataExchangeService(); cdxService.Url = System.Configuration.ConfigurationManager.AppSettings["ap_url"] + "/customer/CustomerDataExchangeService.asmx"; return(cdxService.SynUnit(loggingManager.Customer_Id, TypeId, strUnitInfo)); } catch (Exception ex) { throw (ex); } }
//存储表单数据。 private UnitInfo SaveUnitData() { UnitInfo ui = new UnitInfo(); if (!string.IsNullOrEmpty(this.Request.Params["unit_id"])) { ui = (new UnitService()).GetUnitById(loggingSessionInfo, this.Request.Params["unit_id"].ToString()); //ui.Parent_Unit_Id = this.selParentUnit.Text; ui.Parent_Unit_Id = this.drpUnit.SelectedValue; ui.Code = this.tbUnitCode.Text; ui.Name = this.tbUnitName.Text; ui.EnglishName = this.tbUnitNameEn.Text; ui.ShortName = this.tbUnitShortName.Text; ui.TypeId = ddlUnitType.SelectedValue; //ui.TypeName = ddlUnitType.SelectedItem.ToString(); ui.CityId = (DropDownTree1.SelectedValue ?? "").Split(',')[0]; var service = new cPos.Service.CityService(); var city = service.GetCityInfoList(loggingSessionInfo).Where(obj => obj.City_Id == ui.CityId).FirstOrDefault(); ui.CityName = city.City1_Name + city.City2_Name + city.City3_Name; ui.Modify_Time = new BaseService().GetCurrentDateTime(); ui.Modify_User_Id = loggingSessionInfo.CurrentUser.User_Id; ui.Address = this.tbAddress.Text; ui.Postcode = this.tbPostcode.Text; ui.Contact = this.tbContact.Text; ui.Telephone = this.tbTelephone.Text; ui.Fax = this.tbFax.Text; ui.Email = this.tbEmail.Text; ui.Remark = this.tbRemark.Text; ui.dimension = this.tbDimension.Text; ui.longitude = this.tbLongitude.Text; } else { ui.TypeId = ddlUnitType.SelectedValue; ui.Parent_Unit_Id = this.drpUnit.SelectedValue; ui.Code = this.tbUnitCode.Text; ui.Id = null; ui.Create_Time = new BaseService().GetCurrentDateTime(); ui.Create_User_Id = loggingSessionInfo.CurrentUser.User_Id; ui.Name = this.tbUnitName.Text; ui.EnglishName = this.tbUnitNameEn.Text; ui.ShortName = this.tbUnitShortName.Text; ui.TypeId = ddlUnitType.SelectedValue; //ui.TypeName = ddlUnitType.SelectedItem.ToString(); ui.CityId = DropDownTree1.SelectedValue; var service = new cPos.Service.CityService(); var city = service.GetCityById(loggingSessionInfo, ui.CityId); ui.CityName = city.City1_Name + city.City2_Name + city.City3_Name; ui.Address = this.tbAddress.Text; ui.Postcode = this.tbPostcode.Text; ui.Contact = this.tbContact.Text; ui.Telephone = this.tbTelephone.Text; ui.Fax = this.tbFax.Text; ui.Email = this.tbEmail.Text; ui.Remark = this.tbRemark.Text; ui.dimension = this.tbDimension.Text; ui.longitude = this.tbLongitude.Text; } //属性 ui.PropertyList = GetUnitPropFormUI(); return(ui); }