コード例 #1
0
        // ReSharper disable once UnusedMember.Global
        public void OpenUrl()
        {
            var url = Interaction.InputBox("Url", "Open Url",
                                           "https://archive.org/download/Windows7WildlifeSampleVideo/Wildlife_512kb.mp4");

            if (!string.IsNullOrEmpty(url))
            {
                OpenUrl(url);
            }
        }
コード例 #2
0
        private void GroupAdd_Click(object sender, EventArgs e)
        {
            String groupInput = VBasic.InputBox("Название группы должно полностью соответствовать названию в расписании", "Добавление группы...", "", MousePosition.X - 320, MousePosition.Y - 50);

            if (groupInput != "")
            {
                CPG_GPanel.Controls.Add(new Label()
                {
                    Text = groupInput
                });
                CPG_GPanel.Controls[CPG_GPanel.Controls.Count - 1].Click += (e1, e2) => CPG_GPanel.Controls.Remove(e1 as Control);
            }
        }
コード例 #3
0
ファイル: Form3.cs プロジェクト: HoolyPanda/Dungeon-Creator
        public void list1DoubleClick(object sender, EventArgs e)
        {
            string newName = VB.InputBox("Name");

            if ((!newName.Equals("")) & (!newName.Equals(" ")))
            {
                int j = Dungeon.Length;
                j++;
                Array.Resize(ref Dungeon, j);
                Dungeon[j - 1].name       = newName;
                Dungeon[j - 1].Encounters = new Location.Dungeon.Encounter[0];
                listBox1.Items.Add(Dungeon[j - 1].name);
            }
            else
            {
                MessageBox.Show("error");
            }
        }
コード例 #4
0
ファイル: Scheduler .cs プロジェクト: drajend/FortisToAWD
        private void Conversion()
        {
            bResult = PolicyDetails();
            if (bResult == true)
            {
                try
                {
                    object obj = Interaction.CreateObject("Fortis.Application");
                    app = (FComApi.Application)obj;
                    app.Login("sysadm", "G3t0utN0w", FaStationType.faScan);

                    long lDBCount;
                    lDBCount = app.Databases.Count;

                    if (lDBCount >= 1)
                    {
                        db     = app.Databases(1);
                        dbname = db.Name;
                        string strfn = "A1914";
                        LogClass.WriteLog("Policy Number: " + strfn);
                        SqlConnection con = new SqlConnection("Data Source=pwsadsfortis01;Initial Catalog= " + dbname + ";Integrated Security=True;");
                        SqlCommand    cmd;
                        dt = new DataTable();
                        SqlDataAdapter da;
                        DataSet        ds = new DataSet();
                        cmd             = new SqlCommand(Policy, con);
                        cmd.CommandType = System.Data.CommandType.Text;
                        cmd.Parameters.Add("@SearchString", SqlDbType.VarChar);
                        cmd.Parameters["@SearchString"].Value = strfn;
                        con.Open();
                        cmd.ExecuteNonQuery();
                        da = new SqlDataAdapter(cmd);
                        da.Fill(ds);
                        da.Fill(dt);
                        dt.Columns.Add("P_container", typeof(System.String));
                        i = 0;
                        LogClass.WriteLog("---------------------------------------------------------------------------------------");

                        foreach (DataRow row in dt.Rows)
                        {
                            //need to set value to NewColumn column
                            row["P_container"] = ds.Tables[1].Rows[i]["Container"].ToString().Trim();   // or set it to some other value
                            i++;
                        }

                        var Grpcontainer = from table in dt.AsEnumerable()
                                           group table by new { placeCol = table["Container"] } into groupby
                            select new
                        {
                            Value        = groupby.Key,
                            ColumnValues = groupby
                        };

                        // LogClass.WriteLog("******checking containers one by one*******");


                        foreach (var Key in Grpcontainer)
                        {
                            strSubContainer = Key.Value.placeCol.ToString();
                            if (strSubContainer != "PARTICIPANT INFO" && strSubContainer != "PENSIONS")
                            {
                                foreach (var columnValue in Key.ColumnValues)
                                {
                                    string Doc_id    = columnValue["F_DocumentId"].ToString();
                                    string container = columnValue["container"].ToString();
                                    Filename     = columnValue["F_Filename"].ToString();
                                    strContainer = columnValue["P_container"].ToString();
                                    DataRow[] dr = dt1.Select("Container_Name = '" + container + "'");
                                    if (dr.Length > 0)
                                    {
                                        Container_ID = dr[0]["Container_ID"].ToString();
                                    }
                                    DataRow[] dr1         = dt2.Select("Container_ID =" + Container_ID);
                                    DataTable dtcontainer = new DataTable();
                                    dtcontainer = dr1.CopyToDataTable();
                                    DataRow[] dr2 = dtcontainer.Select("F_DocumentID =" + Doc_id);
                                    if (dr2.Length > 0)
                                    {
                                        i = Convert.ToInt32(dr2[0]["Container_Index_Number"]);
                                    }
                                    if (strSubContainer != strContainer)
                                    {
                                        str1 = db.RootFolder.Folders(strContainer).Folders(strSubContainer).Name;
                                    }
                                    else
                                    {
                                        str1 = "";
                                    }

                                    str2 = db.RootFolder.Folders(strContainer).Name;

                                    if (str1 == strSubContainer)
                                    {
                                        LogClass.WriteLog("Container :" + strSubContainer);
                                        LogClass.WriteLog("Starting Time: " + DateTime.Now.ToString("HH:mm:ss tt").ToString());

                                        int Docid = db.RootFolder.Folders(strContainer).Folders(strSubContainer).Documents.Item(i).ID;
                                        if (Doc_id == Docid.ToString())
                                        {
                                            MAGfile = db.RootFolder.Folders(strContainer).Folders(strSubContainer).Documents.Item(i).DocFile;
                                            LogClass.WriteLog("DOC Found in the place of " + i + ". looping Time to reach the place - " + DateTime.Now.ToString("HH:mm:ss tt").ToString());
                                            // MAGfile.Export("C:\\Code\\" + Filename, FaExportDocFileType.faTIFFile, 22651, 22651);
                                        }
                                        else
                                        {
                                            LogClass.WriteLog("Index MissMatch Docid- " + Doc_id + " - " + DateTime.Now.ToString("HH:mm:ss tt").ToString());
                                        }

                                        LogClass.WriteLog("Ending Time: " + DateTime.Now.ToString("HH:mm:ss tt").ToString());
                                        LogClass.WriteLog("-----------------------------------------------------------------------------------------");
                                    }
                                    else
                                    if (str2 == strSubContainer)
                                    {
                                        //var objj1 = db.RootFolder.Folders(strContainer).Documents();
                                        LogClass.WriteLog("Container :" + strContainer);
                                        LogClass.WriteLog("Starting Time: " + DateTime.Now.ToString("HH:mm:ss tt").ToString());

                                        int Docid = db.RootFolder.Folders(strContainer).Documents.Item(i).ID;
                                        if (Doc_id == Docid.ToString())
                                        {
                                            MAGfile = db.RootFolder.Folders(strContainer).Documents.Item(i).DocFile;
                                            LogClass.WriteLog("DOC Found in the place of " + i + ". looping Time to reach the place - " + DateTime.Now.ToString("HH:mm:ss tt").ToString());
                                            // MAGfile.Export("C:\\Code\\" + Filename, FaExportDocFileType.faTIFFile, 22651, 22651);
                                        }
                                        else
                                        {
                                            LogClass.WriteLog("Index MissMatch Docid- " + Doc_id + " - Index number - " + i + " - " + DateTime.Now.ToString("HH:mm:ss tt").ToString());
                                        }

                                        LogClass.WriteLog("Ending Time: " + DateTime.Now.ToString("HH:mm:ss tt").ToString());
                                        LogClass.WriteLog("-----------------------------------------------------------------------------------------");
                                    }
                                }
                            }
                        }
                    }
                    LogClass.WriteLog("App End Time: " + DateTime.Now.ToString("HH:mm:ss tt").ToString());
                }
                catch (Exception ex)
                {
                    LogClass.WriteLog(ex.Message);
                }
            }
        }