示例#1
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["VotePId"] == null || Session["VotePId"].ToString() == "")
        {
            //Page.ClientScript.RegisterStartupScript(Page.GetType(), "x", "DocDetailtop()", true);

            Response.Write("<script type=\"text/javascript\" language=\"javascript\">window.parent.location.href='" + component.ServerInfo.GetRootURI() + "/votepro/LoginPrompt.aspx?LinkPage=" + Request.Url.ToString() + "';</script>");
            return;
        }

        if (topVote1.FindControl("lizi5") != null)
        {
            //((HtmlGenericControl)topVote1.FindControl("lizi5")).Style.Add("background-image", "url(images/menu_bg1.jpg)");
        }
        if (topVote1.FindControl("izi5") != null)
        {
            ((HtmlAnchor)topVote1.FindControl("izi5")).Style.Add("color", "#ffffff");
        }
        if (!IsPostBack)
        {
            LaiKa.Model.leica_VoteProWorks model = new LaiKa.Model.leica_VoteProWorks();
            AspNetPager1.PageSize = 15;
            AspNetPager1.RecordCount = model.GetCount("Isdelete=0 and voteProjectId=" + voteId);
            //Bind();
        }
    }
示例#2
0
    void Bind()
    {
        LaiKa.Model.leica_VoteProWorks model = new LaiKa.Model.leica_VoteProWorks();
        var dt = model.GetList(5, "Id,ProjectName,ProjectOverview", "Isdelete=0 and voteProjectId=" + voteId, "Id desc");

        rptProduct.DataSource = dt;
        //rept.DataKeyNames = new string[] { "id" };
        rptProduct.DataBind();
    }
示例#3
0
    void Bind()
    {
        //StringBuilder strWhere = new StringBuilder();

        //strWhere.AppendFormat(" 1=1 order by leica_geosystemsVoteProjectWorks.CreateTime desc");

        LaiKa.Model.leica_VoteProWorks model = new LaiKa.Model.leica_VoteProWorks();
        var dt = model.GetList(5, "Id,ProjectName,ProjectOverview", "Isdelete=0 and voteProjectId="+voteId, "Id desc");

        rptProduct.DataSource = dt;
        //rept.DataKeyNames = new string[] { "id" };
        rptProduct.DataBind();
    }
示例#4
0
    void Bind()
    {
        //计算当前页数
        int pageIndex = AspNetPager1.StartRecordIndex == 1 ? AspNetPager1.StartRecordIndex : (AspNetPager1.StartRecordIndex / AspNetPager1.PageSize) + 1;
        LaiKa.Model.leica_VoteProWorks model = new LaiKa.Model.leica_VoteProWorks();
        //进行随机数赋值
        if (AspNetPager1.StartRecordIndex == 1)
            LaiKa.DAL.SqlHelper.ExecuteNonQuery(model.ConnectString, CommandType.StoredProcedure, "sp_RandomCellId", null);
        var dt = model.GetPageList(AspNetPager1.PageSize, "Id,cellId,ProjectName,ProjectOverview,(select count(*) from leica_VoteProRecord where WorksId=leica_VoteProWorks.Id) voteNum", "cellId", pageIndex, "Isdelete=0 and voteProjectId=" + voteId);

        rptProduct.DataSource = dt;
        //rept.DataKeyNames = new string[] { "id" };
        rptProduct.DataBind();

        //leica_geosystemsVoteProjectWorksManager Workbll = new leica_geosystemsVoteProjectWorksManager();

        //StringBuilder strWhere = new StringBuilder();
        //if (txtUsername.Text.Trim() != "")
        //{

        //    strWhere.AppendFormat("WorksName like '%{0}%'", txtUsername.Text.Trim());
        //}

        //AspNetPager1.AlwaysShow = true;
        //AspNetPager1.RecordCount = Workbll.getcounts(strWhere.ToString());
        //Workbll.GetsetdatesRPT(AspNetPager1.PageSize * (AspNetPager1.CurrentPageIndex - 1), AspNetPager1.PageSize, strWhere.ToString(), rptProduct);

        //StringBuilder strWhere = new StringBuilder();

        //rptProduct.DataSource = Workbll.GetList(strWhere.ToString());
        //rptProduct.DataBind();

        //rept.DataKeyNames = new string[] { "id" };

        //rptProduct.DataSource = Workbll.GetList("");
        ////rept.DataKeyNames = new string[] { "id" };
        //rptProduct.DataBind();
    }
示例#5
0
    private void ShowInfo(int id)
    {
        //leica_geosystemsVoteProjectWorksManager bllWorks = new leica_geosystemsVoteProjectWorksManager();
        //leica_geosystemsVoteProjectWorks model = bllWorks.GetModelAdmin(id);

        LaiKa.Model.leica_VoteProWorks model = new LaiKa.Model.leica_VoteProWorks();
        model.GetInfo("Id=" + id + " and voteProjectId=" + voteId);

        this.Label1.Text = model.ProjectName;
        this.Label2.Text = model.ProjectOverview;
        //this.Label3.Text = model.UseProcess;
        workId = model.Id.ToString();
        LabKeyWord.Text = model.keyWord;
        //this.Label4.Text = model.UseExperience;
    }
    bool Storage()
    {
        LaiKa.Model.leica_VoteProWorks model = new LaiKa.Model.leica_VoteProWorks();

        string ProjectName = this.txtProjectName.Text;
        string ProjectOverview = this.txtProjectOverview.Text;
        string UseProcess = this.txtUseProcess.Text;
        string UseExperience = this.txtUseExperience.Text;
        string Copyright = txtCopyright.Text.ToString().Trim();
        string worksExamine = txtWorksExamine.Text.Trim();

        model.AuthorId = 0;
        model.PicAddress = "";
        model.ProjectName = ProjectName;
        model.ProjectOverview = ProjectOverview;
        model.UseProcess = UseProcess;
        model.UseExperience = UseExperience;
        model.Copyright = Copyright;

        model.WorksExamine = worksExamine;
        model.voteProjectId = int.Parse(DDLProjectType.SelectedValue);
        model.Id = int.Parse(Label4.Text);
        model.keyWord = txtKeyWord.Text;

        #region 旧逻辑
        //int f = 0;
        //leica_geosystemsVoteProjectWorksManager bll = new leica_geosystemsVoteProjectWorksManager();
        //int AuthorId = 0;
        //    //int.Parse(Session["VPId"].ToString());

        //StringBuilder strWhere = new StringBuilder();

        //strWhere.AppendFormat("leica_geosystemsVoteProjectWorks.AuthorId='{0}'", AuthorId);
        //strWhere.AppendFormat(" and leica_geosystemsVoteProjectWorks.Id!='{0}'", getid());

        ////Response.Write(bll.GetListAdmin(strWhere.ToString()).Tables[0].Rows.Count);
        ////Response.End();
        ////if (bll.GetList(strWhere.ToString()).Tables[0].Rows.Count == 0)
        ////{

        //string ProjectName = this.txtProjectName.Text;
        //string ProjectOverview = this.txtProjectOverview.Text;
        //string UseProcess = this.txtUseProcess.Text;
        //string UseExperience = this.txtUseExperience.Text;
        //string Copyright = getCopyright().ToString();

        //leica_geosystemsVoteProjectWorks model = new leica_geosystemsVoteProjectWorks();
        //model.AuthorId = AuthorId;

        //model.ProjectName = ProjectName;
        //model.ProjectOverview = ProjectOverview;
        //model.UseProcess = UseProcess;
        //model.UseExperience = UseExperience;
        //model.Copyright = Copyright;

        //model.WorksExamine = "0";
        //model.Copyright = Copyright;

        //StringBuilder strWheres = new StringBuilder();
        //string username = Session["VPId"].ToString();
        //if (username != "")
        //{
        //    strWheres.AppendFormat("AuthorId='{0}'", username);
        //}

        //if (Label4.Text != "")
        //{

        //    model.Id = int.Parse(Label4.Text);

        //    f = bll.Update(model) == false ? 0 : 1000;

        //}
        //else
        //{

        //    if (bll.GetListAdmin(strWhere.ToString()).Tables[0].Rows.Count == 0)
        //    {
        //        f = bll.Add(model);
        //    }

        //}
        //Response.Write(strWhere.ToString());
        //Response.End();

        //if (f > 0)
        //{
            //toemail();
        //}

        //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "提交成功!", "VoteWorksManager.aspx");
        //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "提交成功!", "MyWorks.aspx");
        //}
        //else
        //{
        //    f = -1;
        //    //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "提交失败!", "VoteWorksInfo.aspx");
        //    //Maticsoft.Common.MessageBox.ShowAndRedirect(this, "提交失败!", "VoteWorksManager.aspx");
        //}
        #endregion

        return model.Insert();
    }