private void Companydatagrid_DoubleClick(object sender, MouseButtonEventArgs e) { if (this.companydatagrid.SelectedItem != null) { ORGInfo selectcompany = this.companydatagrid.SelectedItem as ORGInfo; CompanyDetailDialog detail = new CompanyDetailDialog(selectcompany); detail.ShowDialog(this); } }
private void BtnAdd_Click(object sender, RoutedEventArgs e) { IsAdd = true; this.ORGDataContext = new ORGInfo(); FrozenControls(true); if (BeginAddEvent != null) { BeginAddEvent(); } }
private void Reset() { this.ORGDataContext = BackUpORG; //this.txtName.Text = null; //this.txtShortName.Text = null; //this.txtAddress.Text = null; //this.combClass.SelectedValue = null; //this.txtContact.Text = null; //this.txtPhone.Text = null; }
/// <summary> /// 对组织信息进行转换 /// </summary> /// <param name="orginfo"></param> /// <returns></returns> private ActivityORGInfo ConvertToActivityORGInfo(ORGInfo orginfo) { ActivityORGInfo activityOrginfo = new ActivityORGInfo(); activityOrginfo.Guid = orginfo.Guid; activityOrginfo.Activity_Guid = Client.RiasPortal.ModuleContainer.Activity.Guid; activityOrginfo.Address = orginfo.Address.Trim(); activityOrginfo.Contact = orginfo.Contact.Trim(); activityOrginfo.Name = orginfo.Name.Trim(); activityOrginfo.Phone = orginfo.Phone.Trim(); activityOrginfo.Securityclass.Guid = orginfo.Securityclass.Guid.Trim(); activityOrginfo.Securityclass.Name = orginfo.Securityclass.Name.Trim(); activityOrginfo.ShortName = orginfo.ShortName.Trim(); return(activityOrginfo); }
private void SaveORG() { ORGInfo orginfo = ORGDataContext; orginfo.Name = this.txtName.Text; if (Validate(orginfo)) { //PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA.Setting.I_CO_IA_Setting>(channel => //{ // channel.SaveORGInfo(ORGDataContext); // MessageBox.Show("保存成功!", "提示", MessageBoxButton.OK); // FrozenControls(false); // if (AfterSaveEvent != null) // { // AfterSaveEvent(); // } //}); } }
private ORGInfo GetORGInfos(DataTable orgTable) { #region 单位信息 ORGInfo orginfo = new ORGInfo(); if (orgTable.Columns.Contains("ORG_NAME")) { orginfo.Name = orgTable.Rows[0]["ORG_NAME"].ToString();//单位名称 } else { orginfo.Name = ""; } //if (orgTable.Columns.Contains("ORG_CODE")) //{ // this.tb_UnitCode.Text = orgTable.Rows[0]["ORG_CODE"].ToString();//组织机构代码 //} //else //{ // this.tb_UnitCode.Text = ""; //} if (orgTable.Columns.Contains("ORG_ADDR")) { orginfo.Address = orgTable.Rows[0]["ORG_ADDR"].ToString();//单位地址 } if (orgTable.Columns.Contains("ORG_LINK_PERSON")) { orginfo.Contact = orgTable.Rows[0]["ORG_LINK_PERSON"].ToString();//单位联系人 } if (orgTable.Columns.Contains("ORG_PHONE")) { orginfo.Phone = orgTable.Rows[0]["ORG_PHONE"].ToString();//联系电话 } return(orginfo); #endregion }
private bool Validate(ORGInfo orginfo) { bool issuccess = true; StringBuilder strmsg = new StringBuilder(); if (string.IsNullOrEmpty(orginfo.Name)) { issuccess = false; strmsg.Append("单位名称不能为空! \r"); } if (string.IsNullOrEmpty(orginfo.ShortName)) { issuccess = false; strmsg.Append("单位简称不能为空! \r"); } if (string.IsNullOrEmpty(orginfo.Address)) { issuccess = false; strmsg.Append("单位地址不能为空! \r"); } if (string.IsNullOrEmpty(orginfo.Contact)) { issuccess = false; strmsg.Append("联系人不能为空! \r"); } if (string.IsNullOrEmpty(orginfo.Phone)) { issuccess = false; strmsg.Append("联系电话不能为空! \r"); } if (!string.IsNullOrEmpty(strmsg.ToString())) { MessageBox.Show(strmsg.ToString(), "提示", MessageBoxButton.OK); } return(issuccess); }
public CompanyDetailDialog(ORGInfo company) { InitializeComponent(); this.DataContext = company; }
/// <summary> /// 转换相关设备类 /// </summary> /// <param name="result"></param> /// <returns></returns> private ActivityEquipmentInfo ConvertToActivityEquipmentInfo(EquipmentInfo tempInfo) { #region 保存组织信息 ORGInfo orginfo = new ORGInfo(); //PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke<I_CO_IA.Setting.I_CO_IA_Setting>(channel => //{ // orginfo = channel.GetORGInfoByGuid(tempInfo.ORG.Guid); //}); ActivityORGInfo activityOrginfo = ConvertToActivityORGInfo(orginfo); ActivityORGInfo tempOrginfo = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, ActivityORGInfo>(channel => { return(channel.GetORGInfoByActivityORGInfo(activityOrginfo)); }); if (tempOrginfo != null && string.IsNullOrEmpty(tempOrginfo.Activity_Guid) == false) { activityOrginfo = tempOrginfo; } bool result = PT_BS_Service.Client.Framework.BeOperationInvoker.Invoke <I_CO_IA.FreqPlan.I_CO_IA_FreqPlan, bool>(channel => { return(channel.SaveORGInfo(activityOrginfo)); }); #endregion ActivityEquipmentInfo aeuip = new ActivityEquipmentInfo(); aeuip.GUID = CO_IA.Client.Utility.NewGuid(); aeuip.ActivityGuid = Client.RiasPortal.ModuleContainer.Activity.Guid; aeuip.PlaceGuid = activityPlaceInfo.Guid; aeuip.ORGGuid = tempInfo.ORG.Guid; aeuip.ADJChannelInh = tempInfo.RecivePara.ADJChannelInh; //aeuip.AssignFreq = tempInfo.RecivePara.Ant.AssignFreq; aeuip.Band = tempInfo.SendPara.Band; aeuip.ChannelBand = tempInfo.SendPara.ChannelBand; aeuip.CoChnPro = tempInfo.RecivePara.CoChnPro; aeuip.EQUCount = tempInfo.EQUCount; aeuip.EquModel = tempInfo.EquModel; aeuip.EquNo = tempInfo.EquNo; //aeuip.IsChecked = tempInfo.RecivePara.ADJChannelInh; aeuip.IsMobile = tempInfo.IsMobile; aeuip.IsStation = tempInfo.IsStation; aeuip.IsTunAble = tempInfo.SendPara.IsTunAble; aeuip.Leakage = tempInfo.RecivePara.ADJChannelInh; aeuip.MaxPower = tempInfo.SendPara.MaxPower; #warning 需要处理调制方式为空情况 if (tempInfo.SendPara.ModulateMode.HasValue) { aeuip.ModulateMode = tempInfo.SendPara.ModulateMode.Value; } aeuip.Name = tempInfo.Name; aeuip.Origin = 1;//设备库录入 aeuip.ReceiveFreq = tempInfo.RecivePara.ReceiveFreq; aeuip.RecvAntAzimuth = tempInfo.RecivePara.Ant.AntAzimuth; aeuip.RecvAntElevation = tempInfo.RecivePara.Ant.AntElevation; aeuip.RecvAntFeedLength = tempInfo.RecivePara.Ant.FeedLength; aeuip.RecvAntFeedLoss = tempInfo.RecivePara.Ant.FeedLose; aeuip.RecvAntGain = tempInfo.RecivePara.Ant.AntGain; aeuip.RecvAntHeight = tempInfo.RecivePara.Ant.AntHight; aeuip.RecvAntModel = tempInfo.RecivePara.Ant.AntModel; aeuip.RecvAntPolar = tempInfo.RecivePara.Ant.AntPolar; aeuip.RecvFreqEnd = tempInfo.RecivePara.FreqEnd; aeuip.RecvFreqStart = tempInfo.RecivePara.FreqStart; aeuip.Remark = tempInfo.Remark; //aeuip.RunningFrom = tempInfo.RecivePara.ADJChannelInh; //aeuip.RunningTo = tempInfo.RecivePara.ADJChannelInh; aeuip.SendAntAzimuth = tempInfo.SendPara.Ant.AntAzimuth; aeuip.SendAntElevation = tempInfo.SendPara.Ant.AntElevation; aeuip.SendAntFeedLength = tempInfo.SendPara.Ant.FeedLength; aeuip.SendAntFeedLoss = tempInfo.SendPara.Ant.FeedLose; aeuip.SendAntGain = tempInfo.SendPara.Ant.AntGain; aeuip.SendAntHeight = tempInfo.SendPara.Ant.AntHight; aeuip.SendAntModel = tempInfo.SendPara.Ant.AntModel; aeuip.SendAntPolar = tempInfo.SendPara.Ant.AntPolar; aeuip.SendFreq = tempInfo.SendPara.SendFreq; aeuip.SendFreqEnd = tempInfo.SendPara.FreqEnd; aeuip.SendFreqStart = tempInfo.SendPara.FreqStart; aeuip.Sensitivity = tempInfo.RecivePara.Sensitivity.GetNullableDouble(); aeuip.SensitivityUnit = tempInfo.RecivePara.SensitivityUnit.GetNullableInt(); aeuip.SignalNoise = tempInfo.RecivePara.SignalNoise; aeuip.StationName = tempInfo.StationName; aeuip.BusinessCode = tempInfo.StClassCode; return(aeuip); }
public static ORGInfo getORGInfo(string ORG_SERIAL) { ORGInfo Result = new ORGInfo(); string SQL = "SELECT *,Case WHEN ORG.ORG_ABBR IS NOT NULL THEN ORG.ORG_NAME + ' ( ' + ORG.ORG_ABBR + ' ) ' ELSE ORG.ORG_NAME END FULL_ORG_NAME"; SQL += " ,CASE WHEN SHOW_FLAG_SEARCH_PERSON IS NOT NULL AND SHOW_FLAG_SEARCH_PERSON=0 THEN 0 ELSE 1 END SHOW_FLAG_SEARCH "; SQL += " FROM CTLT_ORGANIZE ORG WHERE ORG_SERIAL=" + ORG_SERIAL; //string SQL = ""; //SQL += " SELECT ORG.* \n"; //SQL += " ,Case WHEN ORG.ORG_ABBR IS NOT NULL THEN ORG.ORG_NAME + ' ( ' + ORG.ORG_ABBR + ' ) ' ELSE ORG.ORG_NAME END FULL_ORG_NAME \n"; //SQL += " ,ORG_ENG_NAME,ORG_TEL,ORG_FAX,ORG_EMAIL,ORG_CODE_DPIS \n"; //SQL += " FROM ( \n"; //SQL += " SELECT DISTINCT * FROM ( \n"; //SQL += " SELECT ORG_SERIAL \n"; //SQL += " ,ORG_NAME \n"; //SQL += " ,ORG_ABBR \n"; //SQL += " ,ORDER_SEQ,ORG_CLASS \n"; //SQL += " FROM vw_CMN_ORG_ALL \n"; //SQL += " WHERE \n"; //SQL += " ORG_STATUS='A' \n"; //SQL += " AND ORG_LEVEL IN ('3') \n"; //SQL += " AND SHOW_FLAG ='1' \n"; //SQL += " UNION ALL \n"; //SQL += " SELECT ORG_SERIAL,ORG_NAME,ORG_ABBR,ORDER_SEQ,ORG_CLASS FROM vw_CMN_ORG_ALL \n"; //SQL += " WHERE ORG_STATUS='A' \n"; //SQL += " AND ORG_LEVEL IN ('3') \n"; //SQL += " AND [ROOT_LEVEL1] IS NULL \n"; //SQL += " AND [ROOT_LEVEL2] IS NULL \n"; //SQL += " AND [ROOT_LEVEL3] IS NULL \n"; //SQL += " AND [ROOT_LEVEL4] IS NULL \n"; //SQL += " AND [ROOT_LEVEL5] IS NULL \n"; //SQL += " )AS TB \n"; //SQL += " WHERE ORG_ABBR IS NOT NULL \n"; //SQL += " ) AS ORG \n"; //SQL += " INNER JOIN CTLT_ORGANIZE ON CTLT_ORGANIZE.ORG_SERIAL = ORG.ORG_SERIAL \n"; //SQL += " WHERE ORG.ORG_SERIAL='" + ORG_SERIAL + "' \n"; //SQL += " ORDER BY ORG.ORDER_SEQ, ORG.ORG_CLASS \n"; SqlDataAdapter da = new SqlDataAdapter(SQL, DefaultConnectionString); DataTable dt = new DataTable(); da.Fill(dt); if (dt.Rows.Count == 0) return Result; //----------------------ใช้ดารดึงแบบเดิม---------------- //Result.FULL_ORG_NAME = dt.Rows[0]["FULL_ORG_NAME"].ToString(); Result.FULL_ORG_NAME = dt.Rows[0]["FULL_ORG_NAME"].ToString(); Result.ORG_ENG_NAME = dt.Rows[0]["ORG_ENG_NAME"].ToString(); Result.ORG_TEL = dt.Rows[0]["ORG_TEL"].ToString(); Result.ORG_FAX = dt.Rows[0]["ORG_FAX"].ToString(); Result.ORG_EMAIL = dt.Rows[0]["ORG_EMAIL"].ToString(); Result.ORG_EXT = dt.Rows[0]["ORG_EXT"].ToString(); if (dt.Rows[0]["SHOW_FLAG_SEARCH"].ToString() == "0") { Result.SHOW_FLAG_SEARCH_PERSON = false; } else { Result.SHOW_FLAG_SEARCH_PERSON = true ; } return Result; }