Esempio n. 1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = "";
            string Re   = "";
            string str  = "";

            Re += "数据传送方式:";
            if (Request.RequestType.ToUpper() == "POST")
            {
                str  = "";
                type = "POST";
                Re  += type + "<br/>参数分别是:<br/>";
                SortedList table = sParam();
                //Hashtable table = hParam();

                if (table != null)
                {
                    if (table.Count == 1)
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        int sn = 0;
                        try
                        {
                            foreach (DictionaryEntry De in table)
                            {
                                sn = Convert.ToInt32(De.Value);
                            }
                        }
                        catch
                        {
                            Re = "员工编号错误";
                        }
                        DataSet ds = BaseClass.Byte2DS(fsc.GetBySql("Select ID,SN,Name From Employee Where (SN=" + sn + ")"));
                    }
                    //foreach (DictionaryEntry De in table)
                    //{
                    //    Re += "参数名:" + De.Key + " 值:" + De.Value + "<br/>";
                    //}
                }
                else
                {
                    Re = "你没有传递任何参数过来!";
                }
            }
            else
            {
                str  = "";
                type = "GET";
                Re  += type + "<br/>参数分别是:<br/>";
                NameValueCollection nvc = GETInput();
                if (nvc.Count > 0)
                {
                    string sssss = nvc.GetKey(0).ToString();
                    int    sn    = 0;
                    try
                    {
                        sn = Convert.ToInt32(nvc.GetValues(0)[0]);
                    }
                    catch
                    {
                        Re = "输入错误";
                    }
                    if (sssss.ToLower() == "login")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        string usid = nvc.GetValues(0)[0].ToString();
                        string date = nvc.GetValues(1)[0].ToString();
                        Re = fsc.GetOne("Hownet.BLL.Users", "CheckUserByStrPW", new object[] { usid, date }).ToString();
                    }
                    else if (sssss.ToLower() == "gettasklist")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        string dddd = nvc.GetValues(0)[0].Replace('ж', '#');
                        Re = fsc.GetStringData("Hownet.BLL.ProductTaskMain", "GetTaskListByMaterielName", new object[] { dddd });
                    }
                    else if (sssss.ToLower() == "gettaskend")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        Re = fsc.GetStringData("Hownet.BLL.WorkTicketInfo", "GetStringWorkFishByTaskID", new object[] { sn });
                    }
                    else if (sssss.ToLower() == "empaddwork")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        string usid = nvc.GetValues(1)[0].ToString();
                        string date = nvc.GetValues(2)[0].ToString();
                        Re = fsc.EmpAddWork(sn.ToString(), usid, date);
                    }
                    else if (sssss.ToLower() == "ordering")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new ServiceReference1.FileTransportServiceClient();
                        Re = fsc.Ordering(sn.ToString());
                    }
                    else
                    {
                        Re = sssss;
                    }
                }
                else
                {
                    Re = "你没有传递任何参数过来!";
                }
            }
            if (Re.Trim().Length == 0)
            {
                Re = "asdfg";
            }
            Response.Write(Re);
        }
Esempio n. 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string type = "";
            string Re   = "";
            string str  = "";

            Re += "数据传送方式:";
            if (Request.RequestType.ToUpper() == "POST")
            {
                str  = "";
                type = "POST";
                Re  += type + "<br/>参数分别是:<br/>";
                SortedList table = sParam();
                //Hashtable table = hParam();

                if (table != null)
                {
                    if (table.Count == 1)
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        int sn = 0;
                        try
                        {
                            foreach (DictionaryEntry De in table)
                            {
                                sn = Convert.ToInt32(De.Value);
                            }
                        }
                        catch
                        {
                            Re = "员工编号错误";
                        }
                        DataSet ds = BaseClass.Byte2DS(fsc.GetBySql("Select ID,SN,Name From Employee Where (SN=" + sn + ")"));
                    }
                    //foreach (DictionaryEntry De in table)
                    //{
                    //    Re += "参数名:" + De.Key + " 值:" + De.Value + "<br/>";
                    //}
                }
                else
                {
                    Re = "你没有传递任何参数过来!";
                }
            }
            else
            {
                str  = "";
                type = "GET";
                Re  += type + "<br/>参数分别是:<br/>";
                NameValueCollection nvc = GETInput();
                if (nvc.Count > 0)
                {
                    string sssss = nvc.GetKey(0).ToString();
                    int    sn    = 0;
                    try
                    {
                        sn = Convert.ToInt32(nvc.GetValues(0)[0]);
                    }
                    catch
                    {
                        Re = "输入错误";
                    }
                    if (sssss.ToLower() == "login")
                    {
                        if (sn > 0)
                        {
                            ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                            DataTable dt = BaseClass.Byte2DS(fsc.GetSqlByByte("Select ID,Sn,Name From MiniEmp Where (Sn=" + sn + ")")).Tables[0];
                            if (dt.Rows.Count == 1)
                            {
                                Re = dt.Rows[0]["ID"].ToString() + " " + dt.Rows[0]["Name"].ToString();
                            }
                            else
                            {
                                Re = "0";
                            }
                        }
                    }
                    else if (sssss.ToLower() == "ticketid")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        Re = fsc.GetBoxInfo(sn.ToString());
                    }
                    else if (sssss.ToLower() == "getticketinfo")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        Re = fsc.GetTicketInfo(sn.ToString());
                    }
                    else if (sssss.ToLower() == "empaddwork")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new WebApplication1.ServiceReference1.FileTransportServiceClient();
                        string usid = nvc.GetValues(1)[0].ToString();
                        string date = nvc.GetValues(2)[0].ToString();
                        Re = fsc.EmpAddWork(sn.ToString(), usid, date);
                    }
                    else if (sssss.ToLower() == "ordering")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new ServiceReference1.FileTransportServiceClient();
                        Re = fsc.Ordering(sn.ToString());
                    }
                    //else if (sssss.ToLower() == "daylist")
                    //{
                    //    ServiceReference1.FileTransportServiceClient fsc = new ServiceReference1.FileTransportServiceClient();
                    //    Re = fsc.GetEmpWorkingList(sn, 1);
                    //}
                    //else if (sssss.ToLower() == "monthlist")
                    //{
                    //    ServiceReference1.FileTransportServiceClient fsc = new ServiceReference1.FileTransportServiceClient();
                    //    Re = fsc.GetEmpWorkingList(sn, 2);
                    //}
                    else if (sssss.ToLower() == "paylist")
                    {
                        ServiceReference1.FileTransportServiceClient fsc = new ServiceReference1.FileTransportServiceClient();

                        Re = fsc.GetEmpWorkingList(sn, Convert.ToDateTime(nvc.GetValues(1)[0]), Convert.ToDateTime(nvc.GetValues(2)[0]).AddDays(1));
                    }
                    else
                    {
                        Re = sssss;
                    }
                }
                else
                {
                    Re = "你没有传递任何参数过来!";
                }
            }
            Response.Write(Re);
        }