private void ProsessSave(string UseCheck, string Status, int process_id) { if (MessageBox.Show($"공정을 {Status}하시겠습니까?", "", MessageBoxButtons.YesNo) == DialogResult.Yes) { ProcessVO process = new ProcessVO { process_id = process_id, factory_id = cboFactoryName.SelectedValue.ToInt(), line_id = cboLineName.SelectedValue.ToInt(), storage_id = cboStorageName.SelectedValue.ToInt(), process_name = txtName.Text, process_seq = Convert.ToInt32((nudProcess_seq.Value.ToString().Length > 0) ? nudProcess_seq.Value.ToString() : "0"), process_use = UseCheck, first_regist_employee = employeeName, final_regist_employee = employeeName, process_note1 = txtNote1.Text, process_note2 = txtNote2.Text }; if (service.SaveProcess(process)) { this.DialogResult = DialogResult.OK; this.Close(); } } }
private void Search(object sender, EventArgs e) { if (((MainForm)this.MdiParent).ActiveMdiChild == this) { dgvProcess.EndEdit(); string fname = txtProcessName.Text.Trim(); ProcessVO vo = new ProcessVO() { corporation_id = cboCorporationName.SelectedValue.ToInt(), factory_id = cboFactoryName.SelectedValue.ToInt(), line_id = cboLineName.SelectedValue.ToInt(), storage_id = cboStorageName.SelectedValue.ToInt() }; dtDgv = service.ProcessSearch(vo); DataView dv = dtDgv.DefaultView; if (fname.Length > 0) { dv.RowFilter = $"process_name like '%{fname}%'"; } dgvProcess.DataSource = dv; DataTable dt = dv.ToTable(); List <ProcessVO> sortedData = SqlHelper.ConvertDataTableToList <ProcessVO>(dt); dgvProcess.DataSource = sortedData; } }
public ProcessPopupForm(string employeeName, bool IsUpdate, ProcessVO vo) { InitializeComponent(); this.IsUpdate = IsUpdate; this.employeeName = employeeName; if (IsUpdate == true) { this.vo = vo; } }
private void OpenPopup(bool IsUpdate, ProcessVO vo = null) { if (((MainForm)this.MdiParent).ActiveMdiChild == this) { ProcessPopupForm frm = new ProcessPopupForm(emp.Employee_name, IsUpdate, vo); if (frm.ShowDialog() == DialogResult.OK) { LoadData(); } } }
// private static Logger logger = LogManager.GetCurrentClassLogger(); public ActionResult Index() { ViewBag.CoreAssemblyInfo = SomeCoreClass.GetAssemblyInfo(); ViewBag.DataAccessAssemblyInfo = SomeDataAccessClass.GetAssemblyInfo(); Assembly assembly = Assembly.GetExecutingAssembly(); string webAsseblyInfo = string.Format("Full Name = \"{0}\"; Informational Version = \"{1}\"", assembly.FullName, FileVersionInfo.GetVersionInfo(assembly.Location).ProductVersion); ViewBag.WebAssemblyInfo = webAsseblyInfo; //logger.Trace("Trace--You have visited the Index view"); //logger.Debug("Debug--You have visited the Index view"); //logger.Info("Info--You have visited the Index view"); ProcessVO vo = new ProcessVO(); return(View()); }
public DataTable ProcessSearch(ProcessVO vo) { DataTable dt = new DataTable(); try { using (SqlConnection conn = new SqlConnection(this.ConnectionString)) { string sql = @"SELECT c.corporation_name, f.[factory_name], l.line_name, [process_name], [process_id], S.storage_name, [process_note1], [process_note2], [process_seq], [process_use], p.[first_regist_time], p.[first_regist_employee], p.[final_regist_time], p.[final_regist_employee] from [dbo].[TBL_PROCESS] p, [dbo].[TBL_LINE] l, [dbo].[TBL_FACTORY] f, [dbo].[TBL_CORPORATION] c, [dbo].[TBL_STORAGE] s where p.line_id = l.line_id and p.storage_id = s.storage_id and l.factory_id = f.factory_id and f.corporation_id = c.corporation_id and (@corporation_id = 0 or c.corporation_id = @corporation_id) and (@factory_id = 0 or f.factory_id = @factory_id) and (@line_id = 0 or p.line_id = @line_id) and (@storage_id = 0 or p.storage_id =@storage_id) Order by process_seq asc;;"; using (SqlCommand cmd = new SqlCommand(sql, conn)) { cmd.Parameters.AddWithValue("@corporation_id", vo.corporation_id); cmd.Parameters.AddWithValue("@factory_id", vo.factory_id); cmd.Parameters.AddWithValue("@line_id", vo.line_id); cmd.Parameters.AddWithValue("@storage_id", vo.storage_id); SqlDataAdapter da = new SqlDataAdapter(cmd); cmd.Connection.Open(); da.Fill(dt); cmd.Connection.Close(); } return(dt); } } catch (Exception err) { throw err; } }
private void dgvProcess_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex < 0 || e.ColumnIndex == 10) { return; } ProcessVO updatevo = new ProcessVO { corporation_name = dgvProcess[1, e.RowIndex].Value.ToString(), factory_name = dgvProcess[2, e.RowIndex].Value.ToString(), line_name = dgvProcess[3, e.RowIndex].Value.ToString(), storage_name = dgvProcess[4, e.RowIndex].Value.ToString(), process_id = dgvProcess[5, e.RowIndex].Value.ToInt(), process_name = dgvProcess[6, e.RowIndex].Value.ToString(), process_seq = dgvProcess[7, e.RowIndex].Value.ToInt(), process_note1 = dgvProcess[8, e.RowIndex].Value.ToString(), process_note2 = dgvProcess[9, e.RowIndex].Value.ToString(), process_use = dgvProcess[11, e.RowIndex].Value.ToString() }; OpenPopup(true, updatevo); }
public bool SaveProcess(ProcessVO vo) { try { using (SqlConnection conn = new SqlConnection(this.ConnectionString)) { conn.Open(); string sql = "SP_SAVE_PROCESS"; using (SqlCommand cmd = new SqlCommand(sql, conn)) { cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@P_process_id", vo.process_id); cmd.Parameters.AddWithValue("@P_process_name", vo.process_name); cmd.Parameters.AddWithValue("@P_storage_id", vo.storage_id); cmd.Parameters.AddWithValue("@P_line_id", vo.line_id); cmd.Parameters.AddWithValue("@P_process_seq", vo.process_seq); cmd.Parameters.AddWithValue("@P_process_use", vo.process_use); cmd.Parameters.AddWithValue("@P_process_note1", vo.process_note1); cmd.Parameters.AddWithValue("@P_process_note2", vo.process_note2); cmd.Parameters.AddWithValue("@P_first_regist_employee", vo.first_regist_employee); cmd.Parameters.AddWithValue("@P_final_regist_employee", vo.final_regist_employee); cmd.ExecuteNonQuery(); } return(true); } } catch (Exception err) { return(false); throw err; } }
public bool SaveProcess(ProcessVO vo) { return(dac.SaveProcess(vo)); }
public DataTable ProcessSearch(ProcessVO vo) { return(dac.ProcessSearch(vo)); }