public ActionResult DakaContent(int id)
        {
            RenwuDaka daka = unitOfWork.renwuDakasRepository.GetByID(id);

            ViewHistory _viewHistory = new ViewHistory();

            _viewHistory.DakaBiji    = id;
            _viewHistory.DakaRen     = daka.RenwuZhixingzhe;
            _viewHistory.Peibanshi   = daka.Peibanshi;
            _viewHistory.Kongjian    = daka.Kongjian;
            _viewHistory.ProductBook = daka.ProductBook;
            _viewHistory.ViewRen     = int.Parse(Session["renid"].ToString());
            _viewHistory.ViewTime    = DateTime.Now;
            unitOfWork._viewHistorysRepository.Insert(_viewHistory);
            unitOfWork.Save();

            int dianzanren = int.Parse(Session["renid"].ToString());

            var dianzan = unitOfWork._bijiDianzansRepository.Get(filter: u => u.DakaBiji == id && u.DianzanRen == dianzanren && u.Dianzan == true);

            ViewBag.dianzan = false;
            if (dianzan.Count() > 0)
            {
                ViewBag.dianzan = true;
            }
            return(View(daka));
        }
Example #2
0
        public List <ViewHistory> ViewStory(string name)
        {
            DiseaseDbGateway  aDiseaseDbGateway  = new DiseaseDbGateway();
            DistrictDbGateway aDistrictDbGateway = new DistrictDbGateway();
            ThanaDbGateway    aThanaDbGateway    = new ThanaDbGateway();
            CenterDbGateway   aCenterDbGateway   = new CenterDbGateway();
            string            query = "SELECT *FROM tbl_patient WHERE name='" + name + "'";

            ASqlConnection.Open();
            ASqlCommand    = new SqlCommand(query, ASqlConnection);
            ASqlDataReader = ASqlCommand.ExecuteReader();
            List <ViewHistory> viewHistories = new List <ViewHistory>();

            while (ASqlDataReader.Read())
            {
                ViewHistory aViewHistory = new ViewHistory();
                aViewHistory.Id       = Convert.ToInt32(ASqlDataReader["id"]);
                aViewHistory.Name     = ASqlDataReader["name"].ToString();
                aViewHistory.Diseases = aDiseaseDbGateway.Find(Convert.ToInt32(ASqlDataReader["diseaseId"])).Name;
                aViewHistory.Destrict = aDistrictDbGateway.Find(Convert.ToInt32(ASqlDataReader["districtId"])).Name;

                aViewHistory.Thana  = aThanaDbGateway.Find(Convert.ToInt32(ASqlDataReader["thanaId"])).Name;
                aViewHistory.Center = aCenterDbGateway.Search(Convert.ToInt32(ASqlDataReader["centerId"])).Name;

                viewHistories.Add(aViewHistory);
            }
            ASqlDataReader.Close();
            ASqlConnection.Close();
            return(viewHistories);
        }
Example #3
0
        public void ShowHistory()
        {
            ViewHistory viewHistory = new ViewHistory {
                Owner = _view
            };

            viewHistory.ShowDialog();
        }
Example #4
0
        protected void ValueBackTriggered(object sender, EventArgs e)
        {
            var viewHistory = this.ViewHistory;

            viewHistory.Pop();                                                        //pop the current
            this.ViewHistory = viewHistory;
            this.TransitionView(sender as ICanChangeMyVisibility, ViewHistory.Pop()); //pop the previous one
        }
Example #5
0
        protected void LoadInfo()
        {
            id = WS.RequestLong("id");
            if (id < 0)
            {
                return;
            }

            DataEntities ent = new DataEntities();

            if (u.ID > 0)
            {
                ViewHistory his = new ViewHistory();
                try
                {
                    his = (from l in ent.ViewHistory where l.ItemID == id && l.UserID == u.ID && l.ModelID == 5 select l).First();
                }
                catch
                { }

                his.ViewTime = DateTime.Now;
                his.ModelID  = 5;
                his.ItemID   = id;
                his.UserID   = u.ID;

                if (his.ID <= 0)
                {
                    ent.AddToViewHistory(his);
                }
                ent.SaveChanges();
            }


            var j = (from l in ent.JobPost where l.ID == id select l).FirstOrDefault();
            var c = (from l in ent.JobCompany where l.ID == j.CompanyID select l).FirstOrDefault();

            Title       = j.Title;
            CompanyID   = c.ID;
            CompanyName = c.CompanyName;
            PostTime    = j.PostTime.ToDateTime().ToString("yyyy-MM-dd");
            Province    = JobAction.GetProviceName(j.Province.ToInt32());
            City        = JobAction.GetCityName(j.City.ToInt32());
            Exp         = JobAction.GetExpressionsName(j.Expressions.ToInt32());
            Salary      = JobAction.GetSalaryDegreeName(j.Salary.ToInt32());
            Edu         = j.GetPostEdu();          //JobAction.GetEduName(j.Edu.ToInt32());
            EmpCount    = j.GetPostEduAndNumber(); //j.EmployNumber == 0 ? "若干" : j.EmployNumber.ToS();
            Intro       = j.Intro;
            CompIntro   = c.Intro;

            JobAction.AddCityHot(j.City.ToInt32());

            RelaJobs = Functions.getpostlist("5",
                                             "0",
                                             string.Format("t.Title='{0}' and t.Id!={1}", j.Title, j.ID),
                                             "t.id desc",
                                             "<tr><td height=\"80\"style=\"border-bottom: 1px solid #eeeeee\"><table width=\"810\"align=\"center\"border=\"0\"cellspacing=\"0\"cellpadding=\"0\"><tr><td align=\"left\"><table width=\"680\"border=\"0\"cellspacing=\"0\"cellpadding=\"0\"align=\"left\"><tr><td align=\"left\"class=\"job_title\"><a href=\"Job.aspx?id={id}\">{title}</a></td></tr><tr><td align=\"left\"><table width=\"610\"border=\"0\"cellspacing=\"0\"cellpadding=\"0\"><tr><td align=\"left\"class=\"job_compangy\"><a href=\"Company.aspx?id={companyid}\">{companyname}</a></td><td align=\"left\"class=\"job_qt\">规模{employeecount}/学历{edu}/经验{expressions}</td><td align=\"left\"class=\"job_qt1\">月薪<span>{salary}</span></td></tr></table></td></tr></table></td><td width=\"100\"align=\"center\"style=\"line-height: 24px; color: #666666\"><input type=\"button\"onclick=\"post({id})\"value=\"一键投递\"style=\"background: url(/skin/job/img/td.gif) no-repeat; width: 60px;height: 22px; color: #FFFFFF; border: 0px;\"/><br/>{posttime}</td></tr></table></td></tr>");
        }
Example #6
0
        //public DataTable Dbtable { get => dbtable; set => dbtable = value; }

        private void loginButton_Click(object sender, RoutedEventArgs e)
        {
            if (globalUserID == 0)
            {
                LoginDialog dlg = new LoginDialog();
                dlg.Owner = this;
                dlg.ShowDialog();
                // Process data entered by user if dialog box is accepted
                if (dlg.DialogResult == true)
                {
                    if (userData.LogIn(dlg.nameTextBox.Text, dlg.passwordTextBox.Password) == true)
                    {
                        userData.LogoutCheck(false);
                        this.statusTextBlock.Text = "You are logged in as " + userData.FullName;

                        bookWishList = new BookWishlist(); //Create Wishlist object
                        viewHistory  = new ViewHistory();  //Create View History object

                        CheckAvailableBook();
                        if (userData.isManager) //Checks if Account is Manager
                        {
                            this.adminButton.Visibility        = Visibility.Visible;
                            this.wishListButton.Visibility     = Visibility.Visible;
                            this.orderHistoryButton.Visibility = Visibility.Visible;
                            this.editProfile.Visibility        = Visibility.Visible;
                        }
                        else
                        {
                            this.adminButton.Visibility        = Visibility.Hidden;  // hide admin button
                            this.wishListButton.Visibility     = Visibility.Visible; //Display wishlist for non admin
                            this.orderHistoryButton.Visibility = Visibility.Visible;
                            this.editProfile.Visibility        = Visibility.Visible;
                        }

                        //Hide Login Text on Login Button
                        this.loginButton.Content = "Logout";
                        globalUserID             = userData.UserID;
                    }
                    else //if Login Fails
                    {
                        this.statusTextBlock.Text = "Your login failed. Please try again.";
                    }
                }
            }
            else //If user is already logged in and wants to logout
            {
                userData.LogoutCheck(true);
                globalUserID                       = 0;
                this.loginButton.Content           = "Login";
                this.statusTextBlock.Text          = "You have successfully Logged Out!";
                this.adminButton.Visibility        = Visibility.Hidden; //Hide Admin Button
                this.wishListButton.Visibility     = Visibility.Hidden; //Hide Wishlist Button
                this.orderHistoryButton.Visibility = Visibility.Hidden;
                this.editProfile.Visibility        = Visibility.Hidden;
            }
        }
Example #7
0
        public ViewHistory GetViewHistory()
        {
            ViewHistory vh = Session["ViewHistory"] as ViewHistory;

            if (vh == null || Session["ViewHistory"] == null)
            {
                vh = new ViewHistory();
                Session["ViewHistory"] = vh;
            }
            return(vh);
        }
Example #8
0
        private TimeSpan GetTotalWatchTimeTask(ViewHistory history)
        {
            double totalTime = 0;

            foreach (var item in history.viewedItems)
            {
                totalTime += item.duration;
            }

            return(TimeSpan.FromSeconds(totalTime));
        }
Example #9
0
 private void LawView_Load(object sender, EventArgs e)
 {
     //mh = new Utity.MouseHook();
     //mh.SetHook();
     //mh.MouseMoveEvent += Mh_MouseMoveEvent;
     //this.Text += "-"+law.title + " " + law.version;
     lbl_title.Text    = law.title + " " + law.version;
     lbl_welcome.Text += Global.user.Xm;
     if (law != null)
     {
         //如果在线,且未下载到本地,则从远程获取章节信息,并入库
         if (Global.online && "0" == law.isLocal)
         {
             List <Node> nodes = RemoteWorker.getBookContent(law.lawId);   //获取法规整体章节结构
             RemoteWorker.getNodeDetail(nodes.Select(n => n.Id).ToList()); //再获取每个章节的内容
         }
         nodes = db.getNodeByLawId(law.lawId);
         //绑定关系
         tags = NodeWorker.buildRelationFromNode(nodes);
         bindTagsToDGW();
         //绑定树结构
         string content = NodeWorker.buildFromNodeContext(NodeTree, nodes);
         //绑定法规内容
         wb.DocumentText = content;
         SetAutoWrap(true);
         if (Global.online)// && string.IsNullOrEmpty(law.isLocal))
         {
             //远程获取评论
             RemoteWorker.getOpinionList(law.lawId);
             //加载评论
             loadComment();
         }
         //加载文档信息
         lawInfo1.law        = law;
         lawInfo1.parentForm = this.parentForm;
         lawInfo1.fillLawVersion(laws);
         lawInfo1.fillLawInfo();
         lawInfo1.bindState = true;
         //写入阅读历史
         ViewHistory history = new ViewHistory()
         {
             Id       = law.lawId,
             LawID    = law.lawId,
             UserID   = Global.user.Id,
             ViewDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
         };
         if (db.saveHistory(history))
         {
             ((LibraryList)parentForm).addHistory(history);
         }
     }
 }
Example #10
0
        private void UpdateListah()
        {
            DateTime now  = DateTime.Now;
            Random   Ran  = new Random();
            int      car  = Ran.Next(1, 4);
            string   carT = "а" + Ran.Next(0, 10) + Ran.Next(0, 10) + Ran.Next(0, 10) + "бв";
            int      AntennaPortNumber = Ran.Next(1, 3);
            bool     visit             = new bool();

            visit = Convert.ToBoolean(Ran.Next(0, 2));
            string avisit;

            if (visit == true)
            {
                avisit = "Разрешено";
            }
            else
            {
                avisit = "Не разрешено";
            }
            string tvisit;

            if (AntennaPortNumber == 1)
            {
                tvisit = "Въезд";
            }
            else
            {
                tvisit = "Выезд";
            }
            ViewHistory.Focus();
            ViewHistory.Rows.Add(now, carT, tvisit, avisit);
            //BoxNumberCar.Text = ViewHistory.CurrentRow.Cells[number_car.Index].Value.ToString();
            //ListTags.Items.Add(counter + ") Дата и время: " + now + "\n   Номер антенны: " + AntennaPortNumber);
            //ListTags.Items.Add("\n   EPC: " + Epc + "\n   № машины: " + machine + "\n   Тип проезда: " + tvisit + "\n   Доступ: " + avisit);
            if (visit == false)
            {
                if (AntennaPortNumber == 1)
                {
                    MessageBox.Show("Машине на проезде въезд запрещен!!!");
                }
                else
                {
                    MessageBox.Show("Машине на проезде выезд запрещен!!!");
                }
            }
        }
Example #11
0
        private void orderDetails_Click(object sender, RoutedEventArgs e)
        {
            ViewHistory viewHistory = new ViewHistory(); //Create View History object
            DataRowView selectedRow;

            if (orderHistoryView.SelectedItem == null)
            {
                return;
            }
            else
            {
                selectedRow = (DataRowView)this.orderHistoryView.SelectedItems[0];
                string       OrderID   = selectedRow.Row.ItemArray[0].ToString();
                int          OIDnumber = Convert.ToInt32(OrderID);
                OrderDetails orderDet  = new OrderDetails(); //Initiate Window
                DataSet      orders    = viewHistory.getDetails(OIDnumber);
                orderDet.DataContext = orders.Tables["OrderDetails"];
                orderDet.Owner       = this;
                orderDet.ShowDialog();
            }
        }
Example #12
0
        private ViewHistory GetViewHistoryFromPages(List <ViewHistory> pages)
        {
            ViewHistory vh = new ViewHistory()
            {
                viewedItems = new List <ViewItem>(),
                page        = 1
            };

            foreach (ViewHistory page in pages)
            {
                foreach (ViewItem item in page.viewedItems)
                {
                    vh.viewedItems.Add(item);
                }
            }

            vh.size = vh.viewedItems.Count;

            vh.totalWatchTime = GetTotalWatchTimeTask(vh);

            return(vh);
        }
Example #13
0
        /// <summary>
        /// Bắt sự kiện đăng nhập và khởi tạo các use case có liên quan
        /// </summary>
        /// <param name="isSuccess"></param>
        /// <param name="ds"></param>
        /// <param name="mathe"></param>
        private void Validation_login(bool isSuccess, DanhsachtheATM ds, string mathe)
        {
            if (isSuccess)
            {
                this.ds    = ds;
                tk         = DanhSachTaiKhoan_BUL.Instance.LayThongTinTaiKhoan(ds.Mataikhoan);
                kh         = KhachHang_BUL.Instance.LayThongTinKhachHang(tk.Makhachhang);
                main       = new MainUC(tk, kh);
                this.mathe = mathe;

                main.rutten       += Main_rutten;
                main.checkBalance += Main_checkBalance;
                main.history      += Main_history;
                main.changePIN    += Main_changePIN;
                main.exit         += Main_exit;
                main.cardTranfer  += Main_cardTranfer;

                viewHistory   = new ViewHistory(tk, kh, mathe, thongTinMay.MaATM);
                checkBanlance = new CheckBanlance(tk, kh, mathe, thongTinMay.MaATM);
                changePIN     = new ChangePIN(mathe, thongTinMay.MaATM, this);
                withDraw      = new WithDraw(tk, kh);
                beingFinal    = new BeingFinal_UC(tk, kh);
                cardTranfer   = new CardTranfer(tk, kh, mathe, thongTinMay.MaATM, this);
                final_UC      = new Final_UC(tk, kh);

                withDraw.SetMoney   += WithDraw_SetMoney;
                viewHistory.click   += ViewHistory_click;
                checkBanlance.click += CheckBanlance_click;
                changePIN.ok        += ChangePIN_ok;
                cardTranfer.tranfer += CardTranfer_tranfer;

                final_UC.click_Finish += Final_UC_click_Finish;

                mainPanel.Controls.Clear();
                mainPanel.Controls.Add(main);
            }
        }
Example #14
0
        /// <summary>
        /// 将阅读历史主动加到阅读历史列表中,避免再次查库。加入时,如果列表中没有相同的法规,则新增,如果有,则将其提至第一条
        /// </summary>
        /// <param name="history"></param>
        public void addHistory(ViewHistory history)
        {
            bool found = false;

            for (int i = 1; i < flp_viewHistory.Controls.Count; i++)
            {
                var tempVh = flp_viewHistory.Controls[i] as ViewHistoryListItem;
                if (tempVh.viewHistory.LawID == history.LawID)
                {
                    flp_viewHistory.Controls.SetChildIndex(tempVh, 1);
                    found = true;
                    break;
                }
            }
            if (found == false)
            {
                ViewHistoryListItem item = new ViewHistoryListItem();
                item.parentForm  = this;
                item.viewHistory = history;
                item.fillViewHistory();
                flp_viewHistory.Controls.Add(item);
                flp_viewHistory.Controls.SetChildIndex(item, 1);
            }
        }
Example #15
0
        /// <summary>
        /// 获取历史
        /// </summary>
        /// <param name="ID"></param>
        /// <returns></returns>
        public JsonResult GetHistory(string ID)
        {
            ViewHistory his = new ViewHistory();
            ReturnJson  r   = new ReturnJson()
            {
                s = "ok"
            };

            using (var db = new SHBTONLINEContext())
            {
                var play = db.Plays.Where(p => p.ID == ID).First();
                his.Result = play.Results;
                List <History> hiss   = new List <History>();
                var            parent = db.PlayItems.Where(p => p.PlayID == ID).ToList();
                parent.ForEach(p => {
                    History item = new History()
                    {
                        Cost1      = p.Cost1,
                        Cost2      = p.Cost2,
                        CreateTime = p.CreateTime,
                        Get        = p.Get,
                        Get2       = p.Get2,
                        ID         = p.ID,
                        Loginname  = p.Loginname,
                        PlayID     = p.PlayID,
                        State      = p.State
                    };
                    item.Name = db.userinfoes.Where(w => w.LoginName == item.Loginname).First().Name;
                    hiss.Add(item);
                });

                his.list = hiss;
                r.r      = his;
            }
            return(Json(r));
        }
Example #16
0
 /// <summary>
 /// 保存浏览历史
 /// </summary>
 /// <param name="history"></param>
 /// <returns></returns>
 public bool saveHistory(ViewHistory history)
 {
     using (SqliteContext context = new SqliteContext())
     {
         try
         {
             var tempViewHistory = context.ViewHistory.FirstOrDefault(v => v.LawID == history.LawID && v.UserID == Global.user.Id);
             if (tempViewHistory == null)
             {
                 context.ViewHistory.Add(history);
             }
             else
             {
                 tempViewHistory.ViewDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             }
             context.SaveChanges();
             return(true);
         }
         catch (Exception ex)
         {
             return(false);
         }
     }
 }
Example #17
0
 public void AddToHistory(Estate estate)
 {
     ViewHistory.Add(estate);
 }
Example #18
0
        public ActionResult ShowToGetViewHistoryt()
        {
            ViewHistory vh = Session["ViewHistory"] as ViewHistory;

            return(View(vh));
        }
 public PresenterHistory(ViewHistory view)
 {
     _view = view;
     Init();
 }
Example #20
0
 public Task <TimeSpan> GetTotalWatchTime(ViewHistory history)
 {
     return(Task.Run(() => GetTotalWatchTimeTask(history)));
 }
Example #21
0
 public void AddToViewHistory(ViewHistory viewHistory)
 {
     base.AddObject("ViewHistory", viewHistory);
 }
Example #22
0
 public static ViewHistory CreateViewHistory(long id)
 {
     ViewHistory viewHistory = new ViewHistory();
     viewHistory.ID = id;
     return viewHistory;
 }
Example #23
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        try
        {
            if (!(Request.QueryString["LangType"] == null))
            {
                if (Request.QueryString["LangType"] != "")
                {
                    ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                    m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
                }
                else
                {
                    if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                    {
                        ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                    }
                }
            }
            else
            {
                if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }
            if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
            {
                m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
            }
            else
            {
                m_refContentApi.ContentLanguage = ContentLanguage;
            }

            m_refMsg = m_refContentApi.EkMsgRef;
            StyleSheetJS.Text = m_refStyle.GetClientScript();
            if (Request.QueryString["action"] != null && Request.QueryString["action"] == "report")
            {
                ShowHistoryListFrame(false);
                ViewHistoryList m_viewHistoryList = new ViewHistoryList();
                m_viewHistoryList = (ViewHistoryList)(LoadControl("controls/history/ViewHistoryList.ascx"));
                m_viewHistoryList.ID = "ViewHistory";
                DataHolder.Controls.Add(m_viewHistoryList);
            }
            else
            {
                ShowHistoryListFrame(true);
                ViewHistory m_viewHistory = new ViewHistory();
                m_viewHistory = (ViewHistory)(LoadControl("controls/history/ViewHistory.ascx"));
                m_viewHistory.ID = "ViewHistory";
                DataHolder.Controls.Add(m_viewHistory);
            }
        }
        catch (Exception ex)
        {
            ShowError(ex.Message);
        }
    }
Example #24
0
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     ViewHistory viewHistory = new ViewHistory();
 }