예제 #1
0
파일: YRD.cs 프로젝트: chennqqi3/YRD
        private void BTN_Start_Click(object sender, EventArgs e)
        {
            QUERY q = new QUERY();

            q.chat     = CB_WeChat.Checked;
            q.open     = CB_OpenWhenFound.Checked;
            q.month    = CB_Month.SelectedText;
            q.complete = CB_Complete.SelectedText;
            System.Threading.Thread t = new System.Threading.Thread(QueryData);
            t.Start(q);
        }
예제 #2
0
        public bool QuerySave(string loginKey, ref ErrorInfo err, QUERY inEnt, IList <string> allPar)
        {
            GlobalUser gu = Global.GetUser(loginKey);

            if (gu == null)
            {
                err.IsError = true;
                err.Message = "登录超时";
                return(false);
            }

            if (!UserCheckFunctioAuthority(loginKey, ref err, MethodBase.GetCurrentMethod()))
            {
                return(false);
            }


            using (DBEntities db = new DBEntities())
            {
                try
                {
                    var  ent   = db.YL_QUERY.SingleOrDefault(a => a.ID == inEnt.ID);
                    bool isAdd = false;
                    if (ent == null)
                    {
                        isAdd = true;
                        ent   = Fun.ClassToCopy <ProInterface.Models.QUERY, YL_QUERY>(inEnt);
                    }
                    else
                    {
                        //if (!inEnt.QUERY_CONF.Equals(ent.QUERY_CONF))
                        //{
                        //    inEnt.QUERY_CONF = string.Format("--{0}于{1}修改\r\n{2}",gu.UserName,DateTime.Now.ToString(),inEnt.QUERY_CONF);
                        //}

                        ent = Fun.ClassToCopy <ProInterface.Models.QUERY, YL_QUERY>(inEnt, ent, allPar);
                    }

                    if (isAdd)
                    {
                        db.YL_QUERY.Add(ent);
                    }
                    db.SaveChanges();
                    UserWriteLog(loginKey, MethodBase.GetCurrentMethod(), StatusType.UserLogType.Edit);
                    return(true);
                }
                catch (Exception e)
                {
                    err.IsError = true;
                    err.Message = Fun.GetExceptionMessage(e);
                    return(false);
                }
            }
        }
예제 #3
0
파일: YRD.cs 프로젝트: chennqqi3/YRD
        private void QueryData(object obj)
        {
            start = true;
            QUERY  q        = (QUERY)obj;
            string req_data = "period=" + q.month + "&currRate=&amt=&progress=" + q.complete;

            while (start)
            {
                string res = Web.HttpGet("https://www.yirendai.com/loan/list/1", req_data);
                //Web.WeChat("13630053218",res);
                Console.WriteLine(res);
            }
        }
예제 #4
0
        private void Button_Them_Click(object sender, RoutedEventArgs e)
        {
            PHIEUHANG phieuHang = new PHIEUHANG();

            if (tbMaHang.Text != "" && tbMaKhach.Text != "" && tbSoCT.Text != "" &&
                tbSoLuong.Text != "" && tbDienGiai.Text != "" && datePicker.Text != "")
            {
                phieuHang.NGAY        = datePicker.SelectedDate.Value;
                phieuHang.SOCHUNGTU   = tbSoCT.Text;
                phieuHang.MAKHACHHANG = tbMaKhach.Text;
                phieuHang.DIENGIAI    = tbDienGiai.Text;
                phieuHang.MAHANG      = tbMaHang.Text;
                if (LoaiPhieu == 1)
                {
                    phieuHang.SOLUONG = Int32.Parse(tbSoLuong.Text);
                }
                else
                {
                    phieuHang.SOLUONG = -Int32.Parse(tbSoLuong.Text);
                }
                phieuHang.LOAIPHIEU = (byte)LoaiPhieu;

                // Kiểm tra dữ liệu nhập
                if (QUERY.KiemTraSoChungTu(phieuHang.SOCHUNGTU))
                {
                    MessageBox.Show("Số chứng từ đã tồn tại", "Thông báo");
                }
                else if (QUERY.KiemTraMaKhachHang(phieuHang.MAKHACHHANG) == false)
                {
                    MessageBox.Show("Không tồn tại mã khách hàng", "Thông báo");
                }
                else if (QUERY.KiemTraMaHang(phieuHang.MAHANG) == false)
                {
                    MessageBox.Show("Không tồn tại mã hàng", "Thông báo");
                }
                else   // Thêm phiếu hàng
                {
                    INSERT.ThemPhieuHang(phieuHang);
                    UPDATE.SuaSoLuongSanPham(phieuHang.MAHANG, (int)phieuHang.SOLUONG);
                    MessageBox.Show("Thêm thành công", "Thông báo");
                    this.Close();
                }
            }
            else
            {
                MessageBox.Show("Chưa nhập đủ thông tin", "Thông báo");
            }
        }
예제 #5
0
        private void Button_Them_Click(object sender, RoutedEventArgs e)
        {
            // Thêm kho vào database
            if (tbMa.Text != "" && tbTen.Text != null)
            {
                if (QUERY.KiemTraMaKho(tbMa.Text) == false)
                {
                    Kho kho = new Kho();
                    kho.MaKho  = tbMa.Text;
                    kho.TenKho = tbTen.Text;

                    Database.INSERT.ThemKho(kho);
                    MessageBox.Show("Thêm thành công", "Thông báo");
                }
                else
                {
                    MessageBox.Show("Đã tồn tại mã kho", "Thông báo");
                }
            }
        }
예제 #6
0
        public override void RunAsync()
        {
            try
            {
                const string QUERY =
                    @"<LINK action=""assign"" guid=""{0}"" reddotcacheguid=""""><PAGE action=""copy"" guid=""{1}"" copymode=""{2}"" /></LINK>";
                Project.Session.ExecuteRQL(QUERY.RQLFormat(ConnectionTarget, PageToCopy, (int)_flags), RQL.IODataFormat.SessionKeyAndLogonGuid);
            }
            catch (RQLException e)
            {
                if (e.ErrorCode != ErrorCode.Unknown)
                {
                    throw;
                }
                //The following "error" messages occur for ENG and DEU, as i don't know all messages for all languages, we just ignore all errors for now ...

                //The copy job is added to the processing queue. The procedure can take some time.

                //Der Kopiervorgang wird in die Prozesswarteschlange eingefügt. Die Ausführung kann einige Zeit dauern.
            }
        }