private void findtxtbox01_TextChanged(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(RawMatData, findtxtbox01.Text, 0);
 }
 private void findtxtbox0_TextChanged(object sender, EventArgs e)
 {
     General.SearchFromDataGridViewControl(ShopMaterialsData, findtxtbox0.Text, 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);
 }
        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;
        }
 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);
 }
 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);
 }
 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);
 }
 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);
 }