protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                cliente = new ServiceReference1.Service1SoapClient();
                //listaProducto = cliente.ConsultaStock().Cast<Producto>().ToList();
                var lista = cliente.ConsultaStock();

                string sProveedor = string.Empty;
                string sProducto = string.Empty;

                for (int y = 0; y < lista.Length;y++ )
                {
                    var div = ProductoLit(lista[y]);
                    sProveedor = string.Empty;
                    for (int i = 0; i < lista[y].ListaProveedor.Length;i++ )
                    {
                        sProveedor = sProveedor + ProveedorLit(lista[y].ListaProveedor[i]);
                    }

                    sProducto = sProducto + div + sProveedor + "</ul></div>";
                }

                LitContent.Text = sProducto;
            }
            catch (Exception ex)
            {
                LitContent.Text = "<p>Hubo un error interno: "+ex.Message+"</p>";
            }
        }
Exemple #2
0
        private void barEditItem3_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            if (this.barEditItem3.EditValue.ToString() == "False")
            {
                if (MessageBox.Show("確認連接遠程?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
                {
                    return;
                }



                s = new ServiceReference1.Service1SoapClient();


                this.bindingSourceDepot.DataSource    = s.Query("select DepotId,DepotName from Depot order by Id", 30, "depot").Tables[0];
                this.bindingSourceCategory.DataSource = s.Query("select ProductCategoryId,ProductCategoryName,Id from ProductCategory order by Id", 30, "ProductCategory").Tables[0];
                this.barEditItem3.EditValue           = true;
                return;
            }
            else
            {
                if (MessageBox.Show("確認取消遠程連接?", this.Text, MessageBoxButtons.OKCancel, MessageBoxIcon.Question) != DialogResult.OK)
                {
                    return;
                }
                this.bindingSourceDepot.DataSource    = this.depotManager.Query("select DepotId,DepotName from Depot order by Id", 30, "depot").Tables[0];
                this.bindingSourceCategory.DataSource = this.depotManager.Query("select ProductCategoryId,ProductCategoryName,Id from ProductCategory order by Id", 30, "ProductCategory").Tables[0];
                this.barEditItem3.EditValue           = false;
            }
        }
Exemple #3
0
 private void btnSum_Click(object sender, EventArgs e)
 {
     int x, y, sum = 0;
     x = int.Parse(txtValue1.Text);
     y = int.Parse(txtValue2.Text);
     ServiceReference1.Service1SoapClient ws = new ServiceReference1.Service1SoapClient();
     sum = ws.Add(x, y);
     MessageBox.Show("Sum is = " + sum.ToString());
 }
        public ServiceCommandClient()
        {
            sendQueue = new ArrayList();
            receiveQueue = new ArrayList();

            webService = new ServiceReference1.Service1SoapClient();
            webService.ClientCredentials.UserName.UserName = "******";
            webService.ClientCredentials.UserName.Password = "******";
        }
 public ActionResult Edit(Ado_Net.ServiceReference1.Car car)
 {
     try
     {
         ServiceReference1.Service1SoapClient ws = new ServiceReference1.Service1SoapClient();
         ws.Edit(car);
         return RedirectToAction("Index");
     }
     catch (Exception e)
     {
         TempData["Error"] = e.Message.ToString();
         return RedirectToAction("Edit");
     }
 }
 public ActionResult Edit(int? id)
 {
     if (id == null)
     {
         return View("~/Views/Shared/Error.cshtml");
     }
     ServiceReference1.Service1SoapClient ws = new ServiceReference1.Service1SoapClient();
     Ado_Net.ServiceReference1.Car car = ws.Find(id);
     if (car == null)
     {
         return View("~/Views/Shared/Error.cshtml");
     }
     return View(car);
 }
Exemple #7
0
 public ActionResult Delete(int?id)
 {
     if (id == null)
     {
         return(View("~/Views/Shared/Error.cshtml"));
     }
     ServiceReference1.Service1SoapClient ws  = new ServiceReference1.Service1SoapClient();
     Ado_Net.ServiceReference1.Car        car = ws.Find(id);
     if (car == null)
     {
         return(View("~/Views/Shared/Error.cshtml"));
     }
     return(View(car));
 }
Exemple #8
0
 public ActionResult Edit(Ado_Net.ServiceReference1.Car car)
 {
     try
     {
         ServiceReference1.Service1SoapClient ws = new ServiceReference1.Service1SoapClient();
         ws.Edit(car);
         return(RedirectToAction("Index"));
     }
     catch (Exception e)
     {
         TempData["Error"] = e.Message.ToString();
         return(RedirectToAction("Edit"));
     }
 }
Exemple #9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack) //if this isn't a postback
            {
                //This code will be executed the first time a page loads

                //This code is accessing a property on the master page
                //the property will set the text given to it into an asp:literal
                //see master page for more detail, or step through code
                this.Master.Title = "Sample of what can be done with asp.net";

                //here, we will instantiate our soapclient object
                //this will only be done once, then the instance will be stored in the session
                myWebServObject = new ServiceReference1.Service1SoapClient();
            }
            else //is a postback
            {
                //this code will be executed on every page load BUT the first
            }
        }
 public ActionResult DeleteConfirmed(int id)
 {
     ServiceReference1.Service1SoapClient ws = new ServiceReference1.Service1SoapClient();
     ws.Delete(id);
     return RedirectToAction("Index");
 }
 public ActionResult Index()
 {
     ServiceReference1.Service1SoapClient ws = new ServiceReference1.Service1SoapClient();
     return View(ws.List());
 }
Exemple #12
0
 public ActionResult DeleteConfirmed(int id)
 {
     ServiceReference1.Service1SoapClient ws = new ServiceReference1.Service1SoapClient();
     ws.Delete(id);
     return(RedirectToAction("Index"));
 }
Exemple #13
0
 public ActionResult Index()
 {
     ServiceReference1.Service1SoapClient ws = new ServiceReference1.Service1SoapClient();
     return(View(ws.List()));
 }
        // 构造函数
        public MainPage()
        {
            InitializeComponent();
            //url = "{\"url\":\"DROPDOWN/DROPDOWN_1\"}";

            //url = "{\"url\":\"BL/BL_1\"}";
            url = "{\"url\":\"LYW/LYW_1\"}";
            System.Diagnostics.Debug.WriteLine(url);
            //加密
            url = Encryption_Base64.Base64Code(url);
            // 实例化客户端代理类
            ServiceReference1.Service1SoapClient MyClient = new ServiceReference1.Service1SoapClient();
            // 绑定回调事件
            MyClient.IOS_VSFileReadByIDCompleted += (s, arg) =>
                {
                    textstate.Text = "请求完成";
                    if (arg.Error != null)
                    {
                        System.Diagnostics.Debug.WriteLine(arg.Error);
                        return;
                    }
                    if (arg.Result != null)
                    {
                        System.Diagnostics.Debug.WriteLine("**********Result**********");
                        //解密返回json
                        stringJson = Decryption_Base64.Base64Decode(arg.Result);
                        // json 格式化
                       stringJson=FormatJson(stringJson);
                       System.Diagnostics.Debug.WriteLine(stringJson);
                        //解析
                        NodeInfo nodeInfo = JsonParser.Deserialize<NodeInfo>(stringJson);
                        System.Diagnostics.Debug.WriteLine(nodeInfo.message);
                        //获取所有控件类型
                        List<string> ctltype=new List<string>();
                        if (nodeInfo.data.ControlCount == 1) {
                            int indexstart = stringJson.IndexOf("ControlType" );
                            int indexend = stringJson.IndexOf("ControlCount" );
                            string ss = stringJson.Substring(indexstart - 2, indexend - indexstart - 1);
                            ctltype.Add(ss);
                        }else
                        {
                            int tempstart = 0;
                            for (int i = 0; i < nodeInfo.data.ControlCount; i++)
                            {
                                if (i == nodeInfo.data.ControlCount-1)
                                {
                                    int start = stringJson.IndexOf("ControlType", 1 + tempstart);
                                    int end = stringJson.IndexOf("ControlCount");
                                    string sl = stringJson.Substring(start - 2, end - start - 1);
                                    ctltype.Add(sl);
                                    break;
                                }
                                else
                                {
                                    int indexstart = stringJson.IndexOf("ControlType", 1 + tempstart);
                                    int indexend = stringJson.IndexOf("ControlType", 1 + indexstart);
                                    tempstart = indexstart;
                                    string ss = stringJson.Substring(indexstart - 2, indexend - indexstart - 1);
                                    ctltype.Add(ss);
                                }
                            }
                        }

                        //本地生成控件
                        for (int i = 0; i < nodeInfo.data.ControlCount; i++)
                        {
                            switch (nodeInfo.data.ControlList[i].ControlType)
                            {
                                case "DropDownList":
                                    Node_Dropdownlist nodedropdown = JsonParser.Deserialize<Node_Dropdownlist>(ctltype.ElementAt(i));
                                    ListPicker dropdownlist = new ListPicker();
                                    DropDownListView dropdownlistview = new DropDownListView( dropdownlist, nodedropdown);
                                    dropdownlist=dropdownlistview.Dropdownlistconfig();
                                    //添加到界面
                                    this.panel.Children.Add(dropdownlist);
                                    //生成下拉菜单控件
                                    System.Diagnostics.Debug.WriteLine(nodedropdown.ControlType);
                                    break;
                                case "BasicChart":
                                    Node_BasicChart nodebasicchart = JsonParser.Deserialize<Node_BasicChart>(ctltype.ElementAt(i));
                                    Position basicchart_p = new Position(nodeInfo, i);
                                    BasicChartGeneric bcview = new BasicChartGeneric(basicchart_p);
                                    switch (nodebasicchart.SeriesData[0].type)
                                    {
                                        case "column":
                                            this.NavigationService.Navigate(new Uri("/View/Columnview.xaml", UriKind.Relative));
                                            break;
                                        case "area":
                                            break;
                                        case "line":
                                            this.NavigationService.Navigate(new Uri("/View/ColumnChart.xaml", UriKind.Relative));
                                            break;
                                        case "bar":
                                            break;
                                        case "pie":
                                            break;
                                    }
                                    System.Diagnostics.Debug.WriteLine(nodebasicchart.ControlID);

                                    break;
                                case "DataGrid":
                                    Node_DataGrid nodedatagrid = JsonParser.Deserialize<Node_DataGrid>(ctltype.ElementAt(i));
                                    System.Diagnostics.Debug.WriteLine(nodedatagrid.ControlID);
                                    break;
                                case "Label":
                                    Node_Label nodelabel = JsonParser.Deserialize<Node_Label>(ctltype.ElementAt(i));
                                    TextBlock label = new TextBlock();
                                    LabelView labelview = new LabelView(label, nodelabel);
                                    label = labelview.Labelconfig();
                                    this.panel.Children.Add(label);
                                    System.Diagnostics.Debug.WriteLine(nodeInfo.data.ControlList[i].ControlType);
                                    break;
                            }
                        }

                    }
                };
            //调用异步方法
            textstate.Text = "正在请求,请等候……";
            MyClient.IOS_VSFileReadByIDAsync(url);
        }
Exemple #15
0
 static void Main(string[] args)
 {
     ServiceReference1.Service1SoapClient client = new ServiceReference1.Service1SoapClient();
     Console.WriteLine(client.HelloWorld());
 }
Exemple #16
0
        private void button1_Click(object sender, EventArgs e)
        {
            ServiceReference1.Service1SoapClient service = new ServiceReference1.Service1SoapClient();

            MessageBox.Show(service.HelloWorld());
        }