コード例 #1
0
 private void findtxtbox01_TextChanged(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(RawMatData, findtxtbox01.Text, 0);
 }
コード例 #2
0
 private void findtxtbox0_TextChanged(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(ShopMaterialsData, findtxtbox0.Text, 0);
 }
コード例 #3
0
 private void ShopMaterialsData_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
 {
     General.SetRowIndex(ShopMaterialsData);
 }
コード例 #4
0
 private void HumanEditorStep2_KeyDown(object sender, KeyEventArgs e)
 {
     General.FormBlock(e, this);
 }
コード例 #5
0
        private void button1_Click(object sender, EventArgs e)
        {
            ListB.Items.Clear();

            if (TextB.Text != null)
            {
                string       PName   = TextB.Text;
                StreamWriter SWriter = new StreamWriter(FileName, true, Encoding.UTF8);
                SWriter.Write(PName);
                SWriter.WriteLine();
                SWriter.Flush();
                SWriter.Close();

                if (File.Exists(FileName))
                {
                    string[] Data = File.ReadAllLines(FileName);
                    if (Data != null)
                    {
                        ListB.Items.AddRange(Data);
                    }
                }

                if (t_Type == "Shop")
                {
                    try
                    {
                        General.CreateTable(PName, String.Format("ID int IDENTITY (1, 1) not null, Имя nchar(25) not null, Масса float not null, Цена float not null, Количество float not null, КоличествоКаробок float not null, Сумма float not null, Дата nvarchar(25) not null, Поставщик nchar(30) not null, Получатель nchar(30) not null, constraint PK_{0} primary key clustered([ID] ASC)", PName));
                        ProductConculationStep1 P = new ProductConculationStep1(); P.InsertRecords(PName); P.Close();

                        bool isElementExists = false;

                        if (File.Exists(Application.StartupPath + "//Shop.Residue.Data.xml"))
                        {
                            XmlDocument xDoc = new XmlDocument();
                            xDoc.Load(Application.StartupPath + "//Shop.Residue.Data.xml");
                            XmlElement xRoot     = xDoc.DocumentElement;
                            XmlNode    childnode = xRoot.SelectSingleNode(String.Format("ShopResidue[Имя='{0}']", PName));
                            if (childnode != null)
                            {
                                isElementExists = true;
                            }
                        }

                        if (!isElementExists)
                        {
                            General.InsertRowToXMLData(Application.StartupPath + "//Shop.Residue.Data.xml", "ShopResidue", "Имя=" + PName, "Масса=NONE", "Количество=NONE", "КоличествоКаробок=NONE", "Цена=NONE", "Сумма=NONE");
                        }
                    }
                    catch (Exception ex)
                    {
                        General.ShowErrorBox(ex.Message);
                        General.Connection.Close();
                    }
                }


                if (t_Type == "Raw")
                {
                    try
                    {
                        General.CreateTable(PName, String.Format("ID int IDENTITY (1, 1) not null, Имя nchar(25) not null, Масса float not null, Цена float not null, Количество float not null, КоличествоКаробок float not null, Сумма float not null, Дата nvarchar(25) not null, Поставщик nchar(30) not null, Получатель nchar(30) not null, constraint PK_{0} primary key clustered([ID] ASC)", PName));

                        bool isElementExists = false;

                        if (File.Exists(Application.StartupPath + "//Raw.Residue.Data.xml"))
                        {
                            XmlDocument xDoc = new XmlDocument();
                            xDoc.Load(Application.StartupPath + "//Raw.Residue.Data.xml");
                            XmlElement xRoot     = xDoc.DocumentElement;
                            XmlNode    childnode = xRoot.SelectSingleNode(String.Format("RawResidue[Имя='{0}']", PName));
                            if (childnode != null)
                            {
                                isElementExists = true;
                            }
                        }

                        if (!isElementExists)
                        {
                            General.InsertRowToXMLData(Application.StartupPath + "//Raw.Residue.Data.xml", "RawResidue", "Имя=" + PName, "Масса=NONE", "Количество=NONE", "КоличествоКаробок=NONE", "Цена=NONE", "Сумма=NONE");
                        }
                    }
                    catch (Exception ex)
                    {
                        General.ShowErrorBox(ex.Message);
                        General.Connection.Close();
                    }
                }
            }

            TextB.Text = string.Empty;
        }
コード例 #6
0
 private void удалитьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     RawMatData.Rows.RemoveAt(General.GetRowIndex(RawMatData));
     General.SetRowIndex(RawMatData);
 }
コード例 #7
0
 private void количествоПоУбывToolStripMenuItem_Click(object sender, EventArgs e)
 {
     General.SortData(HumanEditorDataResults, 3, ListSortDirection.Ascending);
 }
コード例 #8
0
 private void excelToolStripMenuItem_Click(object sender, EventArgs e)
 {
     General.ExportToExcel(AccountTable);
 }
コード例 #9
0
 private void количествоПоУбывToolStripMenuItem_Click(object sender, EventArgs e)
 {
     General.SortData(AccountTable, 3, ListSortDirection.Ascending);
 }
コード例 #10
0
 private void debtToolStripMenuItem_Click(object sender, EventArgs e)
 {
     debtToolStripMenuItem.Text = String.Format("Долг: {0} Сомони", General.GetDebt(LoadString));
 }
コード例 #11
0
 private void saveAsToolStripMenuItem_Click(object sender, EventArgs e)
 {
     General.SaveBiSyTable(AccountTable);
 }
コード例 #12
0
 public void AttachToTable()
 {
     General.LoadSQLData(LoadString, AccountTable);
 }
コード例 #13
0
 private void findtxtbox0_TextChanged(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(HumanEditorDataResults, findtxtbox0.Text, 1);
 }
コード例 #14
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(HumanEditorDataResults, findtxtbox0.Text, 1);
 }
コード例 #15
0
 private void RawMatData_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e)
 {
     General.SetRowIndex(RawMatData);
 }
コード例 #16
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(AccountTable, findtxtbox0.Text, 1);
 }
コード例 #17
0
 private void toolStripMenuItem1_Click(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(RawMatData, findtxtbox01.Text, 0);
 }
コード例 #18
0
 private void findtxtbox0_TextChanged(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(AccountTable, findtxtbox0.Text, 1);
 }
コード例 #19
0
 private void сохрантьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     General.SaveData(DataFilePath, RawMatData);
 }
コード例 #20
0
 private void excelToolStripMenuItem_Click(object sender, EventArgs e)
 {
     General.ExportToExcel(HumanEditorDataResults);
 }