private void HumanEditorStep2_Load(object sender, EventArgs e)
 {
     LoadRecords();
     General.SetRowIndex(AccountTableList);
     General.ChangeWidth(AccountTableList);
     General.SetGridStyle(AccountTableList, Color.MediumTurquoise);
 }
Пример #2
0
        private void StorageViewer_Load(object sender, EventArgs e)
        {
            if (LoadDataType == "Raw")
            {
                General.LoadSQLData("RawMaterials", ImportedMaterials);
                General.LoadSQLData("RemovedRawMaterials", RemovedMaterials);
                General.LoadSQLData("RawMaterialsResidue", ResidueMaterials);
            }
            else if (LoadDataType == "Shop")
            {
                General.LoadSQLData("ShopMaterials", ImportedMaterials);
                General.LoadSQLData("SaledShopMaterials", RemovedMaterials);
                General.LoadSQLData("ResidueShopMaterials", ResidueMaterials);
            }

            General.ChangeWidth(ImportedMaterials);
            General.ChangeWidth(RemovedMaterials);
            General.ChangeWidth(ResidueMaterials);
            General.SetRowIndex(ImportedMaterials);
            General.SetRowIndex(RemovedMaterials);
            General.SetRowIndex(ResidueMaterials);
            General.SetGridStyle(ImportedMaterials, Color.Aqua);
            General.SetGridStyle(RemovedMaterials, Color.LightBlue);
            General.SetGridStyle(ResidueMaterials, Color.LightSalmon);
        }
Пример #3
0
 private void RawMatFormStep2_Load(object sender, EventArgs e)
 {
     LoadRecords();
     General.SetRowIndex(ShopMatData);
     General.SetGridStyle(ShopMatData, Color.CornflowerBlue);
     General.ChangeWidth(ShopMatData);
 }
 private void RawMaterials_Load(object sender, EventArgs e)
 {
     /*General.CheckForExitsFile(DataFilePath);*/
     General.LoadData(DataFilePath, RawMatData);
     General.ChangeWidth(RawMatData);
     General.SetGridStyle(RawMatData, Color.MediumTurquoise);
 }
 private void CashFormViewer_Load(object sender, EventArgs e)
 {
     LoadRecords();
     General.ChangeWidth(CashEditor);
     General.SetRowIndex(CashEditor);
     General.SetGridStyle(CashEditor, Color.LightSeaGreen);
 }
 private void BasarAndProdovecForm_Load(object sender, EventArgs e)
 {
     /*General.CheckForExitsFile(DataFilePath);*/
     General.LoadData(DataFilePath, humanEditorData);
     General.ChangeWidth(humanEditorData);
     General.SetGridStyle(humanEditorData, Color.MediumTurquoise);
 }
 private void HumanEditorStep2_Load(object sender, EventArgs e)
 {
     LoadRecords();
     /*General.CheckForExitsFile(DataFilePath);*/
     General.SetRowIndex(HumanEditorDataResults);
     General.ChangeWidth(HumanEditorDataResults);
     General.SetGridStyle(HumanEditorDataResults, Color.MediumTurquoise);
 }
Пример #8
0
 private void RawMatFormStep2_Load(object sender, EventArgs e)
 {
     LoadRecords();
     /*General.CheckForExitsFile(DataFilePath);*/
     General.SetRowIndex(RawMatResultsDaa);
     General.SetGridStyle(RawMatResultsDaa, Color.CornflowerBlue);
     General.ChangeWidth(RawMatResultsDaa);
 }
 private void ProductConculationStep1_Load(object sender, EventArgs e)
 {
     // TODO: This line of code loads data into the 'mineDataDataSet3.ConculationData' table. You can move, or remove it, as needed.
     this.conculationDataTableAdapter.Fill(this.mineDataDataSet3.ConculationData);
     LoadRecords();
     General.SetGridStyle(ConculationDataEditor, Color.Aqua);
     General.ChangeWidth(ConculationDataEditor);
 }
Пример #10
0
 private void ShopMaterialsStep2_Load(object sender, EventArgs e)
 {
     LoadRecords();
     General.SetRowIndex(ShopMatResultsDaa);
     /*General.CheckForExitsFile(DataFilePath);*/
     General.ChangeWidth(ShopMatResultsDaa);
     General.SetGridStyle(ShopMatResultsDaa, Color.MediumTurquoise);
 }
Пример #11
0
 private void HumanEditorStep2_Load(object sender, EventArgs e)
 {
     // TODO: This line of code loads data into the 'mineDataDataSet3.CounterpartyData' table. You can move, or remove it, as needed.
     //this.counterpartyDataTableAdapter.Fill(this.mineDataDataSet3.CounterpartyData);
     LoadRecords();
     /*General.CheckForExitsFile(DataFilePath);*/
     General.SetRowIndex(AccountTable);
     General.ChangeWidth(AccountTable);
     General.SetGridStyle(AccountTable, Color.MediumTurquoise);
 }
Пример #12
0
        private void RawMatFormStep2_Load(object sender, EventArgs e)
        {
            if (DataControl.Columns.Count > 0)
            {
                DataControl.DataMember = null;
                DataControl.DataSource = null;
                DataControl.Rows.Clear();
                DataControl.Columns.Clear();
            }

            try
            {
                if (t_Type == "RawResidue")
                {
                    if (DataControl.Columns.Count > 0)
                    {
                        DataControl.DataMember = null;
                        DataControl.DataSource = null;
                        DataControl.Rows.Clear();
                        DataControl.Columns.Clear();
                    }
                    if (!File.Exists(Application.StartupPath + "//Raw.Residue.Data.xml"))
                    {
                        General.ShowErrorBox("Список продуктов сырья отсутствует!\nВозможно была потеря данных, обратитесь к администрации программы!");
                    }
                    else
                    {
                        XmlDocument xDoc = new XmlDocument();
                        xDoc.Load(Application.StartupPath + "//Raw.Residue.Data.xml");
                        XmlElement  xRoot            = xDoc.DocumentElement;
                        XmlNodeList RowsCountElement = xRoot.SelectNodes("RawResidue");
                        if (RowsCountElement != null)
                        {
                            foreach (XmlNode xNode in RowsCountElement)
                            {
                                XmlNode nameChildNode = xNode.SelectSingleNode("Имя");
                                string  elemNameStr   = "NONE";
                                if (nameChildNode != null)
                                {
                                    elemNameStr = nameChildNode.InnerText;
                                    XmlNode massElem   = xNode.SelectSingleNode("Масса");
                                    XmlNode countElem  = xNode.SelectSingleNode("Количество");
                                    XmlNode cratesElem = xNode.SelectSingleNode("КоличествоКаробок");
                                    XmlNode pricesElem = xNode.SelectSingleNode("Цена");
                                    XmlNode summElem   = xNode.SelectSingleNode("Сумма");

                                    if (massElem != null && countElem != null && cratesElem != null && pricesElem != null && summElem != null)
                                    {
                                        if (massElem.InnerText == "NONE" && countElem.InnerText == "NONE" && cratesElem.InnerText == "NONE" && pricesElem.InnerText == "NONE" && summElem.InnerText == "NONE")
                                        {
                                            massElem.InnerText   = General.SumColumnDataSQL("Масса", elemNameStr).ToString();
                                            countElem.InnerText  = General.SumColumnDataSQL("Количество", elemNameStr).ToString();
                                            cratesElem.InnerText = General.SumColumnDataSQL("КоличествоКаробок", elemNameStr).ToString();
                                            pricesElem.InnerText = General.SumColumnDataSQL("Цена", elemNameStr).ToString();
                                            summElem.InnerText   = General.SumColumnDataSQL("Сумма", elemNameStr).ToString();
                                        }
                                    }
                                }
                            }
                        }
                        StreamWriter SWriter = new StreamWriter(Application.StartupPath + "//Raw.Residue.Data.xml", false, Encoding.UTF8);
                        xDoc.Save(SWriter);
                        SWriter.Flush();
                        SWriter.Close();
                        try
                        {
                            General.LoadData(Application.StartupPath + "//Raw.Residue.Data.xml", DataControl);
                        }
                        catch (Exception) { }
                    }
                }
                else if (t_Type == "ShopResidue")
                {
                    if (DataControl.Columns.Count > 0)
                    {
                        DataControl.DataMember = null;
                        DataControl.DataSource = null;
                        DataControl.Rows.Clear();
                        DataControl.Columns.Clear();
                    }
                    if (!File.Exists(Application.StartupPath + "//Shop.Residue.Data.xml"))
                    {
                        General.ShowErrorBox("Список продуктов цеха отсутствует!\nВозможно была потеря данных, обратитесь к администрации программы!");
                    }
                    else
                    {
                        XmlDocument xDoc = new XmlDocument();
                        xDoc.Load(Application.StartupPath + "//Shop.Residue.Data.xml");
                        XmlElement  xRoot            = xDoc.DocumentElement;
                        XmlNodeList RowsCountElement = xRoot.SelectNodes("ShopResidue");
                        if (RowsCountElement != null)
                        {
                            foreach (XmlNode xNode in RowsCountElement)
                            {
                                XmlNode nameChildNode = xNode.SelectSingleNode("Имя");
                                string  elemNameStr   = "NONE";
                                if (nameChildNode != null)
                                {
                                    elemNameStr = nameChildNode.InnerText;
                                    XmlNode massElem   = xNode.SelectSingleNode("Масса");
                                    XmlNode countElem  = xNode.SelectSingleNode("Количество");
                                    XmlNode cratesElem = xNode.SelectSingleNode("КоличествоКаробок");
                                    XmlNode pricesElem = xNode.SelectSingleNode("Цена");
                                    XmlNode summElem   = xNode.SelectSingleNode("Сумма");

                                    if (massElem != null && countElem != null && cratesElem != null && pricesElem != null && summElem != null)
                                    {
                                        if (massElem.InnerText == "NONE" && countElem.InnerText == "NONE" && cratesElem.InnerText == "NONE" && pricesElem.InnerText == "NONE" && summElem.InnerText == "NONE")
                                        {
                                            massElem.InnerText   = General.SumColumnDataSQL("Масса", elemNameStr).ToString();
                                            countElem.InnerText  = General.SumColumnDataSQL("Количество", elemNameStr).ToString();
                                            cratesElem.InnerText = General.SumColumnDataSQL("КоличествоКаробок", elemNameStr).ToString();
                                            pricesElem.InnerText = General.SumColumnDataSQL("Цена", elemNameStr).ToString();
                                            summElem.InnerText   = General.SumColumnDataSQL("Сумма", elemNameStr).ToString();
                                        }
                                    }
                                }
                            }
                        }
                        StreamWriter SWriter = new StreamWriter(Application.StartupPath + "//Shop.Residue.Data.xml", false, Encoding.UTF8);
                        xDoc.Save(SWriter);
                        SWriter.Flush();
                        SWriter.Close();
                        try
                        {
                            General.LoadData(Application.StartupPath + "//Shop.Residue.Data.xml", DataControl);
                        }
                        catch (Exception) { }
                    }
                }
                else
                {
                    LoadData();
                }
            }
            catch (Exception) { }
            General.SetRowIndex(DataControl);
            General.SetGridStyle(DataControl, Color.CornflowerBlue);
            General.ChangeWidth(DataControl);
        }