/// <summary> /// THIS METHOD REGISTER TO ANY TECHNICIAN. /// WHERE ANYONE CAN TO MAKE THE REPAIR THIS BOARD. /// </summary> public void InsertAnalysisRepairAll() { try { string IdAction = "WAITING"; DAL.ProcessRepair mod = new DAL.ProcessRepair(); mod.RepairMan = ddlSendRepair.SelectedValue; mod.EntradaId = Convert.ToInt32(lblCodigo.Text); mod.ActionRepainMan = Convert.ToString(IdAction); mod.LocationSmd = ddlLocation.SelectedItem.Text; mod.PartNumber = txtPartNumber.Text; var reg = new ListaDePlacaParaReparoOQC(); reg.InsertAnalisysRepairAll(mod); } catch (Exception ex) { ErrorMessage.Text = "Error to the Insert Analysis RepairMan: " + ex.Message; } }
/// <summary> /// AQUI FAZ O UPDATE NA TABELA PRINCIPAL /// </summary> public void UpdateReparo() { try { string user = HttpContext.Current.User.Identity.GetUserName(); DAL.ProcessRepair mod = new DAL.ProcessRepair(); mod.EntradaId = Convert.ToInt32(lblCodigo.Text); mod.UN = txtUn.Text; mod.DefectCauseId = Convert.ToInt32(ddlDefectCause.SelectedValue); mod.LocationSmd = ddlLocation.SelectedItem.Text; mod.lote = txtLote.Text; mod.ActionId = Convert.ToInt32(ddlAction.SelectedValue); mod.TecnicoResponsavel = user; mod.statusRepair = ddlStatus.SelectedItem.Text; var add = new ListaDePlacaParaReparoOQC(); add.UptadeRepair(mod); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Registro feito com sucesso');", true); } catch (Exception ex) { ErrorMessage.Text = "Error ao atualizar o repapro! " + ex.Message; //ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Registro feito com sucesso');", true); } }
protected void btnRegistrar_Click(object sender, EventArgs e) { try { if (ddlUnitId.SelectedItem.Text == "SUB ASSY") //verifica a opção do Unit Id. Nesta opção sera logado todos os campos { if (User != null) //Verifica se existe usuario logago { string codLocation = "N/A"; string user = HttpContext.Current.User.Identity.GetUserId(); DAL.ProcessRepair modelo = new DAL.ProcessRepair(); modelo.EntradaId = Convert.ToInt32(lblCodEntrada.Text); modelo.ProductId = Convert.ToInt32(ddlProduto.SelectedValue); modelo.Unitid = Convert.ToInt32(ddlUnitId.SelectedValue); modelo.UN = txtUn.Text.ToString().ToUpper();; modelo.InsProcessID = Convert.ToInt32(ddlInpsProcess.SelectedValue); modelo.DefectCauseId = Convert.ToInt32(ddlDefectCause.SelectedValue); modelo.LocationId = Convert.ToInt32(ddlLocation.SelectedValue); modelo.LocationSmd = codLocation; modelo.DefectImputId = Convert.ToInt32(ddlDefectImput.SelectedValue); modelo.lote = txtLote.Text.ToString().ToUpper();; modelo.PartNumber = txtPartNumber.Text.ToString().ToUpper(); modelo.ActionId = Convert.ToInt32(ddlAction.SelectedValue); modelo.StatusId = Convert.ToInt32(ddlStatus.SelectedValue); modelo.RepairMan = user; modelo.Comment = txtComment.Text.ToString().ToUpper(); modelo.EntradaSMDId = 0; var salve = new RegistroPrincipalReparoMain(); salve.RegitrarReparoMainNPC(modelo); txtCn.Text = string.Empty; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Registro feito com sucesso');", true); Panel1.Visible = false; lblMsgError.Text = string.Empty; } else { lblMsgError.Text = "Nenhum usuário logado! Por favor você precisa estar logado no sistema para esta função"; lblMsgError.ForeColor = Color.Red; } if (ckbMassa.Checked != true) //Caso o Checkbox for true registro sera em massa { //GetProducts(); GetUnit(); GetInspProcess(); //GetArea(); GetDefectCause(); GetStatus(); GetActions(); GetLocation(); GetDefectInput(); txtCn.Focus(); txtUn.Text = string.Empty; txtModels.Text = string.Empty; //txtSimtomas.Text = string.Empty; //txtBlocks.Text = string.Empty; txtLote.Text = string.Empty; txtPartNumber.Text = string.Empty; txtComment.Text = string.Empty; } else if (ckbMassa.Checked == true) { txtCn.Focus(); } } else if (ddlUnitId.SelectedItem.Text == "MAIN B/D") { if (User != null) { string user = HttpContext.Current.User.Identity.GetUserId(); DAL.ProcessRepair modelo = new DAL.ProcessRepair(); modelo.EntradaId = Convert.ToInt32(lblCodEntrada.Text); modelo.ProductId = Convert.ToInt32(ddlProduto.SelectedValue); modelo.Unitid = Convert.ToInt32(ddlUnitId.SelectedValue); modelo.InsProcessID = Convert.ToInt32(ddlInpsProcess.SelectedValue); modelo.StatusId = Convert.ToInt32(ddlStatus.SelectedValue); modelo.PartNumber = txtPartNumber.Text; modelo.RepairMan = user; modelo.Comment = txtComment.Text.ToString().ToUpper(); modelo.EntradaSMDId = 0; var salve = new RegistroPrincipalReparoMain(); salve.RegitrarReparoMainNUllNPC(modelo); txtCn.Text = string.Empty; Panel1.Visible = false; ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Registro feito com sucesso');", true); lblMsgError.Text = string.Empty; } else { lblMsgError.Text = "Nenhum usuário logado! Por favor você precisa estar logado no sistema para esta função"; lblMsgError.ForeColor = Color.Red; } if (ckbMassa.Checked != true) { //GetProducts(); GetUnit(); GetInspProcess(); //GetArea(); GetDefectCause(); GetStatus(); GetActions(); GetLocation(); GetDefectInput(); txtCn.Focus(); txtUn.Text = string.Empty; txtModels.Text = string.Empty; GetSintomas(); //txtBlocks.Text = string.Empty; txtLote.Text = string.Empty; txtPartNumber.Text = string.Empty; txtComment.Text = string.Empty; } else if (ckbMassa.Checked == true) { txtCn.Focus(); } } } catch (Exception ex) { Panel1.Visible = true; lblMsgError.Text = "Erro ao registrar: " + ex.Message; lblMsgError.ForeColor = Color.Red; } }
protected void btnSalvar_Click(object sender, EventArgs e) { if (lblStatusFinally.Text == "") { UpdateReparo(); ListaPlacaParaReparo(); } if (ddlSendRepair.SelectedItem.Text != "ALL" && lblStatusFinally.Text == "" && ddlStatus.SelectedValue == "4") { InsertAnalysisRepairMan(); ListaPlacaParaReparo(); } if (ddlSendRepair.SelectedItem.Text != "ALL" && ddlStatus.SelectedValue == "4" && lblStatusFinally.Text == "WAITING") { var mod = new SeacherRepair(); string statusFinal = ""; mod.EntradaId = Convert.ToInt32(lblCodigo.Text); mod.StatusRepair = ddlStatus.SelectedItem.Text; mod.StatusFinal = statusFinal; var obj = new Class_ListToRepair(); obj.UpdateReturnRepair(mod); InsertAnalysisRepairMan(); ListaPlacaParaReparo(); } if (ddlSendRepair.SelectedItem.Text == "ALL" && lblStatusFinally.Text == "") { string user = HttpContext.Current.User.Identity.GetUserId(); DAL.ProcessRepair mod = new DAL.ProcessRepair(); mod.EntradaId = Convert.ToInt32(lblCodigo.Text); mod.RepairMan = user; var obj = new Class_ListToRepair(); obj.UpdateUserName(mod); InsertAnalysisRepairAll(); ListaPlacaParaReparo(); } if (lblStatusFinally.Text == "WAITING" && ddlStatus.SelectedItem.Text == "PASS/TERMINATE") { string user = HttpContext.Current.User.Identity.GetUserId(); var mod = new SeacherRepair(); string statusFinal = "PASS/TERMINATE"; mod.EntradaId = Convert.ToInt32(lblCodigo.Text); mod.StatusRepair = ddlStatus.SelectedItem.Text; mod.StatusFinal = statusFinal; mod.UserName = user; var add = new ListaDePlacaParaReparoOQC(); add.UpdateTerminate(mod); add.UpdateTerminateNULL(mod); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Reparo Finalizado com sucesso.');", true); ListaPlacaParaReparo(); } if (lblStatusFinally.Text == "WAITING" && ddlStatus.SelectedItem.Text == "SCRAP/TERMINATE") { string user = HttpContext.Current.User.Identity.GetUserId(); string statusFinal = "SCRAP/TERMINATE"; var mod = new SeacherRepair(); mod.EntradaId = Convert.ToInt32(lblCodigo.Text); mod.StatusRepair = ddlStatus.SelectedItem.Text; mod.StatusFinal = statusFinal; mod.UserName = user; var add = new ListaDePlacaParaReparoOQC(); add.UpdateTerminate(mod); add.UpdateTerminateNULL(mod); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Item enviado para Scrap.');", true); ListaPlacaParaReparo(); } if (lblStatusFinally.Text == "WAITING" && ddlStatus.SelectedItem.Text == "FEEDBACK") { string user = HttpContext.Current.User.Identity.GetUserId(); string statusFinal = "FEEDBACK/TERMINATE"; var mod = new SeacherRepair(); mod.EntradaId = Convert.ToInt32(lblCodigo.Text); mod.StatusRepair = ddlStatus.SelectedItem.Text; mod.StatusFinal = statusFinal; mod.UserName = user; var add = new ListaDePlacaParaReparoOQC(); add.UpdateTerminate(mod); add.UpdateTerminateNULL(mod); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Item enviado para Feedack.');", true); ListaPlacaParaReparo(); } if (ddlStatus.SelectedValue == "4" && lblStatusFinally.Text == "WAITING" && ddlSendRepair.SelectedItem.Text == "ALL") { string statusFinal = ""; string user = HttpContext.Current.User.Identity.GetUserId(); var mod = new SeacherRepair(); mod.EntradaId = Convert.ToInt32(lblCodigo.Text); mod.StatusRepair = ddlStatus.SelectedItem.Text; mod.StatusFinal = statusFinal; mod.UserName = user; var add = new Class_ListToRepair(); //Atualizar o dados de returno ao reparo add.UpdateReturnRepair(mod); //Atualiza o usuario para a tabela tecnicoMaisPlaca add.UpdateTerminateNULL(mod); //Insiere um novo registro na tabela AnalysisRepairMan InsertAnalysisRepairAll(); ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Reparo retornado com sucesso!');", true); ListaPlacaParaReparo(); } ListaPlacaParaReparo(); }