コード例 #1
0
        private bool VerifyAssignFreq(List <ActivityEquipment> equs, bool isSaveFreqVerify)
        {
            bool          result   = true;
            StringBuilder errormsg = new StringBuilder();

            if (equs.Count == 0)
            {
                MessageBox.Show("请勾选要指配频率的设备");
                return(false);
            }
            foreach (ActivityEquipment equ in equs)
            {
                EquipmentInspection equipmentInspection = EquipmentInspectionItemsSource.Where(p => p.ActivityEquipment == equ).ToList().FirstOrDefault();
                if (equ.AssignSendFreq == null)
                {
                    result = false;
                    errormsg.AppendFormat(string.Format("{0}指配频率为空 \n", equ.Name), "提示");
                }
            }
            if (!result)
            {
                MessageBox.Show(errormsg.ToString());
            }
            return(result);
        }
コード例 #2
0
        private string GetPropertyValue(string propertyname, EquipmentInspection equ)
        {
            switch (propertyname)
            {
            case "用户信息":
                return(equ.ApplyPerson);

            case "单位名称":
                return(equ.ApplyORG);

            case "设备名称":
                return(equ.ActivityEquipment.Name);

            case "设备编号":
                return(equ.ActivityEquipment.EquModel);

            case "有效期":
                string str = string.Empty;
                if (equ.RunningFrom != null)
                {
                    str += equ.RunningFrom.Value.ToShortDateString();
                }
                if (equ.RunningTo != null)
                {
                    str += " 至 " + equ.RunningTo.Value.ToShortDateString();
                }
                return(str);

            case "使用区域":
                return(equ.ApplyArea);
            }
            return(null);
        }
コード例 #3
0
        private bool ValidEquipmentInspection(EquipmentInspection equipmentInspection)
        {
            StringBuilder errormsg = new StringBuilder();
            bool          result   = true;

            if (equipmentInspection != null)
            {
                if (string.IsNullOrEmpty(equipmentInspection.ApplyPerson))
                {
                    errormsg.AppendLine("申请人姓名不能为空");
                    result = false;
                }

                if (string.IsNullOrEmpty(equipmentInspection.ApplyPersonNo))
                {
                    errormsg.AppendLine("申请人姓身份证号不能为空");
                    result = false;
                }

                if (string.IsNullOrEmpty(equipmentInspection.ApplyORG))
                {
                    errormsg.AppendLine("申请单位不能为空");
                    result = false;
                }

                if (string.IsNullOrEmpty(equipmentInspection.EquManufacturer))
                {
                    errormsg.AppendLine("设备生产厂商不能为空");
                    result = false;
                }
                if (equipmentInspection.RunningFrom == null)
                {
                    errormsg.AppendLine("申请使用时间开始不能为空");
                    result = false;
                }
                if (equipmentInspection.RunningTo == null)
                {
                    errormsg.AppendLine("申请使用时间结束不能为空");
                    result = false;
                }

                if (equipmentInspection.CheckState == CheckStateEnum.UnQualified)
                {
                    if (string.IsNullOrEmpty(equipmentInspection.InspectionDescription))
                    {
                        errormsg.AppendLine("请输入检测结果描述");
                        result = false;
                    }
                }
                if (!result)
                {
                    MessageBox.Show(errormsg.ToString(), "验证失败");
                }
                return(result);
            }
            return(false);
        }
コード例 #4
0
 private void equipmentInspectionListControl_EquInspectionSelectionChanged(EquipmentInspection obj)
 {
     if (obj != null)
     {
         obj.ApplyArea = this.CurrentActivityPlace.Name;
         SelectedEquipmentInspection    = obj;
         DataContextEquipmentInspection = AT_BC.Data.Helpers.DataContractSerializeHelper.Clone <EquipmentInspection>(obj);
         equipmentInspectionDetailControl.DataContext = DataContextEquipmentInspection;
     }
 }
コード例 #5
0
 private void UpdateUI(EquipmentInspection equ)
 {
     EquipmentInspectionSelected.ApplyPerson           = equ.ApplyPerson;
     EquipmentInspectionSelected.ApplyPersonNo         = equ.ApplyPersonNo;
     EquipmentInspectionSelected.ApplyORG              = equ.ApplyORG;
     EquipmentInspectionSelected.EquManufacturer       = equ.EquManufacturer;
     EquipmentInspectionSelected.FreqUENCYNO           = equ.FreqUENCYNO;
     EquipmentInspectionSelected.RunningFrom           = equ.RunningFrom;
     EquipmentInspectionSelected.RunningTo             = equ.RunningTo;
     EquipmentInspectionSelected.ApplyArea             = equ.ApplyArea;
     EquipmentInspectionSelected.Remark                = equ.Remark;
     EquipmentInspectionSelected.CheckState            = equ.CheckState;
     EquipmentInspectionSelected.InspectionDescription = equ.InspectionDescription;
     EquipmentInspectionSelected.SendLicense           = equ.SendLicense;
 }
コード例 #6
0
 private byte[] CreateQRCode(EquipmentInspection equ)
 {
     if (this.QRCodeFields != null && QRCodeFields.Count > 0)
     {
         StringBuilder str = new StringBuilder();
         foreach (string field in QRCodeFields)
         {
             string value = field.Replace(" ", "");
             str.AppendLine(string.Format("{0}:{1}", field, GetPropertyValue(value, equ)));
         }
         try
         {
             return(FreqStationHelper.CreateQRCode(str.ToString()));
         }
         catch (Exception)
         {
             return(null);
         }
     }
     return(null);
 }
コード例 #7
0
 private void btnCancel_Click(object sender, RoutedEventArgs e)
 {
     if (SelectedEquipmentInspection != null)
     {
         DataContextEquipmentInspection.ApplyPerson           = SelectedEquipmentInspection.ApplyPerson;
         DataContextEquipmentInspection.ApplyPersonNo         = SelectedEquipmentInspection.ApplyPersonNo;
         DataContextEquipmentInspection.ApplyORG              = SelectedEquipmentInspection.ApplyORG;
         DataContextEquipmentInspection.EquManufacturer       = SelectedEquipmentInspection.EquManufacturer;
         DataContextEquipmentInspection.FreqUENCYNO           = SelectedEquipmentInspection.FreqUENCYNO;
         DataContextEquipmentInspection.RunningFrom           = SelectedEquipmentInspection.RunningFrom;
         DataContextEquipmentInspection.RunningTo             = SelectedEquipmentInspection.RunningTo;
         DataContextEquipmentInspection.ApplyArea             = SelectedEquipmentInspection.ApplyArea;
         DataContextEquipmentInspection.Remark                = SelectedEquipmentInspection.Remark;
         DataContextEquipmentInspection.CheckState            = SelectedEquipmentInspection.CheckState;
         DataContextEquipmentInspection.InspectionDescription = SelectedEquipmentInspection.InspectionDescription;
     }
     else
     {
         DataContextEquipmentInspection = new EquipmentInspection();
         equipmentInspectionDetailControl.DataContext = DataContextEquipmentInspection;
     }
 }
コード例 #8
0
        void EquipmentInspectionDetailControl_DataContextChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            EquipmentInspection equinspection = this.DataContext as EquipmentInspection;

            if (equinspection != null)
            {
                if (equinspection.CheckState == CheckStateEnum.Qualified)
                {
                    this.rabInspection.IsChecked   = true;
                    this.rabUnInspection.IsChecked = false;
                }
                else if (equinspection.CheckState == CheckStateEnum.UnQualified)
                {
                    this.rabUnInspection.IsChecked = true;
                    this.rabInspection.IsChecked   = false;
                }
                else
                {
                    this.rabInspection.IsChecked   = false;
                    this.rabUnInspection.IsChecked = false;
                }
            }
        }