private void CreateRecord(int formId, int?localWorkerWithLowQualification, int?localWorkerWithMediumQualification, int?localWorkerWithHighQualification, int?externalWorkerWithLowQualification, int?externalWorkerWithMediumQualification, int?externalWorkerWithHighQualification) { using (var db = new Models.SmizeeContext()) { HumanResourceQualificationForm entity = new HumanResourceQualificationForm(); entity.StateID = 1; entity.FormID = formId; entity.ExternalWorkerWithHighQualification = externalWorkerWithHighQualification; entity.ExternalWorkerWithLowQualification = externalWorkerWithLowQualification; entity.ExternalWorkerWithMediumQualification = externalWorkerWithMediumQualification; entity.LocalWorkerWithHighQualification = localWorkerWithHighQualification; entity.LocalWorkerWithLowQualification = localWorkerWithLowQualification; entity.LocalWorkerWithMediumQualification = localWorkerWithMediumQualification; entity.SubmitDate = DateTime.Now; entity.SubmitUserName = User.Identity.Name; db.HumanResourceQualificationForms.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); SetPageDescription(Resources.MainMenu.IM_03_06); 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; HumanResourceQualificationForm entity = CxHumanResourceQualificationForm.GetFormById(int.Parse(fefid)); FormMessageLiteral.Text = GetPeriodMessage(Resources.Resource.lForm2Message, entity.PeriodNumber, entity.Form.Periodicity.Code, entity.FormDate); if (stateid == "3") { DetailPanel.Enabled = false; ApprovePanel.Visible = true; ConfirmButtonPanel.Visible = false; FormMessageLiteral.Text = ""; } ProductionUnitLiteral.Text = pu; FillDateLiteral.Text = DateTime.Now.ToShortDateString(); ShowCurrentForm(int.Parse(fefid)); } } else { currentOption = Options.SelectedValue; User user = WebSecurity.GetUserInfo(Page.User.Identity.Name); int? companyId = user.CompanyID; if (companyId != null && companyId != 0) { ddlCompany.SelectedValue = companyId.ToString(); ddlCompany.Enabled = false; } } }