Beispiel #1
0
 public UnicomFreeBuyDetail(SOSIMCardAndContractPhoneInfoVM soSIMCardAndContractPhoneInfoVM, string companyCode)
     : this()
 {
     // 读取枚举 初始化SIM状态
     cmbCertificateType.ItemsSource         = EnumConverter.GetKeyValuePairs <CertificateType>(EnumConverter.EnumAppendItemType.None);
     cmbSIMStatus.ItemsSource               = EnumConverter.GetKeyValuePairs <SIMStatus>(EnumConverter.EnumAppendItemType.None);
     CurrentSOSIMCardAndContractPhoneInfoVM = soSIMCardAndContractPhoneInfoVM;
     #region 加载联通0元购机信息
     if (string.IsNullOrEmpty(CurrentSOSIMCardAndContractPhoneInfoVM.CustomerName))
     {
         new SOQueryFacade().QuerySOSIMCardInfo(CurrentSOSIMCardAndContractPhoneInfoVM.SOSysNo.Value, companyCode, (obj, args) =>
         {
             if (args.FaultsHandle())
             {
                 return;
             }
             CurrentSOSIMCardAndContractPhoneInfoVM = args.Result.Convert <SOSIMCardAndContractPhoneInfo, SOSIMCardAndContractPhoneInfoVM>();
             CurrentSOSIMCardAndContractPhoneInfoVM.ContractPhoneDetailInfoVM = args.Result.ContractPhoneDetailInfo.Convert <SOContractPhoneDetailInfo, SOContractPhoneDetailInfoVM>();
         });
     }
     ECCentral.Portal.Basic.Utilities.UtilityHelper.ReadOnlyControl(gdUnicomFreeBuyDetailInfo, gdUnicomFreeBuyDetailInfo.Children.Count, true);
     ECCentral.Portal.Basic.Utilities.UtilityHelper.ReadOnlyControl(gdUnicomFreeBuyContractPhoneDetailInfo, gdUnicomFreeBuyContractPhoneDetailInfo.Children.Count, true);
     cmbSIMStatus.IsEnabled = true;
     txtMemo.IsReadOnly     = false;
     #endregion
 }
        public ContractPhoneDetail(SOSIMCardAndContractPhoneInfoVM soSIMCardAndContractPhoneInfoVM, string companyCode)
            : this()
        {
            // 读取枚举 初始化SIM状态
            cmbCertificateType.ItemsSource = EnumConverter.GetKeyValuePairs <CertificateType>(EnumConverter.EnumAppendItemType.None);

            //非未激活状态的不能加载未激活
            var statusList = EnumConverter.GetKeyValuePairs <SIMStatus>(EnumConverter.EnumAppendItemType.None);

            if (soSIMCardAndContractPhoneInfoVM.SIMStatus != SIMStatus.Original)
            {
                statusList.RemoveAll(p => p.Key == SIMStatus.Original);
            }
            cmbSIMStatus.ItemsSource = statusList;

            CurrentSOSIMCardAndContractPhoneInfoVM = soSIMCardAndContractPhoneInfoVM;
            #region 加载合约机信息
            if (string.IsNullOrEmpty(CurrentSOSIMCardAndContractPhoneInfoVM.CustomerName))
            {
                new SOQueryFacade().QuerySOSIMCardInfo(CurrentSOSIMCardAndContractPhoneInfoVM.SOSysNo.Value, companyCode, (obj, args) =>
                {
                    if (args.FaultsHandle())
                    {
                        return;
                    }
                    CurrentSOSIMCardAndContractPhoneInfoVM = args.Result.Convert <SOSIMCardAndContractPhoneInfo, SOSIMCardAndContractPhoneInfoVM>();
                });
            }
            ECCentral.Portal.Basic.Utilities.UtilityHelper.ReadOnlyControl(gdContractPhoneDetailInfo, gdContractPhoneDetailInfo.Children.Count, true);
            cmbSIMStatus.IsEnabled = true;
            txtMemo.IsReadOnly     = false;
            #endregion

            Loaded += new RoutedEventHandler(ContractPhoneDetail_Loaded);
        }
Beispiel #3
0
 private void Button_SIMCard_Save_Click(object sender, RoutedEventArgs e)
 {
     CurrentSIMCardAndContractPhoneInfoVM = this.gdSIMCardInfo.DataContext as SOSIMCardAndContractPhoneInfoVM;
     bool flag = ValidationManager.Validate(this.gdSIMCardInfo);
     if (!CurrentSIMCardAndContractPhoneInfoVM.HasValidationErrors && flag)
     {
         //新增的时候由父窗口执行真正的保存操作                  
         CloseDialog(new ResultEventArgs
         {
             DialogResult = DialogResultType.OK,
             Data = CurrentSIMCardAndContractPhoneInfoVM
         });
     }
 }