Exemplo n.º 1
0
 public void ListaPlacaParaReparo()
 {
     try
     {
         string UserLogado     = HttpContext.Current.User.Identity.GetUserId();//AQUI RECUPERA O ID USUARIO LOGADO PARA REGISTRAR NO BANCO
         string UserLogadoName = HttpContext.Current.User.Identity.GetUserName();
         var    lista          = new ListaDePlacaParaReparoOQC();
         GridView1.DataSource = lista.ListaPlacaParaReparo(UserLogado);
         GridView1.DataBind();
         if (GridView1.Rows.Count > 0)
         {
             Logado.InnerText = "Ola, " + UserLogadoName + " segue abaixo sua lista de placas para reparo!";
             Panel7.Visible   = true;
         }
         else
         {
             Logado.InnerText = "Ola, " + UserLogadoName + " não há nenhuma placa registrada para você!";
             Panel7.Visible   = false;
         }
     }
     catch (Exception ex)
     {
         ErrorMessage.Text = "Erro ao listar os dados: " + ex.Message;
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// ESTE ABAIXO MOSTRA A INFORMAÇAÕ NO FORMULARIO DE REPARO FEITO PELO TECNICO.
        /// ESTACIA DA CLASS LISTADEPLACAPARAREPAROOQC - METODO: MOSTRARDADOSPARAREPAIR
        /// </summary>
        //public void MostrarDadosParaReparo()
        //{
        //    try
        //    {
        //        string objCod = lblCodigo.Text;
        //        var objLista = new ListaDePlacaParaReparoOQC();
        //        Pesquisas objModel = objLista.MostrarDadosRepaiMan(objCod);
        //        if(objModel!=null)
        //        {
        //            lblUn.Text = objModel.UN;
        //            lblCN.Text = objModel.CN;
        //            lblCausa.Text = objModel.Causa;
        //            lblPartNumber.Text = objModel.Causa;
        //            lblLote.Text = objModel.Lote;
        //            lblLocation.Text = objModel.Location;
        //        }
        //    }
        //    catch (Exception ex)
        //    {

        //        ErrorMessageRepairMan.Text = "Erro ao listar : " + ex.Message;
        //    }
        //}
        protected void btnSalvar_Click(object sender, EventArgs e)
        {
            var objModel = new SeacherRepair();

            objModel.EntradaId    = Convert.ToInt32(lblEntrada.Text);
            objModel.RepairMainId = Convert.ToInt32(lblCodigo.Text);
            objModel.ActionRepair = Convert.ToString(ddlAction.SelectedItem.Text);
            objModel.UserName     = Convert.ToString(ddlSendRepair.SelectedValue);
            var updateAction = new ListaDePlacaParaReparoOQC();

            updateAction.UpdateRepairManAction(objModel);
            updateAction.UpdateTecnicoAfterActionRepairMan(objModel);
            updateAction.UpdateStatusFinalAfterActionRepairMan(objModel);
            ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Registro feito com sucesso!');", true);
            ListaPlacaParaReparo();
        }
Exemplo n.º 3
0
 protected void ddlLocation_TextChanged(object sender, EventArgs e)
 {
     if (ddlLocation.SelectedValue != "0")
     {
         string    part = ddlLocation.SelectedItem.Text;
         var       list = new ListaDePlacaParaReparoOQC();
         Pesquisas mod  = list.ListaBom(part);
         if (mod != null)
         {
             txtPartNumber.Text = mod.PartNumber;
         }
         else
         {
             ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Nenhum Part-Number encontrado');", true);
         }
     }
 }
Exemplo n.º 4
0
 protected void btnSalvar_Click(object sender, EventArgs e)
 {
     if (ddlSendRepair.SelectedItem.Text != "ALL")
     {
         var objModel = new SeacherRepair();
         objModel.EntradaId    = Convert.ToInt32(lblEntrada.Text);
         objModel.RepairMainId = Convert.ToInt32(lblCodigo.Text);
         objModel.ActionRepair = Convert.ToString(ddlAction.SelectedItem.Text);
         objModel.UserName     = Convert.ToString(ddlSendRepair.SelectedValue);
         var updateAction = new ListaDePlacaParaReparoOQC();
         updateAction.UpdateRepairManAction(objModel);
         updateAction.UpdateTecnicoAfterActionRepairMan(objModel);
         updateAction.UpdateStatusFinalAfterActionRepairMan(objModel);
         /*******/
         string UserLagado = HttpContext.Current.User.Identity.GetUserId();
         var    objMod     = new SeacherRepair();
         objMod.EntradaId = Convert.ToInt32(lblCodigo.Text);
         objMod.UserName  = UserLagado;
         updateAction.UpdateRepairMan(objMod);
         /*FIM*/
         ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Registro feito com sucesso!');", true);
         ListaPlacaParaReparo();
     }
     else if (ddlSendRepair.SelectedItem.Text == "ALL")
     {
         var objModel = new SeacherRepair();
         objModel.EntradaId    = Convert.ToInt32(lblEntrada.Text);
         objModel.RepairMainId = Convert.ToInt32(lblCodigo.Text);
         objModel.ActionRepair = Convert.ToString(ddlAction.SelectedItem.Text);
         objModel.UserName     = Convert.ToString(ddlSendRepair.SelectedValue);
         var updateAction = new ListaDePlacaParaReparoOQC();
         updateAction.UpdateRepairManAction(objModel);
         updateAction.UpdateTecnicoAfterActionRepairManNULL(objModel);
         updateAction.UpdateStatusFinalAfterActionRepairMan(objModel);
         /*******/
         string UserLagado = HttpContext.Current.User.Identity.GetUserId();
         var    objMod     = new SeacherRepair();
         objMod.EntradaId = Convert.ToInt32(lblCodigo.Text);
         objMod.UserName  = UserLagado;
         updateAction.UpdateRepairMan(objMod);
         /*FIM*/
         ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Registro feito com sucesso!');", true);
         ListaPlacaParaReparo();
     }
 }
Exemplo n.º 5
0
 /// <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;
     }
 }
Exemplo n.º 6
0
 /// <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);
     }
 }
Exemplo n.º 7
0
        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();
        }
Exemplo n.º 8
0
        /// <summary>
        /// BOTÃO PARA O EVENDO DOS METODOS UPDATE REPARO, INSERT ANALYSIS REPAIMAN E LISTA PLACAS
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnSalvar_Click(object sender, EventArgs e)
        {
            if (lblStatusFinally.Text == "")
            {
                if (txtLote.Text == "" && txtUn.Text == "")
                {
                    ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Campos UN e Lote não pode ser vazio! Caso não exista preencha com N/A');", true);
                }
                else
                {
                    UpdateReparo();
                }
            }



            if (ddlSendRepair.SelectedItem.Text != "SELECIONE A REPARADORA" && lblStatusFinally.Text == "")
            {
                InsertAnalysisRepairMan();
            }
            if (lblStatusFinally.Text == "WAITING" && ddlStatus.SelectedItem.Text == "PASS")
            {
                var    mod         = new SeacherRepair();
                string statusFinal = "TERMINATE";
                mod.EntradaId    = Convert.ToInt32(lblCodigo.Text);
                mod.StatusRepair = ddlStatus.SelectedItem.Text;
                mod.StatusFinal  = statusFinal;
                var add = new ListaDePlacaParaReparoOQC();
                add.UpdateTerminate(mod);
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Reparo Finalizado com sucesso.');", true);
                ListaPlacaParaReparo();
            }
            if (lblStatusFinally.Text == "WAITING" && ddlStatus.SelectedItem.Text == "SCRAP")
            {
                string statusFinal = "SCRAP";
                var    mod         = new SeacherRepair();
                mod.EntradaId    = Convert.ToInt32(lblCodigo.Text);
                mod.StatusRepair = ddlStatus.SelectedItem.Text;
                mod.StatusFinal  = statusFinal;
                var add = new ListaDePlacaParaReparoOQC();
                add.UpdateTerminate(mod);
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Item enviado para Scrap.');", true);
                ListaPlacaParaReparo();
            }

            if (lblStatusFinally.Text == "WAITING" && ddlStatus.SelectedItem.Text == "FEEDBACK")
            {
                string statusFinal = "FEEDBACK";
                var    mod         = new SeacherRepair();
                mod.EntradaId    = Convert.ToInt32(lblCodigo.Text);
                mod.StatusRepair = ddlStatus.SelectedItem.Text;
                mod.StatusFinal  = statusFinal;
                var add = new ListaDePlacaParaReparoOQC();
                add.UpdateTerminate(mod);
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Item enviado para Feedack.');", true);
                ListaPlacaParaReparo();
            }
            if (ddlStatus.SelectedValue == "4" && lblStatusFinally.Text == "WAITING")
            {
                string statusFinal = "";
                var    mod         = new SeacherRepair();
                mod.EntradaId    = Convert.ToInt32(lblCodigo.Text);
                mod.StatusRepair = ddlStatus.SelectedItem.Text;
                mod.StatusFinal  = statusFinal;
                var add = new ListaDePlacaParaReparoOQC();
                add.UpdateReturnRepair(mod);
                InsertAnalysisRepairMan();
                ScriptManager.RegisterStartupScript(this, GetType(), "showalert", "alert('Reparo retornado com sucesso!');", true);
                ListaPlacaParaReparo();
            }
            ListaPlacaParaReparo();
        }