private void genGraphToolStripMenuItem_Click(object sender, EventArgs e) { DataTable Table = new DataTable(); General.LoadSQLData("RawMaterials", RawMatResultsDaa); General.Adapt.Fill(Table); General.GenGraph("Дата", "Сумма", Table); }
private void toolStripMenuItem8_Click(object sender, EventArgs e) { DataTable Table = new DataTable(); General.LoadSQLData("CounterpartyData", HumanEditorDataResults); General.Adapt.Fill(Table); General.GenGraph("Контрагент", "Количество", Table); }
private void genGraphToolStripMenuItem_Click(object sender, EventArgs e) { DataTable Table = new DataTable(); General.LoadSQLData("ResidueShopMaterials", ShopMatData); General.Adapt.Fill(Table); General.GenGraph("Дата", "Количество", Table); }
private void toolStripMenuItem8_Click(object sender, EventArgs e) { DataTable Table = new DataTable(); General.LoadSQLData(LoadString, AccountTable); General.Adapt.Fill(Table); General.GenGraph("Имя", "Количество", Table); }
private void toolStripMenuItem8_Click(object sender, EventArgs e) { DataTable Table = new DataTable(); General.LoadSQLData("CashData", CashEditor); General.Adapt.Fill(Table); General.GenGraph("Дата", "Должен", Table); }
private void удалитьToolStripMenuItem_Click(object sender, EventArgs e) { if (RowID != null) { General.DeleteFromSQLDataBase("SaledShopMaterials", "ID", RowID); General.LoadSQLData("SaledShopMaterials", ShopMatData); } RowID = null; General.SetRowIndex(ShopMatData); }
private void удалитьToolStripMenuItem_Click(object sender, EventArgs e) { if (RowID != null) { General.DeleteFromSQLDataBase("RawMaterialsResidue", "ID", RowID); General.LoadSQLData("RawMaterialsResidue", RawMatResultsDaa); } RowID = null; General.SetRowIndex(RawMatResultsDaa); }
private void удалитьToolStripMenuItem_Click(object sender, EventArgs e) { if (RowID != null) { General.DeleteFromSQLDataBase("CounterpartyData", "Имя", RowID); General.LoadSQLData("CounterpartyData", HumanEditorDataResults); } RowID = null; General.SetRowIndex(HumanEditorDataResults); }
public void LoadRecords() { try { General.LoadSQLData(TableName, "ID, Масса, Цена, Количество, КоличествоКаробок, Сумма, Дата, Поставщик, Получатель", RawMatResultsDaa); } catch (Exception ex) { General.ShowErrorBox(ex); } }
private void удалитьToolStripMenuItem_Click(object sender, EventArgs e) { if (RowID != null) { General.DeleteFromSQLDataBase(LoadString, "ID", RowID); General.LoadSQLData(LoadString, AccountTable); } RowID = null; General.SetRowIndex(AccountTable); General.SetGridStyle(AccountTable, Color.LightSeaGreen); General.SetRowIndex(AccountTable); }
public void LoadRecords() { try { General.LoadSQLData("CounterpartyData", HumanEditorDataResults); } catch (Exception ex) { General.ShowErrorBox(ex); } }
private void toolStripMenuItem28_Click(object sender, EventArgs e) { if (RowID != null) { General.DeleteFromSQLDataBase("CashData", "ID", RowID); General.LoadSQLData("CashData", CashEditor); } RowID = null; General.SetRowIndex(CashEditor); General.SetGridStyle(CashEditor, Color.LightSeaGreen); }
public void LoadRecords() { try { General.LoadSQLData("RawMaterialsResidue", RawMatResultsDaa); } catch (Exception ex) { General.ShowErrorBox(ex); } }
public void LoadRecords() { try { General.LoadSQLData("SaledShopMaterials", ShopMatData); } catch (Exception ex) { General.ShowErrorBox(ex); } }
public void LoadRecords() { try { General.LoadSQLData("ConculationData", ConculationDataEditor); } catch (Exception ex) { General.ShowErrorBox(ex); } }
void LoadData(string t) { try { General.LoadSQLData(t, DataControl); General.SetRowIndex(DataControl); } catch (Exception) { General.Connection.Close(); } }
public void InsertRecords(string Name) { //int RowsCountID = 0; //RowsCountID = General.GetRowsCount("ConculationData"); //RowsCountID += 1; General.Command = new SqlCommand("insert into ConculationData(Название) values(@name)", General.Connection); General.Connection.Open(); //General.Command.Parameters.AddWithValue("@id", RowsCountID); General.Command.Parameters.AddWithValue("@name", Name); General.Command.ExecuteNonQuery(); General.Connection.Close(); General.LoadSQLData("ConculationData", ConculationDataEditor); RowID = null; }
private void удалитьToolStripMenuItem_Click(object sender, EventArgs e) { if (RowID != null) { General.DeleteFromSQLDataBase("ConculationData", "ID", RowID); General.LoadSQLData("ConculationData", ConculationDataEditor); if (pName != null) { General.DeleteDirectory("RawList//" + pName); } } RowID = null; pName = String.Empty; General.SetRowIndex(ConculationDataEditor); }
public void InsertRecords(string Recipient, string Dolzhen, string Oplacheno, string Ostalos, string Bonus, string Date) { General.Command = new SqlCommand("insert into CashData(Поставщик, Должен, Оплаченно, Осталось, Бонус, Дата) values(@recipient, @dolzhen, @oplacheno, @ostalos, @bonus, @date)", General.Connection); General.Connection.Open(); General.Command.Parameters.AddWithValue("@recipient", Recipient); General.Command.Parameters.AddWithValue("@dolzhen", Dolzhen); General.Command.Parameters.AddWithValue("@oplacheno", Oplacheno); General.Command.Parameters.AddWithValue("@ostalos", Ostalos); General.Command.Parameters.AddWithValue("@bonus", Bonus); General.Command.Parameters.AddWithValue("@date", Date); General.Command.ExecuteNonQuery(); General.Connection.Close(); General.LoadSQLData("CashData", CashEditor); RowID = null; }
public void InsertRecords(string Name, string Price, string Count, string Provider, string Counterparty) { //int RowsCountID = 0; //RowsCountID = General.GetRowsCount("CounterpartyData"); //RowsCountID += 1; General.Command = new SqlCommand("insert into CounterpartyData(Имя, Цена, Количество, Поставщик, Контрагент) values(@name, @price, @count, @provider, @counterparty)", General.Connection); General.Connection.Open(); //General.Command.Parameters.AddWithValue("@id", RowsCountID); General.Command.Parameters.AddWithValue("@name", Name); General.Command.Parameters.AddWithValue("@price", Price); General.Command.Parameters.AddWithValue("@count", Count); General.Command.Parameters.AddWithValue("@provider", Provider); General.Command.Parameters.AddWithValue("@counterparty", Counterparty); General.Command.ExecuteNonQuery(); General.Connection.Close(); General.LoadSQLData("CounterpartyData", HumanEditorDataResults); RowID = null; }
public void InsertRecordsShop(string Name, string Mass, string Price, string Count, string CrateCount, string Date, string Provider, string Recipient) { float Summ = 0; try { float C = 0; float P = 0; C = float.Parse(Count.Replace(".", ",")); P = float.Parse(Price.Replace(".", ",")); Summ = C * P; } catch (Exception) { } //int RowsCountID = 0; //RowsCountID = General.GetRowsCount("ShopMaterials"); //RowsCountID += 1; General.Command = new SqlCommand("insert into " + TableName + "(Имя, Масса, Цена, Количество, КоличествоКаробок, Сумма, Дата, Поставщик, Получатель) values(@name, @mass, @price, @count, @cratecount, @summ, @date, @provider, @recipient)", General.Connection); General.Connection.Open(); //General.Command.Parameters.AddWithValue("@id", RowsCountID); General.Command.Parameters.AddWithValue("@name", Name); General.Command.Parameters.AddWithValue("@mass", Mass); General.Command.Parameters.AddWithValue("@price", Price); General.Command.Parameters.AddWithValue("@count", Count); General.Command.Parameters.AddWithValue("@cratecount", CrateCount); General.Command.Parameters.AddWithValue("@summ", Summ); General.Command.Parameters.AddWithValue("@date", Date); General.Command.Parameters.AddWithValue("@provider", Provider); General.Command.Parameters.AddWithValue("@recipient", Recipient); General.Command.ExecuteNonQuery(); General.Connection.Close(); General.LoadSQLData(TableName, RawMatResultsDaa); RowID = null; IDName = null; IDDate = null; hasSaved = true; }
public void InsertRecords() { if (InsertRecordsBoolean) { //int RowsCountID = 0; //RowsCountID = General.GetRowsCount(LoadString); //RowsCountID += 1; General.Command = new SqlCommand(String.Format("insert into {0}(Продукт, Цена, Количество, Сумма, Дата) values(@name, @price, @count, @summ, @date)", LoadString), General.Connection); General.Connection.Open(); //General.Command.Parameters.AddWithValue("@id", RowsCountID); General.Command.Parameters.AddWithValue("@name", ProductName); General.Command.Parameters.AddWithValue("@price", PriceString); General.Command.Parameters.AddWithValue("@count", CountString); General.Command.Parameters.AddWithValue("@summ", SumString); General.Command.Parameters.AddWithValue("@date", Date); General.Command.ExecuteNonQuery(); General.Connection.Close(); General.LoadSQLData(LoadString, AccountTable); RowID = null; General.DebtManager(Convert.ToInt32(SumString), true, LoadString); } }
public void InsertRecords(string Name, string Mass, string Price, string Count, string CrateCount, string Date, string Provider, string Recipient) { //int RowsCountID = 0; //RowsCountID = General.GetRowsCount("ShopMaterials"); //RowsCountID += 1; General.Command = new SqlCommand("insert into SaledShopMaterials(Имя, Масса, Цена, Количество, КоличествоКаробок, Дата, Поставщик, Получатель) values(@name, @mass, @price, @count, @cratecount, @date, @provider, @recipient)", General.Connection); General.Connection.Open(); //General.Command.Parameters.AddWithValue("@id", RowsCountID); General.Command.Parameters.AddWithValue("@name", Name); General.Command.Parameters.AddWithValue("@mass", Mass); General.Command.Parameters.AddWithValue("@price", Price); General.Command.Parameters.AddWithValue("@count", Count); General.Command.Parameters.AddWithValue("@cratecount", CrateCount); General.Command.Parameters.AddWithValue("@date", Date); General.Command.Parameters.AddWithValue("@provider", Provider); General.Command.Parameters.AddWithValue("@recipient", Recipient); General.Command.ExecuteNonQuery(); General.Connection.Close(); General.LoadSQLData("SaledShopMaterials", ShopMatData); RowID = null; hasSaved = true; }
public void AttachToTable() { General.LoadSQLData(LoadString, AccountTable); }
void SaveExpenseReport() { string DateData = DatePicker.Text; General.CheckForExitsDirectory(Application.StartupPath + "//Report//" + DateData); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//EState.data", MoneySumResults, false); try { General.Command = new SqlCommand("select sum(Общий) from ExpenseWorker", General.Connection); General.Connection.Open(); float ExpenseWorkerSumm = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//ExpenseWorker.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//ExpenseWorker.data", ExpenseWorkerSumm, false); string ExpenseWorkerData = Application.StartupPath + "//Report//" + DateData + "//ExpenseWorkerData.data"; General.LoadSQLData("ExpenseWorker", DView); General.SaveData(ExpenseWorkerData, DView); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Сумма) from ExpenseFood", General.Connection); General.Connection.Open(); float ExpenseFooodSumm = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//ExpenseFood.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//ExpenseFood.data", ExpenseFooodSumm, false); string ExpenseFoodData = Application.StartupPath + "//Report//" + DateData + "//ExpenseFoodData.data"; General.LoadSQLData("ExpenseFood", DView); General.SaveData(ExpenseFoodData, DView); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Сумма) from ExpenseFuel", General.Connection); General.Connection.Open(); float ExpenseFuel = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//ExpenseFuel.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//ExpenseFuel.data", ExpenseFuel, false); string ExpenseFuelData = Application.StartupPath + "//Report//" + DateData + "//ExpenseFuelData.data"; General.LoadSQLData("ExpenseFuel", DView); General.SaveData(ExpenseFuelData, DView); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Сумма) from ExpenseFirm", General.Connection); General.Connection.Open(); float ExpenseFirmSumm = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//ExpenseFirm.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//ExpenseFirm.data", ExpenseFirmSumm, false); string ExpenseFirmData = Application.StartupPath + "//Report//" + DateData + "//ExpenseFirmData.data"; General.LoadSQLData("ExpenseFirm", DView); General.SaveData(ExpenseFirmData, DView); } catch (Exception) { } }
void SaveCollectionReport() { string DateData = DatePicker.Text; General.CheckForExitsDirectory(Application.StartupPath + "//Report//" + DateData); #region Raws try { General.Command = new SqlCommand("select sum(Сумма) from RawMaterials", General.Connection); General.Connection.Open(); float ImportedRawSum = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//RawsImported.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//RawsImported.data", ImportedRawSum, false); string ReportRawMaterialsDataFileDATA = Application.StartupPath + "//Report//" + DateData + "//RawsImportedReportData.data"; General.LoadSQLData("RawMaterials", DView); General.SaveData(ReportRawMaterialsDataFileDATA, DView); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Сумма) from RemovedRawMaterials", General.Connection); General.Connection.Open(); float RemovedRawsSummData = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//RawsRemoved.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//RawsRemoved.data", RemovedRawsSummData, false); string ReportRawMaterialsRemovedDataFileDATA = Application.StartupPath + "//Report//" + DateData + "//RawsRemovedReportData.data"; General.LoadSQLData("RemovedRawMaterials", DView); General.SaveData(ReportRawMaterialsRemovedDataFileDATA, DView); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Сумма) from RawMaterialsResidue", General.Connection); General.Connection.Open(); float ResidueRawsMaterials = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//RawsResidue.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//RawsResidue.data", ResidueRawsMaterials, false); string ReportRawMaterialsResidueDataFileDATA = Application.StartupPath + "//Report//" + DateData + "//RawsResidueReportData.data"; General.LoadSQLData("RawMaterialsResidue", DView); General.SaveData(ReportRawMaterialsResidueDataFileDATA, DView); } catch (Exception) { } #endregion #region Shop try { General.Command = new SqlCommand("select sum(КоличествоКаробок) from ShopMaterials", General.Connection); General.Connection.Open(); float CrateCount = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//BState.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//BState.data", CrateCount, false); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Цена) from ShopMaterials", General.Connection); General.Connection.Open(); float ImportedShopMAterialsData = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//ShopMaterials.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//ShopMaterials.data", ImportedShopMAterialsData, false); string ImportedShopMAterialsDataFile = Application.StartupPath + "//Report//" + DateData + "//ImportedShopData.data"; General.LoadSQLData("ShopMaterials", DView); General.SaveData(ImportedShopMAterialsDataFile, DView); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Цена) from SaledShopMaterials", General.Connection); General.Connection.Open(); float SaledShopMaterials = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//ShopSaled.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//ShopSaled.data", SaledShopMaterials, false); string SaledShopMAterialsDataFile = Application.StartupPath + "//Report//" + DateData + "//SaledShopMaterialsData.data"; General.LoadSQLData("SaledShopMaterials", DView); General.SaveData(SaledShopMAterialsDataFile, DView); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Цена) from ResidueShopMaterials", General.Connection); General.Connection.Open(); float ResidueShopMaterialsData = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//ShopResidue.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//ShopResidue.data", ResidueShopMaterialsData, false); string ResidueShopMAterialsDataFile = Application.StartupPath + "//Report//" + DateData + "//ResidueShopMaterialsData.data"; General.LoadSQLData("ResidueShopMaterials", DView); General.SaveData(ResidueShopMAterialsDataFile, DView); } catch (Exception) { } #endregion #region Cash try { General.Command = new SqlCommand("select sum(Оплаченно) from CashData", General.Connection); General.Connection.Open(); float CounterPartyResults = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//CPState.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//CPState.data", CounterPartyResults, false); } catch (Exception) { } try { General.Command = new SqlCommand("select sum(Должен) from CashData", General.Connection); General.Connection.Open(); float DebtData = float.Parse(General.Command.ExecuteScalar().ToString().Replace(".", ",")); General.Connection.Close(); General.CheckForExitsFile(Application.StartupPath + "//Report//" + DateData + "//Debt.data"); General.WriteToFileValue(Application.StartupPath + "//Report//" + DateData + "//Debt.data", DebtData, false); } catch (Exception) { } try { string CashData = Application.StartupPath + "//Report//" + DateData + "//CashRecordsData.data"; General.LoadSQLData("CashData", DView); General.SaveData(CashData, DView); } catch (Exception) { } #endregion }
private void удалитьToolStripMenuItem_Click(object sender, EventArgs e) { if (RowID != null && IDName != null) { General.DeleteFromSQLDataBase(TableName, "ID", RowID); if (this.Text == "RawTable") { try { string IDStr = null; General.Command = new SqlCommand("select ID from RawMaterials where Имя=@name and Дата=@date", General.Connection); General.Connection.Open(); General.Command.Parameters.AddWithValue("@name", IDName.Trim()); General.Command.Parameters.AddWithValue("@date", IDDate.Trim()); SqlDataReader sqlReader = General.Command.ExecuteReader(); while (sqlReader.Read()) { IDStr = sqlReader["ID"].ToString(); } sqlReader.Close(); General.Connection.Close(); General.DeleteFromSQLDataBase("RawMaterials", "ID", int.Parse(IDStr)); } catch (Exception) { General.Connection.Close(); } } else if (this.Text == "ShopTable") { try { string IDStr = null; General.Command = new SqlCommand("select ID from ShopMaterials where Имя=@name and Дата=@date", General.Connection); General.Connection.Open(); General.Command.Parameters.AddWithValue("@name", IDName.Trim()); General.Command.Parameters.AddWithValue("@date", IDDate.Trim()); SqlDataReader sqlReader = General.Command.ExecuteReader(); while (sqlReader.Read()) { IDStr = sqlReader["ID"].ToString(); } sqlReader.Close(); General.Connection.Close(); General.DeleteFromSQLDataBase("ShopMaterials", "ID", int.Parse(IDStr)); } catch (Exception) { General.Connection.Close(); } } General.LoadSQLData(TableName, RawMatResultsDaa); } RowID = null; IDDate = null; IDName = null; General.SetRowIndex(RawMatResultsDaa); }