Пример #1
0
 public static void ShowCellProperties(IAppTaxCell aCell, IAppTaxApplicationService aApplication)
 {
     using (var form = new CellPropertieForm())
     {
         form.FCell               = aCell;
         form.FFormName           = aApplication.UFL.GetFormByFormNumber(((int)aCell.GetFormNum())).FormNAme;
         form.FReturn             = aApplication.GetCurrentDocReturn();
         form.txtName.Text        = aCell.GetCellNameWithGroup();
         form.lblType.Text        = aCell.GetCellTypeText();
         form.lblDefaultForm.Text = aCell.GetOwnerTaxData().GetFormName(aCell.GetFormNum());
         var lStringValue = "";
         if (aCell.ConvertToString(ref lStringValue))
         {
             form.txtValue.Text = lStringValue;
         }
         else
         {
             form.txtValue.Text = "";
         }
         form.cbHasInput.Checked            = aCell.HasInput();
         form.cbHasCalc.Checked             = aCell.HasCalc();
         form.cbHasImport.Checked           = aCell.IsImported();
         form.cbIsEmpty.Checked             = aCell.IsEmpty();
         form.cbIsEstimated.Checked         = aCell.IsEstimated();
         form.cbIsTracking.Checked          = aCell.IsTracking();
         form.cbHasFormNum.Checked          = aCell.HasFormNum();
         form.cbHasInternalOvrd.Checked     = aCell.HasInternalOvrd();
         form.cbHasRolledValue.Checked      = aCell.HasRolledValue();
         form.cbHasUserOvrd.Checked         = aCell.HasUserOvrd();
         form.cbIsPositiveOnly.Checked      = aCell.IsPositiveOnly();
         form.cbIsNA.Checked                = aCell.IsNA();
         form.cbIsSourceEstimate.Checked    = aCell.IsSourceEstimate();
         form.cbIsProtected.Checked         = aCell.IsProtected();
         form.cbHasRolledValue.Checked      = aCell.HasRolledValue();
         form.cbIsSelectable.Checked        = aCell.IsSelectable();
         form.cbIsRoundOnAssign.Checked     = aCell.IsRoundOnAssign();
         form.cbIsDeprecated.Checked        = aCell.IsDeprecated();
         form.cbHasTransferredValue.Checked = aCell.HasTransferredValue();
         form.cbIsLinkCell.Checked          = aCell.IsLinkCell();
         var  formNum  = aCell.GetFormNum();
         var  ufl      = aApplication.UFL;
         var  frm      = ufl.GetFormByFormNumber((int)formNum);
         var  formName = frm.FormNAme;
         var  LXlat    = aCell.GetAssociatedStringTable();
         uint repeatNum;
         var  group = aCell.GetOwnerTaxData().GetRepeatById(aCell.GetOwnerRepeatId(), out repeatNum);
         var  cells = "";
         for (uint iCellNum = 0; iCellNum < group.GetNumCells(); ++iCellNum)
         {
             var newCell = group.GetCellFromRepeat(iCellNum, repeatNum);
             cells += newCell.GetCellNameWithGroup() + "\r\n";
         }
         form.txtCells.Text = cells;
         if (LXlat >= 0)
         {
             form.lblXlatEnum.Text = LXlat.ToString();
             form.FillXLatCombo(form.cbXlatEng0, AppLanguage.lEnglish, 0, aCell, aApplication);
             form.FillXLatCombo(form.cbXlatEng1, AppLanguage.lEnglish, 1, aCell, aApplication);
             form.FillXLatCombo(form.cbXlatEng2, AppLanguage.lEnglish, 2, aCell, aApplication);
             form.FillXLatCombo(form.cbXlatFr0, AppLanguage.lFrench, 0, aCell, aApplication);
             form.FillXLatCombo(form.cbXlatFr1, AppLanguage.lFrench, 1, aCell, aApplication);
             form.FillXLatCombo(form.cbXlatFr2, AppLanguage.lFrench, 2, aCell, aApplication);
         }
         else
         {
             form.lblXlatEnum.Text = "None";
         }
         form.lblContentType.Text = aCell.GetCellTypeText();
         form.txtMask.Text        = aCell.GetEditControlMask(0);
         var LAliases = "";
         for (var i = 0; i < aCell.GetAliasNamesCount(); ++i)
         {
             LAliases += aCell.GetAliasNames(i) + "\r\n";
         }
         form.txtAliases.Text = string.Format("Aliases count {0}\r\nAliases:\r\n{1}",
                                              aCell.GetAliasNamesCount(), LAliases);
         form.ShowDialog();
     }
 }