Пример #1
0
        public ActionResult VerCurso()
        {
            ServiceReference1.WebService1SoapClient consumo = new ServiceReference1.WebService1SoapClient();
            var tabla = consumo.MostrarCurso().ToList();

            return(View(tabla));
        }
Пример #2
0
        protected void btConfirmar_Click(object sender, EventArgs e)
        {
            int  opcao  = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            int  filial = Convert.ToInt32(DropDownList2.SelectedItem.Value);
            long numped = string.IsNullOrEmpty(TextBoxNumero.Text) ? 0 : Convert.ToInt64(TextBoxNumero.Text);

            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();

            long numero    = string.IsNullOrEmpty(TextBoxNumero.Text) ? 0 : Convert.ToInt64(TextBoxNumero.Text);
            int  condVenda = nn.ValidaEnvioPedidoPainel(opcao, numero, filial).CondVenda;

            if (opcao == 2 && filial != 0 && numped < 999998 && condVenda == 8)
            {
                nn.EnviaPedidoParaPainel(opcao, numped, filial);
                String mensagem = "Pedido da NFC-e de N. " + numped + " enviado pra o painel!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
                TextBoxNumero.Text = "";
            }
            else if (opcao == 3 && filial != 0 && numped > 99999 && (condVenda == 8 || condVenda == 1))
            {
                nn.EnviaPedidoParaPainel(opcao, numped, filial);
                String mensagem = "Pedido " + numped + " enviado pra o painel!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
                TextBoxNumero.Text = "";
            }
            else
            {
                String mensagem = "Não foi possível enviar o pedido favor verificar as informações ou Verifique com a TI!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
            }
        }
Пример #3
0
        public ActionResult Eliminar(Paquete pac)
        {
            ServiceReference1.WebService1SoapClient cliente = new ServiceReference1.WebService1SoapClient();
            var paquetes = cliente.EliminarPaqueteAsync(pac.id);

            return(View());
        }
        protected void btConfirmar_Click(object sender, EventArgs e)
        {
            int     codigo      = string.IsNullOrEmpty(TextBoxCodigo.Text) ? 0 : Convert.ToInt32(TextBoxCodigo.Text);
            long    numped      = string.IsNullOrEmpty(TextBoxPedido.Text) ? 0 : Convert.ToInt64(TextBoxPedido.Text);
            int     matricula   = Convert.ToInt32(Request.QueryString["mat"]);
            decimal qt_separada = string.IsNullOrEmpty(TextBoxConferida.Text) ? 0 : Convert.ToDecimal(TextBoxConferida.Text);

            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();

            decimal quantidadeSep = (qt_separada + nn.SepararProduto(numped, codigo).QtSep);
            decimal qtOrigem      = Convert.ToDecimal(nn.SepararProduto(numped, codigo).Qt);
            int     numSeq        = Convert.ToInt32(nn.SepararProduto(numped, codigo).Seq);

            if (matricula != 0 && numped != 0 && codigo != 0 && qt_separada != 0 && (quantidadeSep <= qtOrigem))
            {
                nn.ConfirmaConferencia(qt_separada, matricula, numped, codigo, numSeq);
                nn.FinalizaConferenciaItem(numped, codigo, numSeq);
                HabilitarDigitação();
                this.AtualizarGrid();
                int qt_Itens_org  = nn.ValidaConferenciaCompleta(numped).QT_Itens_Org;
                int qt_Itens_conf = nn.ValidaConferenciaCompleta(numped).QT_Itens_Conf;
                int qtlinhas      = TotalDeLinhasConferencia(numped);

                if (qtlinhas == 0)
                {
                    InformaDataFimConferencia(qt_Itens_org, qt_Itens_conf);
                }
            }
            else
            {
                String mensagem = "Verifique a quantidade conferida: " + qt_separada;
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
                HabilitarDigitação();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
     this.GridView2.DataSource = nn.ListaPedidosParaConferencia();
     this.GridView2.DataBind();
     DesabilitarBotoes();
 }
Пример #6
0
        protected void btExcluir_Click(object sender, EventArgs e)
        {
            int  opcao  = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            int  filial = Convert.ToInt32(DropDownList2.SelectedItem.Value);
            long numped = string.IsNullOrEmpty(TextBoxNumero.Text) ? 0 : Convert.ToInt64(TextBoxNumero.Text);

            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
            if (opcao == 2 && filial != 0 && numped < 999998)
            {
                nn.ExcluirPedidoDoPainel(opcao, numped, filial);
                String mensagem = "Pedido da NFC-e de N. " + numped + " excluido do painel!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
                TextBoxNumero.Text = "";
            }
            else if (opcao == 3 && filial != 0 && numped > 99999)
            {
                nn.ExcluirPedidoDoPainel(opcao, numped, filial);
                String mensagem = "Pedido " + numped + " excluido do painel!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
                TextBoxNumero.Text = "";
            }
            else
            {
                String mensagem = "Não foi possível excluido do painel verificar as informações!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
            }
        }
        protected void btPesquisar_Click(object sender, EventArgs e)
        {
            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
            int  matricula = string.IsNullOrEmpty(TextBoxCodConferente.Text) ? 0 : Convert.ToInt32(TextBoxCodConferente.Text);
            long numero    = string.IsNullOrEmpty(TextBoxNumero.Text) ? 0 : Convert.ToInt32(TextBoxNumero.Text);
            int  opcao     = Convert.ToInt32(DropDownList1.SelectedItem.Value);
            int  qtlinhas  = TotalDeLinhasConferencia(numero, opcao);

            if (matricula != 0 && opcao == 2 && qtlinhas > 0) //cupom
            {
                lbConferente.Text = nn.ConfirmaMatricula(matricula).Nome;
                HabilitarBotoes();
                lbPedido.Text = "Localizado com sucesso!";
            }
            else if (matricula != 0 && opcao == 3 && qtlinhas > 0)//pedido
            {
                lbConferente.Text = nn.ConfirmaMatricula(matricula).Nome;
                HabilitarBotoes();
                lbPedido.Text = "Localizado com sucesso!";
            }
            else if (matricula != 0 && opcao == 4 && qtlinhas > 0) // carga
            {
                lbConferente.Text = nn.ConfirmaMatricula(matricula).Nome;
                HabilitarBotoes();
                lbPedido.Text = "Localizado com sucesso!";
            }
            else
            {
                lbPedido.Visible = true;
                lbPedido.Text    = "Número não foi localizado!";
            }
        }
Пример #8
0
 public MainPage()
 {
     InitializeComponent();
     myService = new ServiceReference1.WebService1SoapClient();
     myService.ExecuteScalarCompleted   += myService_ExecuteScalarCompleted;
     myService.ExecuteNonQueryCompleted += myService_ExecuteNonQueryCompleted;
 }
Пример #9
0
        public ActionResult Modificar(Paquete pac)
        {
            ServiceReference1.WebService1SoapClient cliente = new ServiceReference1.WebService1SoapClient();
            var paquetes = cliente.ModificarPaqueteAsync(pac.id, pac.destinatario, pac.remitente, pac.tipo, pac.cantidad, pac.estado);

            return(View());
        }
 public ActionResult GetAccessService()
 {
     ServiceReference1.WebService1SoapClient obj = new ServiceReference1.WebService1SoapClient();
     ViewBag.info = obj.Add(12, 25);
     ServiceReference2.Service1Client obj1 = new ServiceReference2.Service1Client();
     ViewBag.info1 = obj1.mull(3, 5);
     return(View());
 }
Пример #11
0
        public ActionResult Tru(float a, float b)
        {
            var client = new ServiceReference1.WebService1SoapClient();
            var ketqua = client.Tru(a, b);

            ViewBag.ketqua = Convert.ToString(ketqua);
            return(View("Index"));
        }
Пример #12
0
        public ActionResult Tru(string a, string b)
        {
            var    client = new ServiceReference1.WebService1SoapClient();
            string ketqua = Convert.ToString(client.Tru(float.Parse(a), float.Parse(b)));

            ViewBag.ketqua = ketqua;
            return(View("Index"));
        }
Пример #13
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
     this.GridView1.DataSource = nn.ListaPedidosdoAlmoxarifado();
     this.GridView1.DataBind();
     LbPedido.Visible   = false;
     LbCodigo.Visible   = false;
     LbDescicao.Visible = false;
 }
 protected void HabilitarBotaoPesquisar(long numped)
 {
     ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
     this.GridView1.DataSource = nn.ListaItensParaConferencia(numped);
     this.GridView1.DataBind();
     this.GridView2.DataSource = nn.ListaItensFinalizados(numped);
     this.GridView2.DataBind();
     this.GridView3.DataSource = nn.ListaDetalhesDoPedido(numped);
     this.GridView3.DataBind();
     HabilitarDigitação();
 }
        protected void AtualizarGrid()
        {
            long numped = string.IsNullOrEmpty(TextBoxPedido.Text) ? 0 : Convert.ToInt64(TextBoxPedido.Text);

            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
            GridView1.DataSource = nn.ListaItensParaConferencia(numped);
            GridView1.DataBind();
            GridView2.DataSource = nn.ListaItensFinalizados(numped);
            GridView2.DataBind();
            LimparCampos();
        }
Пример #16
0
        protected void btnReUpdate_Click(object sender, EventArgs e)
        {
            ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient();
            Business.ScsBO sbo = new Business.ScsBO();


            List <Student> stFAP = new List <Student>();

            ServiceReference2.SAPISoapClient fap = new ServiceReference2.SAPISoapClient();
            string stf = fap.GetStudenK10JS();

            stFAP = JsonConvert.DeserializeObject <List <Student> >(stf);
            List <StaffTakeCare> listfromDB       = sbo.showListTable();
            List <String>        listStudentIdDub = new List <String>();


            Business.RankDAL    rdal = new Business.RankDAL();
            Business.StudentDAL stdl = new Business.StudentDAL();
            //Entity.Rank r = null;
            var tasks = new Task[stFAP.Count];

            for (int i = 0; i < stFAP.Count; i++)
            {
                string rollNumber = stFAP[i].rollNumber;
                tasks[i] = Task.Factory.StartNew(() =>
                {
                    List <StudentProfile> stp = new List <StudentProfile>();
                    string inf = fap.GetStudentById(rollNumber);
                    stp        = JsonConvert.DeserializeObject <List <StudentProfile> >(inf);
                    bool flag  = false;

                    for (int j = 0; j < listfromDB.Count; j++)
                    {
                        if (rollNumber.ToString().Equals(listfromDB[j].studentID.ToString()))
                        {
                            flag = true;
                            break;
                        }
                    }
                    if (!flag)
                    {
                        stdl.insertStudentToTakeCare(rollNumber.ToString(), stp[0].fullName);
                    }
                });
            }
            Task.WaitAll(tasks);
            rdal.rankking();
            stdl.filterStudent();
            string check = "";

            Response.Redirect("~/UI/distribution.aspx?check=" + check);
        }
Пример #17
0
        public List <BehaviorTerm> beList(string studentID)
        {
            List <BehaviorTerm> beList = new List <BehaviorTerm>();
            string currentSemester     = "Spring2018";

            ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient();
            double behavior  = ws.getBehaviorMark(studentID, currentSemester).behaviorMark;
            double behavior2 = ws.getBehaviorMark(studentID, previousTerm(currentSemester)).behaviorMark;

            beList.Add(new BehaviorTerm(behavior2, previousTerm(currentSemester)));
            beList.Add(new BehaviorTerm(behavior, currentSemester));
            return(beList);
        }
Пример #18
0
        private void button1_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                ServiceReference1.WebService1SoapClient service = new ServiceReference1.WebService1SoapClient();

                service.GetLocationsCompleted +=
                    new EventHandler<ServiceReference1.GetLocationsCompletedEventArgs>(service_GetDateCompleted);

                service.GetLocationsAsync();
            }
            catch (Exception ex) {MessageBox.Show(ex.Message);}
        }
        protected void btFinalizarConf_Click(object sender, EventArgs e)
        {
            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
            int  matricula = Convert.ToInt32(Request.QueryString["mat"]);
            long numped    = string.IsNullOrEmpty(TextBoxPedido.Text) ? 0 : Convert.ToInt64(TextBoxPedido.Text);

            nn.FinalizaConferencia(numped, matricula);
            LimparCampos();
            DesabilitarDigitação();
            TextBoxPedido.Visible = true;
            TextBoxPedido.Enabled = true;
            TextBoxPedido.Text    = "";
            btPesquisar.Visible   = true;
        }
        protected void btPesquisar_Click(object sender, EventArgs e)
        {
            int  codConferente = Convert.ToInt32(Request.QueryString["mat"]);
            long numped        = string.IsNullOrEmpty(TextBoxPedido.Text) ? 0 : Convert.ToInt64(TextBoxPedido.Text);

            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
            int matricula     = nn.IniciaConferencia(numped).Maticula;
            int qt_Itens_org  = nn.ValidaConferenciaCompleta(numped).QT_Itens_Org;
            int qt_Itens_conf = nn.ValidaConferenciaCompleta(numped).QT_Itens_Conf;

            int condVenda = Convert.ToInt32(nn.IniciaConferencia(numped).CondVenda);
            int OrdemConf = Convert.ToInt32(nn.IniciaConferencia(numped).OrdemConf);
            int numCupom  = Convert.ToInt32(nn.IniciaConferencia(numped).NumCupom);

            string posicao = nn.IniciaConferencia(numped).Posicao;

            if ((posicao == "F" && numCupom > 0 && OrdemConf == 6 && condVenda != 7) || (posicao != "F" && numCupom == 0 && OrdemConf == 6 && condVenda != 7))
            {
                if (matricula == 0 && ((qt_Itens_org) > qt_Itens_conf))
                {
                    nn.AtribuirPedidoParaCaonferente(codConferente, numped);
                    HabilitarBotaoPesquisar(numped);
                }
                else if (matricula == codConferente && ((qt_Itens_org) > qt_Itens_conf))
                {
                    HabilitarBotaoPesquisar(numped);
                }
                else if (numped == 0)
                {
                    String mensagem1 = "Pedido já finalizado ou invalido :" + numped;
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem1 + "');", true);
                }
                else
                {
                    String mensagem = "Conferência Já Iniciada ou Finalizada: " + matricula;
                    ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
                }
            }
            else
            {
                String mensagem3 = "Pedido já faturado ou não liberado pra conferência!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem3 + "');", true);
            }
        }
Пример #21
0
        static void Main(string[] args)
        {
            ServiceReference1.WebService1SoapClient myClient = new ServiceReference1.WebService1SoapClient();
            string str = myClient.HelloWorld();
            Console.WriteLine(str);

            int a, b;
            a = 100;
            b = 200;
            Console.WriteLine("a:{0},b:{1}", a, b);
            myClient.Swap(ref a, ref b);
            Console.WriteLine("a:{0},b:{1}", a, b);
            /////////////////////////////////////////////////////////////////
            Console.WriteLine("==============DataTable===================");
            DataTable dt = myClient.GetDataTable();
            foreach (DataRow item in dt.Rows)
            {
                Console.WriteLine(item[1]);
            }
            /////////////////////////////////////////////////////////////////
            Console.WriteLine("==============GetListMyClass===================");
            ServiceReference1.MyClass[]  list = myClient.GetListMyClass();
            foreach (var item in list)
            {
                Console.WriteLine(item.姓名);
            }
            /////////////////////////////////////////////////////////////////
            Console.WriteLine("==============List===================");
            string[] list2 = myClient.GetList();
            foreach (var item in list2)
            {
                Console.WriteLine(item);
            }
            /////////////////////////////////////////////////////////////////
            Console.WriteLine("==============深圳天气===================");
            WeatherWebService.WeatherWebServiceSoapClient weather = new WeatherWebService.WeatherWebServiceSoapClient("WeatherWebServiceSoap12");
            string[] 深圳天气 = weather.getWeatherbyCityName("深圳");

            foreach (var item in 深圳天气)
            {
                Console.WriteLine(item);
            }
        }
        protected void btConfirmar_Click(object sender, EventArgs e)
        {
            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
            int  matricula = string.IsNullOrEmpty(TextBoxCodConferente.Text) ? 0 : Convert.ToInt32(TextBoxCodConferente.Text);
            long numero    = string.IsNullOrEmpty(TextBoxNumero.Text) ? 0 : Convert.ToInt32(TextBoxNumero.Text);
            int  opcao     = Convert.ToInt32(DropDownList1.SelectedItem.Value);

            if (matricula != 0 && opcao == 2) //cupom
            {
                nn.ConfirmaConferenciaAutomatica(numero, matricula, opcao);
                nn.FinalizarConferenciaAutomatica(numero, opcao);
                this.GridView2.DataSource = nn.ListaPedidosParaConferencia();
                this.GridView2.DataBind();
                String mensagem1 = "Iniciado e Finalizado conferencia! de N° " + numero;
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem1 + "');", true);
                LimparCampos();
            }
            else if (matricula != 0 && opcao == 3)//pedido
            {
                nn.ConfirmaConferenciaAutomatica(numero, matricula, opcao);
                nn.FinalizarConferenciaAutomatica(numero, opcao);
                this.GridView2.DataSource = nn.ListaPedidosParaConferencia();
                this.GridView2.DataBind();
                String mensagem1 = "Iniciado a conferencia! de N° " + numero;
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem1 + "');", true);
                LimparCampos();
            }
            else if (matricula != 0 && opcao == 4) // carga
            {
                nn.ConfirmaConferenciaAutomatica(numero, matricula, opcao);
                nn.FinalizarConferenciaAutomatica(numero, opcao);
                this.GridView2.DataSource = nn.ListaPedidosParaConferencia();
                this.GridView2.DataBind();
                String mensagem1 = "Iniciado a conferencia! de N° " + numero;
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem1 + "');", true);
                LimparCampos();
            }
        }
Пример #23
0
        protected void btEntrar_Click(object sender, EventArgs e)
        {
            int    matricula = string.IsNullOrEmpty(TextBoxMatricula.Text) ? 0 : Convert.ToInt32(TextBoxMatricula.Text);
            string usuario   = TextBoxUsuario.Text;

            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
            nn.ConfirmaAcesso(usuario, matricula);
            string name = "";
            int    mat  = 0;

            name = nn.ConfirmaAcesso(usuario, matricula).Nome;
            mat  = nn.ConfirmaAcesso(usuario, matricula).Matricula;

            if (name != null && mat != 0)
            {
                Response.Redirect("AppConferencia.aspx?mat=" + mat + "&name=" + name);
            }
            else
            {
                String mensagem = "Usuário ou senha incorreto!";
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
            }
        }
        protected void btProduto_Click(object sender, EventArgs e)
        {
            HabilitarDigitação();
            long pedido = string.IsNullOrEmpty(TextBoxPedido.Text) ? 0 : Convert.ToInt64(TextBoxPedido.Text);
            int  codigo = string.IsNullOrEmpty(TextBoxCodigo.Text) ? 0 : Convert.ToInt32(TextBoxCodigo.Text);

            ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
            string  descricao = nn.SepararProduto(pedido, codigo).Descricao;
            decimal qtPedida  = nn.SepararProduto(pedido, codigo).Qt;

            if (descricao == null || qtPedida == 0)
            {
                String mensagem = "Produto não consta na lista pra conferir: " + codigo;
                ClientScript.RegisterClientScriptBlock(this.GetType(), "MensagemDeAlert", "alert('" + mensagem + "');", true);
                TextBoxDescricao.Text = "";
                TextBoxQtPedida.Text  = "";
            }
            if (descricao != null && qtPedida != 0)
            {
                TextBoxDescricao.Text = descricao;
                TextBoxQtPedida.Text  = Convert.ToString(qtPedida);
            }
        }
Пример #25
0
        //continuação...selecionar linha na grid
        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {
            foreach (GridViewRow row in GridView1.Rows)
            {
                if (row.RowIndex == GridView1.SelectedIndex)
                {
                    row.BackColor = ColorTranslator.FromHtml("#A1DCF2");
                    row.ToolTip   = string.Empty;
                    String pedido        = row.Cells[0].Text;
                    String codigoProduto = row.Cells[5].Text;
                    String Descricao     = row.Cells[6].Text;

                    LbPedido.Text   = pedido;
                    LbCodigo.Text   = codigoProduto;
                    LbDescicao.Text = Descricao;

                    long numped  = Convert.ToInt64(pedido);
                    int  codprod = Convert.ToInt32(codigoProduto);
                    ConferenciaAlmoxarifado(numped, codprod);
                    ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
                    this.GridView1.DataSource = nn.ListaPedidosdoAlmoxarifado();
                    this.GridView1.DataBind();
                    LbPedido.Visible   = false;
                    LbCodigo.Visible   = false;
                    LbDescicao.Visible = false;
                }
                else
                {
                    row.BackColor = ColorTranslator.FromHtml("#FFFFFF");
                    row.ToolTip   = "Click to select this row.";
                }
            }
            LbPedido.Visible   = true;
            LbCodigo.Visible   = true;
            LbDescicao.Visible = true;
        }
Пример #26
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     ServiceReference1.WebService1SoapClient proxy = new ServiceReference1.WebService1SoapClient();
     InvertedText = String.IsNullOrEmpty(proxy.InvertText(Text.Text)) ? "" : string.Format("Inverted text is \" {0} \" ", proxy.InvertText(Text.Text));
 }
Пример #27
0
 protected void Page_Load(object sender, EventArgs e)
 {
     ServiceReference1.WebService1SoapClient nn = new ServiceReference1.WebService1SoapClient();
     this.GridView1.DataSource = nn.ListaPedidosParaFaturar();
     this.GridView1.DataBind();
 }
Пример #28
0
 public ActionResult ConsultarPaquete()
 {
     ServiceReference1.WebService1SoapClient cliente = new ServiceReference1.WebService1SoapClient();
     cliente.ConsultarPaquete();
     return(View());
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     ServiceReference1.WebService1SoapClient web = new ServiceReference1.WebService1SoapClient();
     web.Method1(5);
     string x = web.Method2(5);
 }
Пример #30
0
        public Entity.Rank changeRankByCoefficient()
        {
            ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient();
            //FreedomeF.ServiceReference1.ListStudentID[] list = ws.getStudentID();
            ServiceReference2.SAPISoapClient fap = new ServiceReference2.SAPISoapClient();

            Entity.Rank   r   = null;
            SqlConnection con = DbConnect.GetConnection();

            con.Open();
            string        sql = "SELECT studentID FROM Student WHERE takecareStatus=0";
            SqlCommand    cmd = new SqlCommand(sql, con);
            RankDAL       rdl = new RankDAL();
            SqlDataReader dr  = cmd.ExecuteReader();

            while (dr.Read())
            {
                r           = new Entity.Rank();
                r.studentID = dr["studentID"].ToString();
                string currentSemester = "Spring2018";

                List <Curricurlum> listFail = new List <Curricurlum>();
                string             fail     = fap.getFailCourse(r.studentID);
                string             pass     = fap.getPassCourse(r.studentID);
                List <Curricurlum> listPass = new List <Curricurlum>();
                if (!pass.Equals("Data not found"))
                {
                    listPass = JsonConvert.DeserializeObject <List <Curricurlum> >(pass);
                }
                if (!fail.Equals("Data not found"))
                {
                    listFail = JsonConvert.DeserializeObject <List <Curricurlum> >(fail);
                }
                List <Gpa> gpaList = new List <Gpa>();
                string     t2      = fap.getGPA(r.studentID, currentSemester);

                if (!t2.Equals("Data not found"))
                {
                    gpaList = JsonConvert.DeserializeObject <List <Gpa> >(t2);
                }

                int    totalCredit = 0;
                double avg         = 0;

                for (int j = 0; j < gpaList.Count; j++)
                {
                    double temp = 0;
                    if (gpaList[j].averageMark != null)
                    {
                        temp = gpaList[j].credits * (double)gpaList[j].averageMark;
                    }
                    if (temp > 0)
                    {
                        totalCredit += gpaList[j].credits;
                        avg         += temp;
                    }
                }

                double gpa        = ((double)avg) / ((double)totalCredit);
                double failcourse = ((1 - ((double)listFail.Count) / ((double)listPass.Count + (double)listFail.Count))) * 10;

                double behavior = ws.getBehaviorMark(r.studentID, currentSemester).behaviorMark;

                List <Curricurlum> attenList = new List <Curricurlum>();

                string t = fap.getAttendanceMark(r.studentID, currentSemester);
                if (!t.Equals("Data not found"))
                {
                    attenList = JsonConvert.DeserializeObject <List <Curricurlum> >(t);
                }


                int totalAbsent = 0;
                for (int i = 0; i < attenList.Count; i++)
                {
                    totalAbsent += attenList[i].absentTotal;
                }


                double      atten = Math.Round(((double)(attenList.Count * 30) - totalAbsent) / ((double)attenList.Count * 30), 2) * 10;
                Entity.Rate rt    = new Entity.Rate();
                rt               = getRate();
                r.rank           = Caculate(gpa, behavior, failcourse, atten, rt.markRate, rt.behRate, rt.failCout, rt.attentRate);
                r                = new Entity.Rank();
                r.studymark      = gpa;
                r.failcourseNumb = failcourse;
                r.behaviorMark   = behavior;
                r.attendance     = atten;
                r.rank           = Caculate(gpa, behavior, failcourse, atten, rt.markRate, rt.behRate, rt.failCout, rt.attentRate);
                isUpdateRank2(r.studentID.ToString(), r.rank, currentSemester);
            }
            return(r);
        }
Пример #31
0
        public DataTable myStudentForHead()
        {
            DataTable dt = new DataTable();

            dt.Columns.Add("Mssv");
            dt.Columns.Add("Tên");
            dt.Columns.Add("GPA");
            dt.Columns.Add("Hành vi");
            dt.Columns.Add("Điểm danh");
            dt.Columns.Add("Môn nợ");
            dt.Columns.Add("Xếp loại");
            ServiceReference1.WebService1SoapClient ws  = new ServiceReference1.WebService1SoapClient();
            ServiceReference2.SAPISoapClient        fap = new ServiceReference2.SAPISoapClient();
            StaffTakeCare stc = null;
            RankDAL       rdl = new RankDAL();
            SqlConnection con = DbConnect.GetConnection();

            con.Open();
            string        sql = "SELECT TOP 10 Student.studentID,Student.studentName FROM Student LEFT JOIN Rank ON Student.studentID=Rank.studentID WHERE takecareStatus=0  AND caution=0 ORDER BY rankName DESC";
            SqlCommand    cmd = new SqlCommand(sql, con);
            SqlDataReader dr  = cmd.ExecuteReader();

            this.compareForHead = new List <Compare>();
            while (dr.Read())
            {
                Compare xx = null;
                stc             = new StaffTakeCare();
                stc.studentID   = dr["studentID"].ToString();
                stc.studentName = dr["studentName"].ToString();


                string currentSemester = "Spring2018";
                //FreedomeF.ServiceReference1.Failcourse[] flist = ws.getFailcourse(r.studentID, ws.getCurrentSemester(r.studentID));
                List <Curricurlum> listFail = new List <Curricurlum>();
                string             fail     = fap.getFailCourse(stc.studentID);
                string             pass     = fap.getPassCourse(stc.studentID);
                List <Curricurlum> listPass = new List <Curricurlum>();
                listPass = JsonConvert.DeserializeObject <List <Curricurlum> >(pass);
                listFail = JsonConvert.DeserializeObject <List <Curricurlum> >(fail);


                List <Gpa> gpaList = new List <Gpa>();
                string     t2      = fap.getGPA(stc.studentID, currentSemester);
                gpaList = JsonConvert.DeserializeObject <List <Gpa> >(t2);
                int    totalCredit = 0;
                double avg         = 0;

                for (int j = 0; j < gpaList.Count; j++)
                {
                    double temp = 0;
                    if (gpaList[j].averageMark != null)
                    {
                        temp = gpaList[j].credits * (double)gpaList[j].averageMark;
                    }
                    if (temp > 0)
                    {
                        totalCredit += gpaList[j].credits;
                        avg         += temp;
                    }
                }

                double gpa        = Math.Round(((double)avg) / ((double)totalCredit), 2);
                int    failcourse = listFail.Count;

                double behavior = ws.getBehaviorMark(stc.studentID, currentSemester).behaviorMark;

                List <Curricurlum> attenList = new List <Curricurlum>();
                string             t         = fap.getAttendanceMark(stc.studentID, currentSemester);
                attenList = JsonConvert.DeserializeObject <List <Curricurlum> >(t);

                int totalAbsent = 0;
                for (int i = 0; i < attenList.Count; i++)
                {
                    totalAbsent += attenList[i].absentTotal;
                }


                double atten = Math.Round(((double)(attenList.Count * 30) - totalAbsent) / ((double)attenList.Count * 30), 2) * 10;
                var    ds    = dt.NewRow();
                ds["Mssv"]      = stc.studentID;
                ds["Tên"]       = stc.studentName;
                ds["GPA"]       = gpa;
                ds["Hành vi"]   = behavior;
                ds["Điểm danh"] = atten;
                ds["Môn nợ"]    = failcourse;

                Rank rk = new Rank();


                rk             = rdl.loadRank(stc.studentID, currentSemester);
                ds["Xếp loại"] = rk.rank;
                //}
                dt.Rows.Add(ds);



                // compare previous semerter
                List <Gpa> gpaList2 = new List <Gpa>();
                string     getGpa2  = fap.getGPA(stc.studentID, previousTerm(currentSemester));
                gpaList2 = JsonConvert.DeserializeObject <List <Gpa> >(getGpa2);
                int    totalCredit2 = 0;
                double avg2         = 0;

                for (int k = 0; k < gpaList2.Count; k++)
                {
                    double temp2 = 0;
                    if (gpaList2[k].averageMark != null)
                    {
                        temp2 = gpaList2[k].credits * (double)gpaList2[k].averageMark;
                    }
                    if (temp2 > 0)
                    {
                        totalCredit2 += gpaList2[k].credits;
                        avg2         += temp2;
                    }
                }

                double gpa2      = ((double)avg2) / ((double)totalCredit2);
                double behavior2 = ws.getBehaviorMark(stc.studentID.ToString(), previousTerm(currentSemester)).behaviorMark;

                List <Curricurlum> attenList2 = new List <Curricurlum>();
                string             attent2    = fap.getAttendanceMark(stc.studentID, previousTerm(currentSemester));
                attenList2 = JsonConvert.DeserializeObject <List <Curricurlum> >(attent2);

                int totalAbsent2 = 0;
                for (int f = 0; f < attenList2.Count; f++)
                {
                    totalAbsent2 += attenList2[f].absentTotal;
                }

                double atten2 = (((double)(attenList2.Count * 30) - totalAbsent2) / ((double)attenList2.Count * 30)) * 10;
                xx             = new Compare();
                xx.gpa         = gpa;
                xx.gpa2        = gpa2;
                xx.behavior    = behavior;
                xx.behavior2   = behavior2;
                xx.atten       = atten;
                xx.atten2      = atten2;
                xx.failcourse  = failcourse;
                xx.failcourse2 = failcourse;
                this.compareForHead.Add(xx);
            }
            return(dt);
        }
Пример #32
0
        public void calRank(string studentID, Entity.Rate rt)
        {
            ServiceReference1.WebService1SoapClient ws  = new ServiceReference1.WebService1SoapClient();
            ServiceReference2.SAPISoapClient        fap = new ServiceReference2.SAPISoapClient();
            Entity.Rank r = new Entity.Rank();
            r.studentID = studentID;
            string             currentSemester = "Spring2018";
            string             fail            = fap.getFailCourse(r.studentID);
            string             pass            = fap.getPassCourse(r.studentID);
            List <Curricurlum> listPass        = new List <Curricurlum>();
            List <Curricurlum> listFail        = new List <Curricurlum>();

            if (!pass.Equals("Data not found"))
            {
                listPass = JsonConvert.DeserializeObject <List <Curricurlum> >(pass);
            }
            if (!fail.Equals("Data not found"))
            {
                listFail = JsonConvert.DeserializeObject <List <Curricurlum> >(fail);
            }
            List <Gpa> gpaList = new List <Gpa>();
            string     t2      = fap.getGPA(r.studentID, currentSemester);

            if (!t2.Equals("Data not found"))
            {
                gpaList = JsonConvert.DeserializeObject <List <Gpa> >(t2);
            }
            int    totalCredit = 0;
            double avg         = 0;

            for (int j = 0; j < gpaList.Count; j++)
            {
                double temp = 0;
                if (gpaList[j].averageMark != null)
                {
                    temp = gpaList[j].credits * (double)gpaList[j].averageMark;
                }
                if (temp > 0)
                {
                    totalCredit += gpaList[j].credits;
                    avg         += temp;
                }
            }
            double gpa = ((double)avg) / ((double)totalCredit);
            double failcourse;

            if (listFail.Count != 0 && listPass.Count != 0)
            {
                failcourse = ((1 - ((double)listFail.Count) / ((double)listPass.Count + (double)listFail.Count))) * 10;
            }
            failcourse = 0;
            double             behavior  = ws.getBehaviorMark(r.studentID, currentSemester).behaviorMark;
            List <Curricurlum> attenList = new List <Curricurlum>();
            string             t         = fap.getAttendanceMark(r.studentID, currentSemester);

            if (!t.Equals("Data not found"))
            {
                attenList = JsonConvert.DeserializeObject <List <Curricurlum> >(t);
            }
            int totalAbsent = 0;

            for (int i = 0; i < attenList.Count; i++)
            {
                totalAbsent += attenList[i].absentTotal;
            }
            double atten = Math.Round(((double)(attenList.Count * 30) - totalAbsent) / ((double)attenList.Count * 30), 2) * 10;

            r.rank = Caculate(gpa, behavior, failcourse, atten, rt.markRate, rt.behRate, rt.failCout, rt.attentRate);
            if (checkExistRank(r.studentID, currentSemester))
            {
                isInsertRank(r.studentID, r.rank, currentSemester);
            }
            else
            {
                isUpdateRank2(r.studentID, r.rank, currentSemester);
            }
        }