public frmSalaryExtraWorksEdit(int?_nExtraWorkID) { if (_nExtraWorkID.HasValue) { nExtraWorkID = (int)_nExtraWorkID; } oExtraWork = new SalaryExtraWork(); if (oExtraWork.ErrorNumber != 0) { IsValid = false; } oUser = new User(); if (oUser.ErrorNumber != 0) { IsValid = false; } oOwner = new Partner(); if (oOwner.ErrorNumber != 0) { IsValid = false; } if (IsValid) { InitializeComponent(); } }
public frmSalaryExtraWorks() { oExtraWorkList = new SalaryExtraWork(); if (oExtraWorkList.ErrorNumber != 0) { IsValid = false; } if (IsValid) { InitializeComponent(); } }
private void btnSave_Click(object sender, EventArgs e) { // Проверить наличие записи на ту же дату DateTime dDate = dtpDateBeg.Value.Date; SalaryExtraWork oSalaryTemp = new SalaryExtraWork(); oSalaryTemp.FillTableSalaryTariffs(); foreach (DataRow sr in oSalaryTemp.TableSalaryTariffs.Rows) { DateTime dExistDate = Convert.ToDateTime(sr["DateBeg"]); if (dDate.CompareTo(dExistDate) == 0 && (int)sr["ID"] != nID) { RFMMessage.MessageBoxError("Уже есть тарифы на указанную дату..."); return; } } DataRow r = oSalaryTariff.TableSalaryTariffs.Rows[0]; r["DateBeg"] = dDate; r["InputsItemsRelative"] = numInputsItemsRelative.Value; r["AccInputsOperations"] = numAccInputsOperations.Value; r["MovesUpOperations"] = numMovesUpOperations.Value; r["MovesDownOperations"] = numMovesDownOperations.Value; r["MovesFloorOperations"] = numMovesFloorOperations.Value; r["PickOutputsLines"] = numPickOutputsLines.Value; r["PickOutputsBoxes"] = numPickOutputsBoxes.Value; r["PickOutputsNetto"] = numPickOutputsNetto.Value; r["OutputsLines"] = numOutputsLines.Value; r["OutputsBoxes"] = numOutputsBoxes.Value; r["OutputsNetto"] = numOutputsNetto.Value; r["ValidateOutputsLines"] = numValidateOutputsLines.Value; r["ValidateOutputsBoxes"] = numValidateOutputsBoxes.Value; r["ValidateOutputsNetto"] = numValidateOutputsNetto.Value; r["MovingsBoxes"] = numMovingsBoxes.Value; r["InventoriesCells"] = numInventoriesCells.Value; r["UserID"] = ((RFMFormBase)Application.OpenForms[0]).UserInfo.UserID; oSalaryTariff.ClearError(); oSalaryTariff.SaveTariffs(ref nID); if (oSalaryTariff.ErrorNumber == 0) { if (oSalaryTariff.ErrorNumber == 0 && nID > 0) { MotherForm.GotParam = new object[] { nID }; DialogResult = DialogResult.Yes; Dispose(); } } }
private void btnWorkSelect_Click(object sender, EventArgs e) { // ранее введеные значения SalaryExtraWork oExtraWorkTemp = new SalaryExtraWork(); oExtraWorkTemp.FilterDateBeg = DateTime.Now.Date.AddMonths(-1); oExtraWorkTemp.FilterDateEnd = DateTime.Now.Date; oExtraWorkTemp.FillData(); if (oExtraWorkTemp.ErrorNumber != 0 || oExtraWorkTemp.MainTable == null) { return; } if (oExtraWorkTemp.MainTable.Rows.Count == 0) { RFMMessage.MessageBoxError("Нет данных..."); return; } DataTable dtWorkNamesDistinct = new DataTable(); dtWorkNamesDistinct.Columns.Add("WorkName"); System.Collections.Hashtable hash = new System.Collections.Hashtable(); foreach (DataRow row in oExtraWorkTemp.MainTable.Rows) { hash[row["WorkName"]] = row["WorkName"]; } foreach (object name in hash.Values) { dtWorkNamesDistinct.Rows.Add(name); } DataTable tdWorkNames = CopyTable(dtWorkNamesDistinct, "tdWorkNames", "WorkName > ''", "WorkName"); if (StartForm(new frmSelectID(this, tdWorkNames, "WorkName", "Дополнительная работа", false)) == DialogResult.Yes) { if (_SelectedID == null) { return; } txtWorkName.Text = _SelectedText; } _SelectedID = null; _SelectedText = ""; tabSalaryExtraWorks.IsNeedRestore = true; return; }
public frmSalaryTariffsEdit(int?_nID) { if (_nID.HasValue) { nID = (int)_nID; } else { nID = 0; } oSalaryTariff = new SalaryExtraWork(); if (oSalaryTariff.ErrorNumber != 0) { IsValid = false; } if (IsValid) { InitializeComponent(); } }