Esempio n. 1
0
    void GenerateGrid()
    {
        resultBoxes = new ResultBox[width, height];
        cardLabels.Clear();
        starLabels.Clear();

        for (int i = 0; i < width; i++)
        {
            for (int j = 0; j < height; j++)
            {
                ResultBox clone = Instantiate(resultBoxPrefab);

                RectTransform rect = clone.GetComponent <RectTransform>();
                rect.SetParent(rectTransform);
                rect.anchoredPosition = new Vector2(i * offset.x, j * offset.y);
                resultBoxes[i, j]     = clone;

                clone.SetValue(10 * j + i - 30, "0");
            }
        }


        for (int i = 0; i < width; i++)
        {
            ValueDisplay clone = Instantiate(cardPrefab);
            cardLabels.Add(cardPrefab);

            RectTransform rect = clone.GetComponent <RectTransform>();
            rect.SetParent(rectTransform);
            rect.anchoredPosition = new Vector2(i * offset.x, labelsOffset.y);

            clone.SetValue(i + 1);
        }


        for (int i = 0; i < height; i++)
        {
            ValueDisplay clone = Instantiate(starPrefab);
            starLabels.Add(starPrefab);

            RectTransform rect = clone.GetComponent <RectTransform>();
            rect.SetParent(rectTransform);
            rect.anchoredPosition = new Vector2(labelsOffset.x, i * offset.y);

            clone.SetValue(i + 1);
        }
    }
Esempio n. 2
0
        public ReadOnlySpan <byte> GetData(int layer, int level)
        {
            if (_renderer.IsGpuThread())
            {
                ResultBox <PinnedSpan <byte> > box = new ResultBox <PinnedSpan <byte> >();
                _renderer.New <TextureGetDataSliceCommand>().Set(Ref(this), Ref(box), layer, level);
                _renderer.InvokeCommand();

                return(box.Result.Get());
            }
            else
            {
                ThreadedHelpers.SpinUntilNonNull(ref Base);

                return(Base.GetData(layer, level));
            }
        }
Esempio n. 3
0
 private static void OnHighlightedItemChanged(object sender, DependencyPropertyChangedEventArgs args)
 {
     ResultBox resultBox = (ResultBox)sender;
     IHighlightable oldItem = resultBox.ItemContainerGenerator.ContainerFromItem(args.OldValue) as IHighlightable;
     if (oldItem != null)
     {
         oldItem.IsHighlighted = false;
     }
     IHighlightable newItem = resultBox.ItemContainerGenerator.ContainerFromItem(args.NewValue) as IHighlightable;
     if (newItem != null)
     {
         resultBox.ignoreHighlightNotification = true;
         newItem.IsHighlighted = true;
         resultBox.ignoreHighlightNotification = false;
     }
     resultBox.HighlightedIndex = resultBox.Items.IndexOf(args.NewValue);
 }
Esempio n. 4
0
        // Для обновления информации на главной форме
        private void UpdateForm(ListViewItem NewIp, int PGMax, int PGValue, string labelAll, string labelBack, string labelWhite)
        {
            ResultBox.Items.Add(NewIp);
            ResultBox.Refresh();

            toolStripProgressBar.Maximum = PGMax;
            toolStripProgressBar.Value   = PGValue;

            labelAllCount.Text   = labelAll;
            labelBackCount.Text  = labelBack;
            labelWhiteCount.Text = labelWhite;

            this.Text = "DNSBL Checker: Проверка...";

            // Автоскролл вниз формы
            ResultBox.EnsureVisible(ResultBox.Items.Count - 1);
        }
 private void displayArray(double[] a, string arrayOf)
 {
     ResultBox.SelectionColor = Color.Blue;
     ResultBox.AppendText(arrayOf + " :\r\n");
     ResultBox.SelectionColor = Color.Black;
     ResultBox.AppendText("[ ");
     for (int i = a.Length - 1; i >= 0; i--)
     {
         ResultBox.SelectionColor = Color.BlueViolet;
         ResultBox.AppendText(a[i].ToString());
         ResultBox.SelectionColor = Color.Black;
         if (i != 0)
         {
             ResultBox.AppendText("; ");
         }
     }
     ResultBox.AppendText(" ]\r\n");
 }
Esempio n. 6
0
        private void append(string str)
        {
            if (!isEntering)
            {
                isEntering     = true;
                ResultBox.Text = "";
            }

            if (str == "." && ResultBox.Text.Contains("."))
            {
                return;
            }
            if (str == "0" && ResultBox.Text == "0")
            {
                return;
            }

            ResultBox.AppendText(str);
        }
Esempio n. 7
0
 private void ParseButton_Click(object sender, EventArgs e)
 {
     LoadXML();
     if (!string.IsNullOrEmpty(filename_))
     {
         //MessageBox.Show(filename_);
         List <String> filedata = new List <String>(File.ReadAllLines(filename_));
         foreach (String dataLine in filedata)
         {
             string recordType_ = dataLine.Substring(6, 2);
             ParseData(dataLine, getNodeType(recordType_));
             ResultBox.AppendText(Environment.NewLine);
             //MessageBox.Show(recordType_);
         }
     }
     else
     {
         MessageBox.Show("please select a file first");
     }
 }
Esempio n. 8
0
        //Запятая
        private void BDot_Click(object sender, EventArgs e)
        {
            if (OperationsIsClear())
            {
                if (Dot == false)
                {
                    ResultBox.AppendText(",");
                    Dot = true;
                }
            }

            else
            {
                if (Dot == true)
                {
                    ResultBox.AppendText(",");
                    Dot = false;
                }
            }
        }
        public PasswordControl AddPassword()
        {
            Password newPassword = new Password();

            PasswordControl newPasswordControl = new PasswordControl(newPassword);

            newPasswordControl.RemovePasswordClick += RemovePassword_Click;
            newPasswordControl.EnterDown           += pwc_EnterDown;

            ResultBox newResultBox = new ResultBox(newPassword);

            newPasswordControl.LinkedResultBox = newResultBox;

            passwords.Children.Insert(passwords.Children.Count - 1, newPasswordControl);
            results.Children.Insert(results.Children.Count - 1, newResultBox);

            svPasswords.ScrollToBottom();
            svHashes.ScrollToBottom();

            return(newPasswordControl);
        }
Esempio n. 10
0
 private static object CoerceHighlightedIndex(DependencyObject d, object value)
 {
     ResultBox resultBox = (ResultBox)d;
     int index = (int)value;
     if (index < -1)
     {
         index = -1;
     }
     if (index >= resultBox.Items.Count)
     {
         index = resultBox.Items.Count - 1;
     }
     if (index >= 0)
     {
         resultBox.HighlightedItem = resultBox.Items[index];
     }
     else
     {
         resultBox.HighlightedItem = null;
     }
     return index;
 }
Esempio n. 11
0
        private void button_click(object sender, EventArgs e)
        {
            if ((ResultBox.Text == "0") || isOperationPerformed)
            {
                ResultBox.Clear();
            }

            isOperationPerformed = false;
            Button button = (Button)sender;

            if (button.Text == ".")
            {
                if (!ResultBox.Text.Contains("."))
                {
                    ResultBox.Text = ResultBox.Text + button.Text;
                }
            }
            else
            {
                ResultBox.Text = ResultBox.Text + button.Text;
            }
        }
Esempio n. 12
0
        private void CalculateButton_Click(object sender, EventArgs e)
        {
            try
            {
                if (ImperialButton.Checked || MetrixButton.Checked)
                {
                    ResultBox.Clear();

                    height = Convert.ToDouble(HeightBox.Text);
                    weight = Convert.ToDouble(WeightBox.Text);

                    switch (Calculator)
                    {
                    case "Imperial":
                        bmi = weight * 703 / Math.Pow(height, 2);
                        break;

                    case "Metrix":
                        bmi = weight / Math.Pow(height, 2);
                        break;

                    default:
                        break;
                    }

                    ResultBox.Text = bmi.ToString();
                    BMIevaluation(bmi);
                }
                else
                {
                    throw new Exception("Error: You have to pick a calculator.");
                }
            }
            catch (Exception exception)
            {
                MessageBox.Show(exception.Message);
            }
        }
Esempio n. 13
0
        public void ParseData(string DataString, XmlNode nodeType)
        {
            int cursor_ = 0;

            ResultBox.AppendText("-------[" + nodeType.Name.ToString() + "]-------" + Environment.NewLine);
            ResultBox.AppendText("--------------------------------------------------------------------" + Environment.NewLine);
            foreach (XmlNode xn in nodeType)
            {
                int length_       = Int32.Parse(xn.Attributes["length"].Value);
                int string_length = DataString.Length;
                if (cursor_ < string_length)
                {
                    if (!string.IsNullOrEmpty(DataString.Substring(cursor_, length_)))
                    {
                        String _dataLine = xn.Name.ToString() + " = " + DataString.Substring(cursor_, length_);
                        ResultBox.AppendText(_dataLine + Environment.NewLine + Environment.NewLine);
                        //MessageBox.Show(_dataLine);
                    }
                }
                cursor_ = cursor_ + length_;
            }
            ResultBox.AppendText(Environment.NewLine);
        }
Esempio n. 14
0
        public void PopulateResultWindows()
        {
            frLt = new ResultBox("Front Left");
            frRt = new ResultBox("Front Right");
            rrLt = new ResultBox("Rear Left");
            rrRt = new ResultBox("Rear Right");

            resultGrid.Children.Add(frLt);
            Grid.SetRow(frLt, 0);
            Grid.SetColumn(frLt, 0);

            resultGrid.Children.Add(frRt);
            Grid.SetRow(frRt, 0);
            Grid.SetColumn(frRt, 1);

            resultGrid.Children.Add(rrLt);
            Grid.SetRow(rrLt, 1);
            Grid.SetColumn(rrLt, 0);

            resultGrid.Children.Add(rrRt);
            Grid.SetRow(rrRt, 1);
            Grid.SetColumn(rrRt, 1);
        }
        private double getRadiusOverWesterfieldMethod(double [] a)
        {
            if (a[a.Length - 1] != 1)
            {
                a = shortArrayInNumber(a, 0, a[a.Length - 1]);
            }
            double max1 = 0, max2 = 0, current;

            for (int t = 1; t < a.Length; t++)
            {
                current = Math.Pow(Math.Abs(a[a.Length - 1 - t]), (1 / Convert.ToDouble(t)));
                ResultBox.AppendText("For t = " + t.ToString() + ", iteration = " + current.ToString() + "\r\n");
                if (t == 1)
                {
                    max1 = current;
                }
                else if (t == 2)
                {
                    max2 = current;
                }
                else
                {
                    if (current > max1)
                    {
                        max1 = current;
                    }
                    else
                    {
                        if (current > max2)
                        {
                            max2 = current;
                        }
                    }
                }
            }
            return(max1 + max2);
        }
        private double methodOfChords(double a, double b, double e, function f, function fder1, function fder2)
        {
            if (f(a) * fder2(a) < 0)
            {
                double c = a;
                a = b;
                b = c;
            }
            int    n = 1;
            double b1;

            while (true)
            {
                b1 = methodOfChordsIteration(a, b, f);
                ResultBox.AppendText("b" + n.ToString() + " = " + b1.ToString() + " (a = " + a.ToString() + ")\r\n");
                ResultBox.AppendText("root: " + b1.ToString() + ", iteration №" + n.ToString() + "\r\n");
                if (methodOfChordsCriterion(b, b1, e, f, fder1))
                {
                    return(b1);
                }
                b = b1;
                n++;
            }
        }
        private double methodOfNewtonMod(double a, double b, double e, function f, function fder1, function fder2)
        {
            int n = 0;

            if (f(a) * fder2(a) < 0)
            {
                double c = a;
                a = b;
                b = c;
            }
            double a1, a0 = a;

            while (true)
            {
                a1 = methodOfNewtonModIteartion(a, a0, f, fder1);
                ResultBox.AppendText("a" + n.ToString() + " = " + a1.ToString() + " (b = " + b.ToString() + ")\r\n");
                if (methodOfChordsCriterion(a, a1, e, f, fder1))
                {
                    return(a1);
                }
                a = a1;
                n++;
            }
        }
Esempio n. 18
0
        private void openToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog1 = new OpenFileDialog
            {
                InitialDirectory = @"C:\",
                Title            = "Browse Text Files",

                CheckFileExists = true,
                CheckPathExists = true,

                DefaultExt       = "txt",
                Filter           = "txt files (*.txt)|*.txt",
                FilterIndex      = 2,
                RestoreDirectory = true,

                ReadOnlyChecked = true,
                ShowReadOnly    = true
            };

            if (openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                ResultBox.AppendText("It works!");
            }
        }
Esempio n. 19
0
 private void CbSourceLanguages_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     documentTranslation.SelectedSourceLanguage = e.AddedItems[0].ToString();
     if (InputBox != null)
     {
         if ((TranslationServices.Core.TranslationServiceFacade.LanguageNameToLanguageCode(documentTranslation.SelectedSourceLanguage) == "he") ||
             (TranslationServices.Core.TranslationServiceFacade.LanguageNameToLanguageCode(documentTranslation.SelectedSourceLanguage) == "ar"))
         {
             InputBox.HorizontalAlignment        = HorizontalAlignment.Right;
             InputBox.TextAlignment              = TextAlignment.Right;
             InputBox.FlowDirection              = FlowDirection.RightToLeft;
             InputBox.HorizontalContentAlignment = HorizontalAlignment.Right;
         }
         else
         {
             InputBox.HorizontalAlignment        = HorizontalAlignment.Left;
             InputBox.TextAlignment              = TextAlignment.Left;
             InputBox.FlowDirection              = FlowDirection.LeftToRight;
             InputBox.HorizontalContentAlignment = HorizontalAlignment.Left;
         }
         ResultBox.InvalidateArrange();
         InputBox.UpdateLayout();
     }
 }
        /// <summary>
        /// Populate the window with results.
        /// </summary>
        /// <param name="results">Results to use</param>
        public void Populate(JObject[] results)
        {
            // Update the UI
            UpdateTheme();

            // Clear the result box
            ResultBox.CleanDocument();

            // Initialize the list of queries
            QueriesList.Items.Clear();
            for (var i = 0; i < results.Length; i++)
            {
                var current = i;
                var item    = new ComboBoxItem();
                item.Content   = "#" + (i + 1);
                item.Selected += (s, e) =>
                {
                    ((MainWindow)Owner).SelectQueryBlock(current);
                    ResultBox.SetDocumentContents(results[current].ToString());
                };

                QueriesList.Items.Add(item);
            }
        }
Esempio n. 21
0
 private void button_clr_Click(object sender, EventArgs e)
 {
     Result = 0;
     ResultBox.Clear();
     clear = true;
 }
Esempio n. 22
0
 protected SwappingComputed(ComputedOptions options, InterceptedInput input, ResultBox <T> maybeOutput, LTag version, bool isConsistent)
     : base(options, input, default, version, isConsistent)
     => _maybeOutput = maybeOutput;
Esempio n. 23
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            for (int resultTrav = 0; resultTrav < m_resultLine.Count; resultTrav++)
            {
                m_resultLine[resultTrav].Dispose();
            }
            m_resultLine.Clear();
            for (int resultTrav = 0; resultTrav < m_resultBox.Count; resultTrav++)
            {
                m_resultBox[resultTrav].Dispose();
            }
            m_resultBox.Clear();

            GridPos startPos = new GridPos();
            GridPos endPos   = new GridPos();

            for (int widthTrav = 0; widthTrav < width; widthTrav++)
            {
                for (int heightTrav = 0; heightTrav < height; heightTrav++)
                {
                    if (m_rectangles[widthTrav][heightTrav].boxType != BoxType.Wall)
                    {
                        searchGrid.SetWalkableAt(new GridPos(widthTrav, heightTrav), true);
                    }
                    else
                    {
                        searchGrid.SetWalkableAt(new GridPos(widthTrav, heightTrav), false);
                    }
                    if (m_rectangles[widthTrav][heightTrav].boxType == BoxType.Start)
                    {
                        startPos.x = widthTrav;
                        startPos.y = heightTrav;
                    }
                    if (m_rectangles[widthTrav][heightTrav].boxType == BoxType.End)
                    {
                        endPos.x = widthTrav;
                        endPos.y = heightTrav;
                    }
                }
            }
            jumpParam.DiagonalMovement = (DiagonalMovement)cbbJumpType.SelectedIndex;
            jumpParam.UseRecursive     = cbUseRecursive.Checked;
            jumpParam.Reset(startPos, endPos);
            List <GridPos> resultList = JumpPointFinder.FindPath(jumpParam);

            for (int resultTrav = 0; resultTrav < resultList.Count - 1; resultTrav++)
            {
                m_resultLine.Add(new GridLine(m_rectangles[resultList[resultTrav].x][resultList[resultTrav].y], m_rectangles[resultList[resultTrav + 1].x][resultList[resultTrav + 1].y]));
            }
            for (int widthTrav = 0; widthTrav < jumpParam.SearchGrid.width; widthTrav++)
            {
                for (int heightTrav = 0; heightTrav < jumpParam.SearchGrid.height; heightTrav++)
                {
                    if (jumpParam.SearchGrid.GetNodeAt(widthTrav, heightTrav) == null)
                    {
                        continue;
                    }
                    if (jumpParam.SearchGrid.GetNodeAt(widthTrav, heightTrav).isOpened)
                    {
                        ResultBox resultBox = new ResultBox(widthTrav * 20, heightTrav * 20 + 50, ResultBoxType.Opened);
                        m_resultBox.Add(resultBox);
                    }
                    if (jumpParam.SearchGrid.GetNodeAt(widthTrav, heightTrav).isClosed)
                    {
                        ResultBox resultBox = new ResultBox(widthTrav * 20, heightTrav * 20 + 50, ResultBoxType.Closed);
                        m_resultBox.Add(resultBox);
                    }
                }
            }
            this.Invalidate();
        }
Esempio n. 24
0
        private void InstallLicenses_DoWork(object sender, DoWorkEventArgs e)
        {
            Process p = new Process();

            p.StartInfo.FileName               = "cscript";
            p.StartInfo.UseShellExecute        = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.CreateNoWindow         = true;
            string[] ar = (string[])e.Argument;
            if (ar[0] == "2")
            {
                XElement loadxml = XElement.Load(OfficeInstallPath + "\\root\\Licenses16\\c2rpridslicensefiles_auto.xml");
                IEnumerable <XElement> MatchElements = from el in loadxml.Elements("ProductReleaseId")
                                                       select el;

                char[]   separator = { ',' };
                string[] Licenses  = ar[1].Split(separator);
                foreach (string id in Licenses)
                {
                    foreach (XElement ele in MatchElements)
                    {
                        if (ele.Attribute("id").Value == id)
                        {
                            foreach (XElement elements in ele.Elements())
                            {
                                foreach (XElement element in elements.Element("Files").Elements())
                                {
                                    if (File.Exists("files\\activate\\ospp_" + Find("Culture") + ".vbs"))
                                    {
                                        p.StartInfo.Arguments = "//Nologo files\\activate\\ospp_" + Find("Culture") + ".vbs /inslic:\"" + OfficeInstallPath + "\\root\\Licenses16\\" + element.Attribute("name").Value + "\"";
                                    }
                                    else
                                    {
                                        p.StartInfo.Arguments = "//Nologo files\\activate\\ospp.vbs /inslic:\"" + OfficeInstallPath + "\\root\\Licenses16\\" + element.Attribute("name").Value + "\"";
                                    }
                                    p.Start();
                                    string sOutput = p.StandardOutput.ReadToEnd();
                                    Dispatcher.BeginInvoke(new Action(delegate
                                    {
                                        ResultBox.AppendText(sOutput);
                                        ResultBox.ScrollToEnd();
                                    }));
                                }
                            }
                        }
                    }
                }
                return;
            }
            else if (ar[0] == "0")
            {
                try //删除多余文件,避免出错
                {
                    DirectoryInfo di = new DirectoryInfo(a + "licenses\\");
                    di.Delete(true);
                }
                catch
                { }
                ZipFile.ExtractToDirectory("files\\activate\\licenses.data", a);
            }
            string[] files = Directory.GetFiles(ar[1], "*.xrm-ms");//获取指定路径的证书文件
            if (files.Length == 0)
            {
                e.Result = Find("ToastLicensesInstallError");
                return;
            }
            if (ar[0] == "0")//是否指定 common 证书
            {
                string[] commonfiles = Directory.GetFiles(ar[3], "*.xrm-ms");
                foreach (string s in commonfiles)
                {
                    FileInfo fi = new FileInfo(s);

                    if (File.Exists("files\\activate\\ospp_" + Find("Culture") + ".vbs"))
                    {
                        p.StartInfo.Arguments = "//Nologo files\\activate\\ospp_" + Find("Culture") + ".vbs /inslic:\"" + ar[3] + "\\" + fi.Name + "\"";
                    }
                    else
                    {
                        p.StartInfo.Arguments = "//Nologo files\\activate\\ospp.vbs /inslic:\"" + ar[3] + "\\" + fi.Name + "\"";
                    }
                    p.Start();
                    string sOutput = p.StandardOutput.ReadToEnd();
                    Dispatcher.BeginInvoke(new Action(delegate
                    {
                        ResultBox.AppendText(sOutput);
                        ResultBox.ScrollToEnd();
                    }));
                }
            }
            foreach (string s in files)//安装指定路径的证书文件
            {
                FileInfo fi = new FileInfo(s);

                if (File.Exists("files\\activate\\ospp_" + Find("Culture") + ".vbs"))
                {
                    p.StartInfo.Arguments = "//Nologo files\\activate\\ospp_" + Find("Culture") + ".vbs /inslic:\"" + ar[1] + "\\" + fi.Name + "\"";
                }
                else
                {
                    p.StartInfo.Arguments = "//Nologo files\\activate\\ospp.vbs /inslic:\"" + ar[1] + "\\" + fi.Name + "\"";
                }
                p.Start();
                string sOutput = p.StandardOutput.ReadToEnd();
                Dispatcher.BeginInvoke(new Action(delegate
                {
                    ResultBox.AppendText(sOutput);
                    ResultBox.ScrollToEnd();
                }));
            }
            if (ar[0] == "0")//安装 Key
            {
                if (ar[2] != string.Empty)
                {
                    if (File.Exists("files\\activate\\ospp_" + Find("Culture") + ".vbs"))
                    {
                        p.StartInfo.Arguments = "//Nologo files\\activate\\ospp_" + Find("Culture") + ".vbs /inpkey:" + ar[2];
                    }
                    else
                    {
                        p.StartInfo.Arguments = "//Nologo files\\activate\\ospp.vbs /inpkey:" + ar[2];
                    }
                    p.Start();
                    string Output = p.StandardOutput.ReadToEnd();
                    Dispatcher.BeginInvoke(new Action(delegate
                    {
                        ResultBox.AppendText(Output);
                        ResultBox.AppendText(Environment.NewLine);
                        ResultBox.ScrollToEnd();
                    })).Wait();
                }
            }
        }
Esempio n. 25
0
 private void button_equal_Click(object sender, EventArgs e)
 {
     try
     {
         x = Convert.ToDouble(ResultBox.Text);
         ResultBox.Clear();
         if (Clicked == button_div)
         {
             if (Result == 0)
             {
                 Result         = x;
                 ResultBox.Text = Result.ToString();
                 clear          = false;
             }
             else
             {
                 Result         = Result / x;
                 ResultBox.Text = Result.ToString();
                 clear          = false;
             }
         }
         else if (Clicked == button_add)
         {
             if (Result == 0)
             {
                 Result         = x;
                 ResultBox.Text = Result.ToString();
                 clear          = false;
             }
             else
             {
                 Result         = Result + x;
                 ResultBox.Text = Result.ToString();
                 clear          = false;
             }
         }
         else if (Clicked == button_sub)
         {
             if (Result == 0)
             {
                 Result         = x;
                 ResultBox.Text = Result.ToString();
                 clear          = false;
             }
             else
             {
                 Result         = Result - x;
                 ResultBox.Text = Result.ToString();
                 clear          = false;
             }
         }
         else if (Clicked == button_mult)
         {
             if (Result == 0)
             {
                 Result         = x;
                 ResultBox.Text = Result.ToString();
                 clear          = false;
             }
             else
             {
                 Result         = Result * x;
                 ResultBox.Text = Result.ToString();
                 clear          = false;
             }
         }
         else
         {
             ResultBox.Text = x.ToString();
         }
     }
     catch (Exception)
     {
         Result = 0;
         ResultBox.Clear();
     }
 }
Esempio n. 26
0
        private void updatebranch()
        {
            ResultBox rtnbox = new ResultBox();

            try
            {
                string a_branch_id   = (jsonCol["a_branch_id"] != null) ? jsonCol["a_branch_id"].GetValue().ToString() : "";
                string a_branch_nm   = (jsonCol["a_branch_nm"] != null) ? jsonCol["a_branch_nm"].GetValue().ToString() : "";
                string a_branch_tel  = (jsonCol["a_branch_tel"] != null) ? jsonCol["a_branch_tel"].GetValue().ToString() : "";
                string a_branch_addr = (jsonCol["a_branch_addr"] != null) ? jsonCol["a_branch_addr"].GetValue().ToString() : "";
                string mid           = (jsonCol["mid"] != null) ? jsonCol["mid"].GetValue().ToString() : "";
                string mertkey       = (jsonCol["mertkey"] != null) ? jsonCol["mertkey"].GetValue().ToString() : "";

                string ocb_branch_id = (jsonCol["ocb_branch_id"] != null) ? jsonCol["ocb_branch_id"].GetValue().ToString() : "";
                string ocb_branch_cn = (jsonCol["ocb_branch_cn"] != null) ? jsonCol["ocb_branch_cn"].GetValue().ToString() : "";


                string home_yn     = (jsonCol["home_yn"] != null) ? jsonCol["home_yn"].GetValue().ToString() : "N";
                string online_yn   = (jsonCol["online_yn"] != null) ? jsonCol["online_yn"].GetValue().ToString() : "N";
                string ecoupon_yn  = (jsonCol["ecoupon_yn"] != null) ? jsonCol["ecoupon_yn"].GetValue().ToString() : "N";
                string cesco_yn    = (jsonCol["cesco_yn"] != null) ? jsonCol["cesco_yn"].GetValue().ToString() : "N";
                string carddisc_yn = (jsonCol["carddisc_yn"] != null) ? jsonCol["carddisc_yn"].GetValue().ToString() : "N";
                string bctop_yn    = (jsonCol["bctop_yn"] != null) ? jsonCol["bctop_yn"].GetValue().ToString() : "N";
                string advance_yn  = (jsonCol["advance_yn"] != null) ? jsonCol["advance_yn"].GetValue().ToString() : "N";

                string packing = (jsonCol["packing"] != null) ? jsonCol["packing"].GetValue().ToString() : "P1";

                string lat    = (jsonCol["lat"] != null) ? jsonCol["lat"].GetValue().ToString() : "";
                string lng    = (jsonCol["lng"] != null) ? jsonCol["lng"].GetValue().ToString() : "";
                string use_yn = (jsonCol["use_yn"] != null) ? jsonCol["use_yn"].GetValue().ToString() : "N";

                string onyn = (jsonCol["onyn"] != null) ? jsonCol["onyn"].GetValue().ToString() : "";
                string epyn = (jsonCol["epyn"] != null) ? jsonCol["epyn"].GetValue().ToString() : "";
                string adyn = (jsonCol["adyn"] != null) ? jsonCol["adyn"].GetValue().ToString() : "";
                string bcyn = (jsonCol["bcyn"] != null) ? jsonCol["bcyn"].GetValue().ToString() : "";

                string agent_id = base.logOnInfo.UserId.ToString();
                string agent_nm = base.logOnInfo.UserName.ToString();

                #region 관리자 정보 조회
                DataSet   ds           = new DataSet();
                Logon     logon        = new Logon();
                Hashtable adinfo_param = new Hashtable();
                adinfo_param.Add("uno", agent_id);
                ds = logon.selectAdminInfo(adinfo_param);
                string  uid     = ds.Tables[0].Rows[0]["UID"].ToString();
                History history = new History();
                #endregion

                if (online_yn != onyn)
                {
                    Hashtable param = new Hashtable();
                    param.Add("uid", uid);
                    param.Add("user_name", agent_nm);
                    param.Add("online_yn", online_yn);
                    param.Add("br_code", a_branch_id);
                    history.insertOnlineYnHistory(param);
                }

                if (ecoupon_yn != epyn)
                {
                    Hashtable param = new Hashtable();
                    param.Add("uid", uid);
                    param.Add("user_name", agent_nm);
                    param.Add("ecoupon_yn", ecoupon_yn);
                    param.Add("br_code", a_branch_id);
                    history.insertEcouponYnHistory(param);
                }

                if (advance_yn != adyn)
                {
                    Hashtable param = new Hashtable();
                    param.Add("uid", uid);
                    param.Add("user_name", agent_nm);
                    param.Add("advance_yn", advance_yn);
                    param.Add("br_code", a_branch_id);
                    history.insertAdvanceYnHistory(param);
                }

                if (bctop_yn != bcyn)
                {
                    Hashtable param = new Hashtable();
                    param.Add("uid", uid);
                    param.Add("user_name", agent_nm);
                    param.Add("bctop_yn", bctop_yn);
                    param.Add("br_code", a_branch_id);
                    history.insertBctopYnHistory(param);
                }


                string agent_ip   = Request.ServerVariables["REMOTE_ADDR"];
                string actionmode = "updatebranch";

                if (a_branch_id == "" || a_branch_id == null)
                {
                    result.Add(new JsonStringValue("result", "159"));
                    result.Add(new JsonStringValue("message", "매장아이디가 존재하지 않습니다.\\n잠시 후 다시 이욯해 주세요."));
                }
                else
                {
                    Hashtable param = new Hashtable();
                    param.Add("agent_id", agent_id);
                    param.Add("agent_nm", agent_nm);
                    param.Add("agent_ip", agent_ip);
                    param.Add("actionmode", actionmode);
                    param.Add("a_branch_id", a_branch_id);
                    param.Add("a_branch_nm", a_branch_nm);
                    param.Add("a_branch_tel", a_branch_tel);
                    param.Add("a_branch_addr", a_branch_addr);
                    param.Add("mid", mid);
                    param.Add("mertkey", mertkey);
                    param.Add("ocb_branch_id", ocb_branch_id);
                    param.Add("ocb_branch_cn", ocb_branch_cn);
                    param.Add("home_yn", home_yn);
                    param.Add("online_yn", online_yn);
                    param.Add("ecoupon_yn", ecoupon_yn);
                    param.Add("cesco_yn", cesco_yn);
                    param.Add("carddisc_yn", carddisc_yn);
                    param.Add("bctop_yn", bctop_yn);
                    param.Add("advance_yn", advance_yn);
                    param.Add("packing_type", packing);
                    param.Add("lat", lat);
                    param.Add("lng", lng);
                    param.Add("use_yn", use_yn);

                    rtnbox = store.updateBranch(param);
                    result.Add(new JsonStringValue("result", rtnbox.ResultCode));
                    result.Add(new JsonStringValue("message", rtnbox.ResultMsg));
                }
            }
            catch (Exception ex)
            {
                result.Add(new JsonStringValue("result", "155"));
                result.Add(new JsonStringValue("message", "매장업데이트 진행시 예외오류가 발생하였습니다.\\n" + ex.Message));
            }
        }
Esempio n. 27
0
        private void ResultOption_Click(Object sender, EventArgs e)
        {
            ResultBox b = new ResultBox();

            b.ShowDialog();
        }
Esempio n. 28
0
        private void InstallLicenses_DoWork(object sender, DoWorkEventArgs e)
        {
            Dispatcher.BeginInvoke(new Action(delegate
            {
                Tab4Process.IsIndeterminate   = true;
                TaskProgressBar.ProgressState = TaskbarItemProgressState.Indeterminate;
            })).Wait();
            OTP.OfficeConfiguration office = new OTP.OfficeConfiguration();
            Process p = new Process();

            p.StartInfo.FileName               = "cscript";
            p.StartInfo.UseShellExecute        = false;
            p.StartInfo.RedirectStandardOutput = true;
            p.StartInfo.CreateNoWindow         = true;
            string[] ar = (string[])e.Argument;
            if (ar[0] == "2")
            {
                XElement loadxml = XElement.Load(office.InstallPath + "\\root\\Licenses16\\c2rpridslicensefiles_auto.xml");
                IEnumerable <XElement> MatchElements = from el in loadxml.Elements("ProductReleaseId")
                                                       select el;

                char[]   separator = { ',' };
                string[] Licenses  = ar[1].Split(separator);
                foreach (string id in Licenses)
                {
                    foreach (XElement ele in MatchElements)
                    {
                        if (ele.Attribute("id").Value == id)
                        {
                            foreach (XElement elements in ele.Elements())
                            {
                                foreach (XElement element in elements.Element("Files").Elements())
                                {
                                    p.StartInfo.Arguments = "//Nologo \"" + office.InstallPath + "\\Office16\\ospp.vbs\" /inslic:\"" + office.InstallPath + "\\root\\Licenses16\\" + element.Attribute("name").Value + "\"";
                                    p.Start();
                                    string sOutput = p.StandardOutput.ReadToEnd();
                                    Dispatcher.BeginInvoke(new Action(delegate
                                    {
                                        ResultBox.AppendText(sOutput);
                                        ResultBox.ScrollToEnd();
                                    }));
                                }
                            }
                        }
                    }
                }
                return;
            }
            string[] files = Directory.GetFiles(ar[1], "*.xrm-ms");//获取指定路径的证书文件
            if (files.Length == 0)
            {
                e.Result = Find("ToastLicensesInstallError");
                return;
            }
            if (ar[0] == "0")//是否指定 common 证书
            {
                string[] commonfiles = Directory.GetFiles(ar[3], "*.xrm-ms");
                foreach (string s in commonfiles)
                {
                    FileInfo fi = new FileInfo(s);
                    p.StartInfo.Arguments = "//Nologo \"" + office.InstallPath + "\\Office16\\ospp.vbs\" /inslic:\"" + ar[3] + "\\" + fi.Name + "\"";
                    p.Start();
                    string sOutput = p.StandardOutput.ReadToEnd();
                    Dispatcher.BeginInvoke(new Action(delegate
                    {
                        ResultBox.AppendText(sOutput);
                        ResultBox.ScrollToEnd();
                    }));
                }
            }
            foreach (string s in files)//安装指定路径的证书文件
            {
                FileInfo fi = new FileInfo(s);
                p.StartInfo.Arguments = "//Nologo \"" + office.InstallPath + "\\Office16\\ospp.vbs\" /inslic:\"" + ar[1] + "\\" + fi.Name + "\"";
                p.Start();
                string sOutput = p.StandardOutput.ReadToEnd();
                Dispatcher.BeginInvoke(new Action(delegate
                {
                    ResultBox.AppendText(sOutput);
                    ResultBox.ScrollToEnd();
                }));
            }
            if (ar[0] == "0")//安装 Key
            {
                if (ar[2] != string.Empty)
                {
                    p.StartInfo.Arguments = "//Nologo \"" + office.InstallPath + "\\Office16\\ospp.vbs\" /inpkey:" + ar[2];
                    p.Start();
                    string Output = p.StandardOutput.ReadToEnd();
                    Dispatcher.BeginInvoke(new Action(delegate
                    {
                        ResultBox.AppendText(Output);
                        ResultBox.AppendText(Environment.NewLine);
                        ResultBox.ScrollToEnd();
                    })).Wait();
                }
            }
        }
Esempio n. 29
0
 private void ResultBox_TextChanged(object sender, EventArgs e)
 {
     ResultBox.ScrollToCaret();
 }
Esempio n. 30
0
        private void synccallbranch()
        {
            ResultBox rtnbox    = new ResultBox();
            ResultBox rtnboxlog = new ResultBox();
            DataSet   callds    = null;

            callds = new DataSet();
            string syncSql       = "";
            string arr_branch_id = (jsonCol["arr_branch_id"] != null) ? jsonCol["arr_branch_id"].GetValue().ToString() : "";

            try
            {
                if ("".Equals(arr_branch_id))
                {
                    result.Add(new JsonStringValue("result", "995"));
                    result.Add(new JsonStringValue("message", "매장데이터가 없습니다."));
                }
                else
                {
                    arr_branch_id = arr_branch_id.Substring(1, arr_branch_id.Length - 1);
                    arr_branch_id = arr_branch_id.Replace("|", "','");
                    Hashtable param = new Hashtable();

                    param.Add("a_branch_id", arr_branch_id);

                    callds = callstore.synccallbranch(param);

                    if (DbUtil.ContainData(callds))
                    {
                        foreach (DataRow calldt in callds.Tables[0].Rows)
                        {
                            syncSql += calldt["qry"].ToString();
                        }

                        Hashtable callparam = new Hashtable();
                        callparam.Add("qry", syncSql);
                        rtnbox = store.synccallbranchexec(callparam);
                    }

                    string agent_id   = base.logOnInfo.UserId.ToString();
                    string agent_nm   = base.logOnInfo.UserName.ToString();
                    string agent_ip   = Request.ServerVariables["REMOTE_ADDR"];
                    string actionmode = "synccallbranch";

                    Hashtable logparam = new Hashtable();
                    logparam.Add("agent_id", agent_id);
                    logparam.Add("agent_nm", agent_nm);
                    logparam.Add("agent_ip", agent_ip);
                    logparam.Add("actionmode", actionmode);
                    logparam.Add("updatedt", arr_branch_id);
                    logparam.Add("descdt", "매장동기화 작업");

                    rtnboxlog = order.insertadminlog(logparam);

                    result.Add(new JsonStringValue("result", rtnbox.ResultCode));
                    result.Add(new JsonStringValue("message", rtnbox.ResultMsg));
                }
            }
            catch (Exception ex)
            {
                result.Add(new JsonStringValue("result", "996"));
                result.Add(new JsonStringValue("message", "동기화 진행시 오류가 발생하였습니다.\\n" + ex.Message));
            }
        }