private void CreateRecord(int formId, int productionUnitId) { int?activeEmployees = GetIntValueFromInput(ActiveEmployeesInput.Text); int?employeesLeft = GetIntValueFromInput(EmployeesLeftInput.Text); int?employeesHired = GetIntValueFromInput(EmployeesHiredInput.Text); int?totalTrainingHours = GetIntValueFromInput(TotalTrainingHoursInput.Text); using (var db = new Models.SmizeeContext()) { HumanResourceSDZEEForm entity = new HumanResourceSDZEEForm(); entity.StateID = 1; entity.FormID = formId; entity.ActiveEmployees = activeEmployees; entity.EmployeesLeft = employeesLeft; entity.EmployeesHired = employeesHired; entity.TotalTrainingHours = totalTrainingHours; entity.SubmitDate = DateTime.Now; entity.SubmitUserName = User.Identity.Name; db.HumanResourceSDZEEForms.Add(entity); db.SaveChanges(); } BackPanel.Visible = true; ConfirmButtonPanel.Visible = false; DetailPanel.Visible = false; ShowInfo(MessagePanel, Resources.Resource.mCreateOK); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { SetTransactionOptions(Options, true, false, false, false, false, false, false); //SetTransactionOptions(Options); SetPageDescription(Resources.MainMenu.IM_03_08); currentOption = Options.SelectedValue; string pu = Request.QueryString["PU"]; string fefid = Request.QueryString["FID"]; string stateid = Request.QueryString["ST"]; if (fefid != null) { CompanyFormID.Value = fefid; currentOption = "UPD"; OptionsPanel.Visible = false; SearchPanel.Visible = false; DetailPanel.Visible = true; ConfirmButtonPanel.Visible = true; HumanResourceSDZEEForm entity = CxHumanResourceSDZEEForm.GetFormById(int.Parse(fefid)); FormMessageLiteral.Text = GetPeriodMessage(Resources.Resource.lForm2Message, entity.PeriodNumber, entity.Form.Periodicity.Code, entity.FormDate); if (stateid == "3") { ApprovePanel.Visible = true; ConfirmButtonPanel.Visible = false; FormMessageLiteral.Text = ""; } FillDateLiteral.Text = DateTime.Now.ToShortDateString(); ShowCurrentForm(int.Parse(fefid)); } } else { currentOption = Options.SelectedValue; } }