Beispiel #1
0
        private void Form_NoFaHuo_Load(object sender, EventArgs e)
        {
            //添加soapheader

            DeliveryPrintService.myheader myheader = new myheader();
            myheader.username = "******";

            MyService.myheaderValue = myheader;
        }
Beispiel #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            XmlDocument doc = new XmlDocument();
            doc.Load("PathConfig.xml");
            XmlNode node = doc.SelectSingleNode("Config/Path");
            XmlNode node1 = doc.SelectSingleNode("Config/ServiceName");
            XmlNode node2 = doc.SelectSingleNode("Config/Format");
            XmlNode node3 = doc.SelectSingleNode("Config/ShopSource");
            XmlNode node4 = doc.SelectSingleNode("Config/PrintName");

            string serverPath = node.InnerText;
            //serviceName = node1.InnerText;
            //format = node2.InnerText;
             string address = serverPath;
            //shopSource = node3.InnerText;
            //printName = node4.InnerText;

            DeliveryPrintService.DeliveryPrintService MyService = new DeliveryPrintService.DeliveryPrintService();
            MyService.Credentials = System.Net.CredentialCache.DefaultCredentials;
            MyService.Url = "http://" + address + "/DeliveryPrintService.asmx";

            DeliveryPrintService.myheader myheader = new myheader();
            myheader.username = "******";

            MyService.myheaderValue = myheader;

            string strUserName = StringTools.EncodingForString(this.textBox_gly.Text.Trim());
            string strPassword = StringTools.EncodingForString(this.textBox_kl.Text.Trim());
            string fuser = StringTools.EncodingForString(this.textBox_user.Text.Trim());

            bool b = MyService.RUser(strUserName, strPassword, fuser);
            if(b)
            {
                MessageBox.Show("用户:"+this.textBox_user.Text+"  解锁成功!");
            }
            else
            {
                MessageBox.Show("解锁失败,请确认管理密码、口令和解锁用户代码正确!");
            }
        }
Beispiel #3
0
        private void getprintpartok(int sid)
        {
            orderunm = textBox_ordernum.Text.Trim();
            kddh = textBox_kddh.Text.Trim();
            mjid = textBox_maijia.Text.Trim();
            caozuo = textBox_caozuo.Text.Trim();
            shijian = dateTimePicker1.Value.Date;
            hdname = textBox_huodongname.Text.Trim();
            ddtime = dateTimePicker2.Value.Date;

            try
            {
                //执行查询
                MyService.Credentials = System.Net.CredentialCache.DefaultCredentials;
                string address = m_Address;
                DataTable dt = new DataTable();

                    MyService.Url = "http://" + address + "/DeliveryPrintService.asmx";

                    DeliveryPrintService.myheader myheader = new myheader();
                    myheader.username = "******";

                    MyService.myheaderValue = myheader;

                    dt = MyService.GetPrintPart(sid,orderunm,kddh,mjid,caozuo,shijian,hdname,ddtime,ptimeselect,ddtimeselect);

                if (dt != null && dt.Rows.Count > 0)
                {
                    this.dataGridView_allprintok.DataSource = dt;
                    lastid = fromid;
                    fromid = int.Parse(dt.Rows[dt.Rows.Count - 1]["编号"].ToString());
                    checknext();

                }
                else
                {
                    fromid = 0;
                    checknext();
                    MessageBox.Show("没有找到符合条件的打印数据。", "提示:");
                    dataGridView_allprintok.DataSource = null;
                }
            }
            catch (Exception ee)
            {

                MessageBox.Show(ee.Message);
            }
        }
Beispiel #4
0
        private void Form_PrintAllOk_Load(object sender, EventArgs e)
        {
            getprintpartok(fromid);

            if (fromid == 0)
            {
                button_next.Enabled = false;
            }

            DeliveryPrintService.myheader myheader = new myheader();
            myheader.username = "******";

            MyService.myheaderValue = myheader;

            GetNumGroupBy();
        }
Beispiel #5
0
 private void Form_kucun_Load(object sender, EventArgs e)
 {
     str();
     DeliveryPrintService.myheader myheader = new DeliveryPrintService.myheader();
     myheader.username = "******";
     MyService.myheaderValue = myheader;
     dataGridView1.DataSource = null;
 }
Beispiel #6
0
        /// <summary>
        /// 填充活动数据
        /// </summary>
        private void gethdname()
        {
            timer1.Enabled = true;
            toolStripStatusLabel1.ForeColor = Color.FromArgb(80, Color.DarkRed);
            toolStripStatusLabel1.Text = "您正在获取活动名称.";
            //填充活动数据
            try
            {

                MyService.Credentials = System.Net.CredentialCache.DefaultCredentials;
                string address = m_Address;
                MyService.Url = "http://" + address + "/DeliveryPrintService.asmx";
                DeliveryPrintService.myheader myheader = new myheader();
                myheader.username = "******";

                MyService.myheaderValue = myheader;
                ll = MyService.GetHdNameAll(Seller_ID);
                kk = new List<string>();

                for (int k = 0;k< ll.Rows.Count;k++ )
                {
                    string x = ll.Rows[k]["hdname"] + "|" + ll.Rows[k]["seller"];
                    kk.Add(x);
                }

                if (ll != null )
                {
                    comboBox_hdname.DataSource = kk;
                }
                else
                {
                    MessageBox.Show("没有取得活动信息,请连接网络并点击“获取活动名称”按钮");
                }
            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
                //throw;
            }
            timer1.Enabled = false;
            toolStripStatusLabel1.ForeColor = Color.FromArgb(80, Color.DarkGreen);
            toolStripStatusLabel1.Text = "获取活动名称动作完毕  [时间:" + System.DateTime.Now.ToString("yyyy年MM月dd HH时mm分ss秒") + "]";
        }
Beispiel #7
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //填充活动数据
            gethdname();

            //
            label_printuser.Text = this.Account;

            //
            this.cmbSelect.SelectedItem = this.cmbSelect.Items[0];
            this.cmbShopMethod.SelectedItem = this.cmbShopMethod.Items[0];

            //
            GetPrintNum();

            //
            toolStripStatusLabel1.Text = "您正在使用柠檬绿茶团购打印系统";

            //添加soapheader

            DeliveryPrintService.myheader myheader = new myheader();
            myheader.username = "******";

            MyService.myheaderValue = myheader;

            if(userrole.Equals("查询"))
            {
                this.button_download.Enabled = false;
                this.button_jiechu.Enabled = false;
                this.btnPrint.Enabled = false;
                this.btnSave.Enabled = false;
                this.btnSelect.Enabled = false;
            }
        }
Beispiel #8
0
        private void Login()
        {
            try
            {
                //验证
                if (CheckLogin())
                {
                    //address = ReadConfig(); //获取地址
                    XmlDocument doc = new XmlDocument();
                    doc.Load("PathConfig.xml");
                    XmlNode node = doc.SelectSingleNode("Config/Path");
                    XmlNode node1 = doc.SelectSingleNode("Config/ServiceName");
                    XmlNode node2 = doc.SelectSingleNode("Config/Format");
                    XmlNode node3 = doc.SelectSingleNode("Config/ShopSource");
                    XmlNode node4 = doc.SelectSingleNode("Config/PrintName");

                    string serverPath = node.InnerText;
                    serviceName = node1.InnerText;
                    format = node2.InnerText;
                    address = serverPath;
                    shopSource = node3.InnerText;
                    printName = node4.InnerText;

                    DeliveryPrintService.DeliveryPrintService MyService = new DeliveryPrintService.DeliveryPrintService();
                    MyService.Credentials = System.Net.CredentialCache.DefaultCredentials;
                    MyService.Url = "http://" + address + "/DeliveryPrintService.asmx";

                    DeliveryPrintService.myheader myheader = new myheader();
                    myheader.username = "******";

                    MyService.myheaderValue = myheader;

                    ////使用cookie
                    //CookieContainer cookie=new CookieContainer();

                    //MyService.CookieContainer = cookie;

                    string strUserName = StringTools.EncodingForString(this.txtUserName.Text.Trim());
                    string strPassword = StringTools.EncodingForString(this.txtPassword.Text.Trim());
                    DataTable dt = MyService.LoginCheck(strUserName, strPassword);

                    if (dt != null)
                    {
                        if (dt.Rows.Count > 0)
                        {
                            string UserRole = dt.Rows[0]["UserRole"].ToString();
                            string Seller_ID = dt.Rows[0]["Seller_ID"].ToString();
                            string Seller_Iid = dt.Rows[0]["Seller_Iid"].ToString();
                            if(!UserRole.Equals("Q"))
                            {
                                DeliveryPrint dp = new DeliveryPrint();

                                foreach (DataRow dr in dt.Rows)
                                {
                                    dp.Account = dr["Account"].ToString();
                                    dp.CPersonCode = dr["cPersonCode"].ToString();
                                    //dp.CDepCode = dr["cDepCode"].ToString();
                                }
                                dp.Userrole = "打印";
                                dp.Address = address;
                                dp.Seller_ID = Seller_ID;
                                dp.Seller_Iid = Seller_Iid;
                                dp.ServiceName = serviceName;
                                // dp.Format = format;
                                dp.ShipSource = shopSource;
                                dp.PrintName = printName;
                                dp.Show();
                                this.Hide();
                            }
                            else
                            {
                                DeliveryPrint dp = new DeliveryPrint();

                                foreach (DataRow dr in dt.Rows)
                                {
                                    dp.Account = dr["Account"].ToString();
                                    dp.CPersonCode = dr["cPersonCode"].ToString();
                                    dp.CDepCode = dr["cDepCode"].ToString();
                                }
                                dp.Userrole = "查询";
                                dp.Address = address;
                                dp.Seller_ID = Seller_ID;
                                dp.Seller_Iid = Seller_Iid;
                                //dp.ServiceName = serviceName;
                                //// dp.Format = format;
                                //dp.ShipSource = shopSource;
                                //dp.PrintName = printName;
                                dp.Show();
                                dp.Show();
                                this.Hide();

                            }

                        }
                        else
                        {
                            MessageBox.Show("用户名和密码输入的不正确!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                            ClearText();
                            this.txtUserName.Focus();

                        }
                    }
                    else
                    {
                        MessageBox.Show("用户名和密码输入的不正确,或该用户已经登录!", "提示信息", MessageBoxButtons.OK, MessageBoxIcon.Error);
                        ClearText();
                        this.txtUserName.Focus();

                    }
                }

            }
            catch (Exception ee)
            {
                MessageBox.Show(ee.Message);
                //throw;
            }
        }