Пример #1
0
        public JsonResult GetReportList()
        {
            ResultInfo <ReportTab> ResultInfo = new ResultInfo <ReportTab>()
            {
                Status      = false,
                Description = "Failed|Login"
            };

            try
            {
                ReportTab    temp = new ReportTab();
                User_Backend obj  = new User_Backend();
                temp.comrep = obj.GetAllReports();

                ResultInfo.Info = temp;

                if (ResultInfo.Info != null)
                {
                    ResultInfo.Description = "Success| List Of reports fetched";
                    ResultInfo.Status      = true;
                }
            }
            catch (Exception)
            {
            }

            return(Json(ResultInfo, JsonRequestBehavior.AllowGet));
        }
Пример #2
0
        public JsonResult ReportStatus(ReportTab Info)
        {
            ResultInfo <string> ResultInfo = new ResultInfo <string>()
            {
                Status      = false,
                Description = "Failed|Login"
            };

            try
            {
                if (Info != null)
                {
                    User_Backend Obj = new User_Backend();
                    ResultInfo.Info = Obj.ChangeReportStatus(Info);
                    if (ResultInfo.Info != null)
                    {
                        ResultInfo.Description = "Success| Report Registered";
                        ResultInfo.Status      = true;
                    }
                }
            }
            catch (Exception ex)
            {
            }
            return(Json(ResultInfo, JsonRequestBehavior.AllowGet));
        }
Пример #3
0
        public JsonResult getReportView(long ID)
        {
            User_Backend bck_end = new User_Backend();
            ReportTab    result  = bck_end.getReportView(ID);

            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Пример #4
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="report"></param>
 /// <param name="view"></param>
 /// <returns></returns>
 public bool UpdateReport(ReportTab report, ReportView view)
 {
     SqlParameter[] para =
     {
         new SqlParameter("@reportname",     SqlDbType.VarChar,    200),
         new SqlParameter("@bigtypeid",      SqlDbType.Int,          4),
         new SqlParameter("@smalltypeid",    SqlDbType.Int,          4),
         new SqlParameter("@price",          SqlDbType.VarChar,    200),
         new SqlParameter("@explain",        SqlDbType.NVarChar,  1000),
         new SqlParameter("@effectivedata",  SqlDbType.VarChar,     50),
         new SqlParameter("@invaliddata",    SqlDbType.VarChar,     50),
         new SqlParameter("@charges",        SqlDbType.Int,          4),
         new SqlParameter("@createdate",     SqlDbType.DateTime),
         new SqlParameter("@FormID",         SqlDbType.Int,          4),
         new SqlParameter("@Html",           SqlDbType.VarChar,    200),
         new SqlParameter("@auditid",        SqlDbType.Int,          4),
         new SqlParameter("@recommendID",    SqlDbType.Int,          4),
         new SqlParameter("@paytype",        SqlDbType.VarChar,    200),
         new SqlParameter("@Chartcount",     SqlDbType.Int,          4),
         new SqlParameter("@pagecount",      SqlDbType.Int,          4),
         new SqlParameter("@writing",        SqlDbType.VarChar,    200),
         new SqlParameter("@Publishingdate", SqlDbType.VarChar,     50),
         new SqlParameter("@message",        SqlDbType.NText),
         new SqlParameter("@Title",          SqlDbType.VarChar,    100),
         new SqlParameter("@keywords",       SqlDbType.VarChar,    100),
         new SqlParameter("@description",    SqlDbType.VarChar,    200),
         new SqlParameter("@OverTime",       SqlDbType.NVarChar,   150),
         new SqlParameter("@clickId",        SqlDbType.Int,          4),
         new SqlParameter("@flag",           SqlDbType.VarChar,     50),
         new SqlParameter("@IdEntity",       SqlDbType.Int, 4)
     };
     para[0].Value  = report.Reportname;
     para[1].Value  = report.Bigtypeid;
     para[2].Value  = report.Smalltypeid;
     para[3].Value  = report.Price;
     para[4].Value  = report.Explain;
     para[5].Value  = report.Effectivedata;
     para[6].Value  = report.Invaliddata;
     para[7].Value  = report.Charges;
     para[8].Value  = report.Createdate;
     para[9].Value  = report.FormID;
     para[10].Value = report.Html;
     para[11].Value = report.Auditid;
     para[12].Value = report.RecommendID;
     para[13].Value = view.Paytype;
     para[14].Value = view.Chartcount;
     para[15].Value = view.Pagecount;
     para[16].Value = view.Writing;
     para[17].Value = view.Publishingdate;
     para[18].Value = view.Message;
     para[19].Value = view.Title;
     para[20].Value = view.Keywords;
     para[21].Value = view.Description;
     para[22].Value = report.OverTime;
     para[23].Value = report.ClickId;
     para[24].Value = "UpdateManage";
     para[25].Value = report.ReportID;
     return(DBHelper.RunProcLob("ReportTab_insert", para));
 }
Пример #5
0
    private void DeleteLoansInfoTab(int Id)
    {
        ReportTab reporttab = reporttabbll.GetModel(Id);

        if (reporttab.Html != "")
        {
            string[] html = reporttab.Html.Split('/');//Professional/201103/Professional20110321_7.shtml
            string[] cc   = html[2].Split('.');
            com.DeleteFile(@PsStatic + html[1].ToString() + @"\" + html[2].ToString());
        }
        if (reportviewbll.DeletereportView(Id) > 0)
        {
            if (reporttabbll.DeletereportTab(Id) > 0)
            {
                Response.Write("<script>alert('删除成功');location.href='reportList.aspx'</script>");
            }
            else
            {
                Response.Write("<script>alert('删除失败');location.href='reportList.aspx'</script>");
            }
        }
        BindShow();
    }
Пример #6
0
        private void CreateReportTab(bool fromDB = false)
        {
            if (myReportFormData != null)
            {
                reportData = new ReportTab(this, myReportFormData);
            }
            else
            {
                myReportFormData = new ReportFormData();
                myReportFormData.Init();
                reportData = new ReportTab(this, myReportFormData);
            }

            if (!fromDB)
            {
                tp_Report = reportData.CreateTabPage();
            }
            else
            {
                tp_Report = reportData.CreateTabPage(fromDB);
            }

            tabControl1.TabPages.Add(tp_Report);
        }
Пример #7
0
        private void stateConfigure(Machine Machine, DataManager D)
        {
            var w  = Machine.SetTriggerParameters <Entities.Cluster>(ViewTrigger.ShowReports);
            var w1 = Machine.SetTriggerParameters <string>(ViewTrigger.ImageView);

            Machine.Configure(ViewState.Start).OnExit(() => { wellcome.Close(); D.labelDataAsync(GlobFuncs.getConfig("serviceMap"), GlobFuncs.getConfig("token")); });
            Machine.Configure(ViewState.ClusterList).OnEntry(() => { var t = new ListOfCluster(); t.DataContext = D.List; leftTab = t; });
            Machine.Configure(ViewState.ClusterMap).OnEntry(() => { var t = new ReportsInMap(); t.DataContext2 = D.Point; leftTab = t; });
            Machine.Configure(ViewState.ClusterTabs).OnEntry(() => { var t = new ClusterTab(Machine, w); t.DataContext = D.List; leftTab = t; });
            Machine.Configure(ViewState.ClusterCombina).OnEntry(() => { var t = new ReportsInMap(); t.DataContext2 = D.Point; var t2 = new ListOfCluster(); t2.DataContext = D.List; leftTab = t; rightTab = t2; });
            Machine.Configure(ViewState.AnalizeData).OnEntry(() => { var t = new Analysis(D); leftTab = t; var t2 = new linarChart(D); rightTab = t2; });
            Machine.Configure(ViewState.NewReport).OnEntry(() => { AutoComplitTreament(Machine, D); });
            //Machine.Configure(ViewState.ReportList).OnEntryFrom<Entities.Cluster>(w, (C) => { listOfReports t = new listOfReports(); corentCluster = C; t.DataContext = C; rightTab = t; });
            Machine.Configure(ViewState.ReportTabs).OnEntryFrom <Entities.Cluster>(w, (C) => { ReportTab t = new ReportTab(w1, Machine, corentCluster); rightTab = t; corentCluster = C; t.DataContext = C; });
            Machine.Configure(ViewState.ReportTabs).OnEntryFrom <string>(w1, (C) => { ImageView t = new ImageView(); t.DataContext = C; t.Show(); });
            Machine.Configure(ViewState.ReportMap).OnEntry(() => { ReportsInMap t = new ReportsInMap(); t.DataContext2 = corentCluster.ToList(); rightTab = t; });
            Machine.Configure(ViewState.ReportTabs).OnEntry(() => { ReportTab t = new ReportTab(w1, Machine, corentCluster); rightTab = t; });
            Machine.Configure(ViewState.ReportList).OnEntry(() => { listOfReports t = new listOfReports(); t.DataContext = corentCluster; rightTab = t; });
            Machine.Configure(ViewState.AllReports).OnEntry(() =>
            {
                listOfReports t = new listOfReports(); getAllReports(D); t.DataContext = corentCluster; rightTab = t;
                ReportsInMap t2 = new ReportsInMap(); t2.DataContext2 = corentCluster.ToList(); leftTab = t2;
            });
        }
Пример #8
0
 //生成
 protected void btnpublic_Click(object sender, EventArgs e)
 {
     string[] values = Request.Form.GetValues("cbxSelect");
     if (values == null || values.Length < 1)
     {
         Tz888.Common.MessageBox.Show(this.Page, "请选择要静态化的资源!");
         return;
     }
     else
     {
         int           result = 0;
         StringBuilder sb     = new StringBuilder();
         foreach (string str in values)
         {
             report = reporttabbll.GetModel(int.Parse(str.ToString().Trim()));
             if (report.Auditid == 1)
             {
                 PageStatic stat = new PageStatic();
                 result = stat.StaticHtml(int.Parse(str.ToString().Trim()));
                 if (result <= 0)
                 {
                     Tz888.Common.MessageBox.Show(this.Page, "生成静态页面失败");
                 }
             }
         }
         if (result > 0)
         {
             Tz888.Common.MessageBox.Show(this.Page, "生成成功");
         }
         else
         {
             Tz888.Common.MessageBox.Show(this.Page, "生成失败");
         }
         BindShow();
     }
 }
Пример #9
0
    private void bindModel(string orderNo)
    {
        orReport        = OrRBll.GetModel(orderNo);
        orLink          = orlinkBll.GetModel(orderNo);
        orMain          = maBll.GetModel(orderNo);
        repModel        = Bll.GetModel(orReport.reportID);
        txtCompany.Text = orReport.Company.Trim();
        txtAddress.Text = orReport.address.Trim();
        txtLinkMan.Text = orReport.LinkName.Trim();
        txtFax.Text     = orReport.fax.Trim();
        txtMeo.Text     = orReport.Note.Trim();
        txtPostion.Text = orReport.position.Trim();
        txtAmount.Text  = orMain.amount.ToString();
        txtNum.Text     = orMain.num.ToString();
        txtPayMent.Text = orMain.payMent.Trim();
        txtOrderNo.Text = orMain.orderNo;
        txtPrice.Text   = orReport.reportPrice;
        txtName.Text    = repModel.Reportname;
        switch (orMain.state)
        {
        case 0:
            rdoNo.Checked = true;
            break;

        case 1:
            rdoYes.Checked = true;
            break;

        case 2:
            rdoWeiCL.Checked = true;
            break;

        default:
            break;
        }
        if (orMain.paySate == 0)
        {
            rdoNoPay.Checked = true;
        }
        else
        {
            rdoPay.Checked = true;
        }
        txtEmail.Text = orLink.email.Trim();
        txtPhone.Text = orLink.phone.Trim();
        string tel = orLink.tel;

        if (!string.IsNullOrEmpty(tel))
        {
            string[] telLen = tel.Split(',');
            if (telLen.Length == 1)
            {
                txtTel.Text = orLink.tel;
            }
            else
            {
                txtcontactsTel.Text = telLen[0].ToString();
                txtTel.Text         = telLen[1].ToString();
                txttel2.Text        = telLen[2].ToString();
            }
        }
    }
Пример #10
0
    private void bindModel(int id)
    {
        maModel          = maBll.GetModel(id);
        txtOverTime.Text = maModel.OverTime.ToString();
        viewModel        = viewBll.GetModel(id);
        txtName.Text     = maModel.Reportname;
        txtWtitle.Text   = viewModel.Title;
        txtKeyword1.Text = viewModel.Keywords;
        if (maModel.FormID > 0)
        {
            ddrFrom.SelectedValue = maModel.FormID.ToString();
        }
        txtWebDesr.Text        = viewModel.Description;
        ddlbig.SelectedValue   = maModel.Bigtypeid.ToString();
        ddlSmall.SelectedValue = maModel.Smalltypeid.ToString();
        if (!string.IsNullOrEmpty(maModel.Effectivedata.ToString()))
        {
            if (int.Parse(maModel.Effectivedata.ToString()) < 2005)
            {
                ddlbegin.SelectedIndex = 0;
            }
            else
            {
                ddlbegin.SelectedValue = maModel.Effectivedata;
            }
        }
        if (!string.IsNullOrEmpty(maModel.Invaliddata.ToString()))
        {
            if (int.Parse(maModel.Invaliddata.ToString()) < 2005)
            {
                ddlend.SelectedIndex = 0;
            }
            else
            {
                ddlend.SelectedValue = maModel.Invaliddata;
            }
        }

        txtPay.Text = viewModel.Paytype;

        if (maModel.Charges == 0)
        {
            rdomian.Checked = true;//是否收费 0不收费  1 收费
            spShowPoint.Attributes.Add("style", "display:none");
        }
        else
        {
            rdoShou.Checked = true;
            spShowPoint.Attributes.Add("style", "display:''");
        }
        if (maModel.Charges == 1)
        {
            if (!string.IsNullOrEmpty(maModel.Price.ToString()))
            {
                string[] str = maModel.Price.Split(new char[] { '|' });//1:123|2:123|3:123|4:123|
                for (int i = 0; i < str.Length - 1; i++)
                {
                    string[] strchild = str[i].ToString().Split(new char[] { ':' });
                    for (int j = 0; j < strchild.Length - 1; j++)
                    {
                        if (!string.IsNullOrEmpty(strchild[j].ToString()))
                        {
                            switch (strchild[j].ToString())
                            {
                            case "1":
                                txtDian.Text    = strchild[j + 1].ToString();
                                rdoDian.Checked = true;
                                break;

                            case "2":
                                txtying.Text    = strchild[j + 1].ToString();
                                rdoying.Checked = true;
                                break;

                            case "3":
                                txtDianying.Text    = strchild[j + 1].ToString();
                                rdoDianying.Checked = true;
                                break;

                            case "4":
                                txtYinguang.Text    = strchild[j + 1].ToString();
                                rdoYinguang.Checked = true;
                                break;

                            default:
                                break;
                            }
                        }
                    }
                }
            }
        }

        txtPhotoCount.Text = viewModel.Chartcount.ToString();
        txtYeCount.Text    = viewModel.Pagecount.ToString();

        txtWriterCompany.Text = viewModel.Writing; //撰写单位
        txtPublishDate.Text   = viewModel.Publishingdate;
        txtExplain.Text       = maModel.Explain;   //摘要
        txtMessage.Text       = viewModel.Message;
        if (maModel.RecommendID == 0)              //是否推荐0:不1:推荐
        {
            rdoNoAct.Checked = true;
        }
        else
        {
            rdoYesAct.Checked = true;
        }
        if (maModel.Auditid == 1)//审核状态 0未审   1已审
        {
            rdPass.Checked = true;
        }
        else
        {
            rdAudit.Checked = true;
        }
    }
Пример #11
0
    protected void btnAudit_Click(object sender, EventArgs e)
    {
        maModel               = maBll.GetModel(int.Parse(Request.QueryString["id"].ToString()));
        maModel.Reportname    = txtName.Text.Trim();
        viewModel.Title       = txtWtitle.Text.Trim();
        viewModel.Keywords    = txtKeyword1.Text.Trim();
        viewModel.Description = txtWebDesr.Text.Trim();
        maModel.Bigtypeid     = int.Parse(ddlbig.SelectedValue.ToString());
        maModel.Smalltypeid   = int.Parse(ddlSmall.SelectedValue.ToString());
        maModel.Effectivedata = ddlbegin.SelectedValue.ToString();
        maModel.Invaliddata   = ddlend.SelectedValue.Trim().ToString();
        maModel.FormID        = int.Parse(ddrFrom.SelectedValue.ToString());
        //if (!string.IsNullOrEmpty(Request.QueryString["id"]))//修改
        //{
        //    maModel.ReportID = int.Parse(Request.QueryString["id"].ToString());
        //}
        if (rdomian.Checked)
        {
            maModel.Charges = 0;//是否收费 0不收费  1 收费
        }
        else
        {
            maModel.Charges = 1;
        }
        string prices = string.Empty;

        if (rdoShou.Checked)
        {
            if (rdoDian.Checked)
            {
                string dain = string.Empty;
                if (string.IsNullOrEmpty(txtDian.Text.Trim()))
                {
                    dain = "0";
                }
                else
                {
                    dain = txtDian.Text.Trim();
                }
                //prices = rdoDian.Text + ":" + dain + "|";
                prices = "1" + ":" + dain + "|";
            }
            else
            {
                prices += ":|";
            }
            if (rdoying.Checked)
            {
                string dain = string.Empty;
                if (string.IsNullOrEmpty(txtying.Text.Trim()))
                {
                    dain = "0";
                }
                else
                {
                    dain = txtying.Text.Trim();
                }
                //prices += rdoying.Text + ":" + dain + "|";
                prices += "2" + ":" + dain + "|";
            }
            else
            {
                prices += ":|";
            }
            if (rdoDianying.Checked)
            {
                string dain = string.Empty;
                if (string.IsNullOrEmpty(txtDianying.Text.Trim()))
                {
                    dain = "0";
                }
                else
                {
                    dain = txtDianying.Text.Trim();
                }
                //prices += rdoDianying.Text + ":" + dain + "|";
                prices += "3" + ":" + dain + "|";
            }
            else
            {
                prices += ":|";
            }
            if (rdoYinguang.Checked)
            {
                string dain = string.Empty;
                if (string.IsNullOrEmpty(txtYinguang.Text.Trim()))
                {
                    dain = "0";
                }
                else
                {
                    dain = txtYinguang.Text.Trim();
                }
                //prices += rdoYinguang.Text + ":" + dain + "|";
                prices += "4" + ":" + dain + "|";
            }
            else
            {
                prices += ":|";
            }
        }
        else
        {
            maModel.Price = "";
        }
        maModel.Price     = prices;
        maModel.OverTime  = txtOverTime.Text.Trim();
        viewModel.Paytype = txtPay.Text.Trim();
        if (!string.IsNullOrEmpty(txtPhotoCount.Text.Trim()))
        {
            viewModel.Chartcount = int.Parse(txtPhotoCount.Text.Trim().ToString());
        }
        else
        {
            viewModel.Chartcount = 0;
        }
        if (!string.IsNullOrEmpty(txtYeCount.Text.Trim()))
        {
            viewModel.Pagecount = int.Parse(txtYeCount.Text.Trim().ToString());
        }
        else
        {
            viewModel.Pagecount = 0;
        }
        viewModel.Writing        = txtWriterCompany.Text.Trim(); //撰写单位
        viewModel.Publishingdate = txtPublishDate.Text.Trim();
        maModel.Explain          = txtExplain.Text.Trim();       //摘要
        if (string.IsNullOrEmpty(maModel.Html))
        {
            maModel.Html = "htmlLink/" + DateTime.Now.ToString("yyyyMM") + "/" + DateTime.Now.ToString("yyyyMMdd") + int.Parse(Request.QueryString["id"].ToString()) + ".shtml";
        }
        viewModel.Message = txtMessage.Text.Trim();
        if (rdoNoAct.Checked)//是否推荐0:不1:推荐
        {
            maModel.RecommendID = 0;
        }
        else
        {
            maModel.RecommendID = 1;
        }
        if (rdPass.Checked)//审核状态 0未审   1已审
        {
            maModel.Auditid = 1;
        }
        else
        {
            maModel.Auditid = 0;
        }
        if (!viewBll.UpdateReport(maModel, viewModel))
        {
            Response.Write("<script>alert('审核失败!');document.location='reportList.aspx'</script>");
        }
        else
        {
            if (rdPass.Checked)
            {
                PageStatic stat   = new PageStatic();
                int        result = stat.StaticHtml(int.Parse(Request.QueryString["id"].ToString()));
                if (result <= 0)
                {
                    Tz888.Common.MessageBox.Show(this.Page, "生成静态页面失败");
                }
            }
            Response.Write("<script>alert('修改成功!');document.location='reportList.aspx'</script>");
        }
    }
Пример #12
0
        string CasesTem       = ConfigurationManager.AppSettings["INTem"].ToString();     //其成功案例模版存放位置

        /// <summary>
        ///创建贷款静态页面
        /// </summary>
        public int StaticHtml(int id)
        {
            try
            {
                maModel   = maBll.GetModel(id);
                viewModel = viewBll.GetModel(id);
                string TempFileName = CasesTem.ToString();
                string Tem          = Compage.Reader(TempFileName); //读取模板内容
                string TempSoure    = Tem;
                bool   flags        = false;
                string price        = string.Empty;
                if (maModel.Charges == 1)//收费
                {
                    if (!string.IsNullOrEmpty(maModel.Price.ToString()) || maModel.Price.ToString().Equals("0"))
                    {
                        string[] str = maModel.Price.Split(new char[] { '|' });
                        for (int i = 0; i < str.Length - 1; i++)
                        {
                            string[] strchild = str[i].ToString().Split(new char[] { ':' });
                            for (int j = 0; j < strchild.Length - 1; j++)
                            {
                                if ((!string.IsNullOrEmpty(strchild[j].ToString())) && (!string.IsNullOrEmpty(strchild[j + 1].ToString())))
                                {
                                    switch (strchild[j].ToString())
                                    {
                                    case "1":
                                        price = "电子版:<font color='red' size='2'>¥" + strchild[j + 1].ToString() + "</font>;&nbsp;";
                                        flags = true;
                                        break;

                                    case "2":
                                        price += "印刷版:<font color='red' size='2'>¥" + strchild[j + 1].ToString() + "</font>;&nbsp;";
                                        flags  = true;
                                        break;

                                    case "3":
                                        price += "电子+印刷版:<font color='red' size='2'>¥" + strchild[j + 1].ToString() + "</font>;&nbsp;";
                                        flags  = true;
                                        break;

                                    case "4":
                                        price += "印刷+光碟/电子版:<font color='red' size='2'>¥" + strchild[j + 1].ToString() + "</font>;&nbsp;";
                                        flags  = true;
                                        break;

                                    default:
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
                if (!flags)
                {
                    TempSoure = TempSoure.Replace("$goumais$", "");
                    price     = "免费";
                }
                else
                {
                    TempSoure = TempSoure.Replace("$goumais$", "<li class=\"goumai\"><a href='http://sr.topfo.com/Order/Buy.aspx?reportId=" + maModel.ReportID.ToString() + "'><img src='http://sr.topfo.com/Report/img_hy/zxgm.jpg' /></a></li>");
                }
                string strName = GetSmallByName(maModel.Smalltypeid);
                TempSoure = TempSoure.Replace("$ProfessionalID$", maModel.ReportID.ToString().Trim());
                TempSoure = TempSoure.Replace("$reportname$", maModel.Reportname.ToString());
                if (string.IsNullOrEmpty(maModel.Explain.ToString()))
                {
                    TempSoure = TempSoure.Replace("$explain$", "");
                }
                else
                {
                    TempSoure = TempSoure.Replace("$explain$", "<br /><div class=\"zhuyao\">" + maModel.Explain.ToString() + "</div>");
                }
                TempSoure = TempSoure.Replace("$price$", price);
                TempSoure = TempSoure.Replace("$InType$", TypeByid(int.Parse(maModel.Bigtypeid.ToString())));
                if (string.IsNullOrEmpty(viewModel.Paytype.ToString()))
                {
                    TempSoure = TempSoure.Replace("$payType$", "");
                }
                else
                {
                    TempSoure = TempSoure.Replace("$payType$", "<li><strong>【交付方式】:</strong><span>" + viewModel.Paytype.ToString() + "</span></li>");
                }
                TempSoure = TempSoure.Replace("$Reportmessage$", strName);
                if (string.IsNullOrEmpty(viewModel.Pagecount.ToString()) || viewModel.Pagecount == 0)
                {
                    TempSoure = TempSoure.Replace("$pagecount$", "");
                }
                else
                {
                    TempSoure = TempSoure.Replace("$pagecount$", "<li><strong>【报告页码】:</strong><span>" + viewModel.Pagecount.ToString().Trim() + "</span></li>");
                }
                if (string.IsNullOrEmpty(viewModel.Chartcount.ToString()) || viewModel.Chartcount == 0)
                {
                    TempSoure = TempSoure.Replace("$chartCount$", "");
                }
                else
                {
                    TempSoure = TempSoure.Replace("$chartCount$", "<li><strong>【图表数量】:</strong><span>" + viewModel.Chartcount.ToString().Trim() + "</span></li>");
                }

                if (string.IsNullOrEmpty(maModel.Effectivedata.ToString().Trim()))
                {
                    TempSoure = TempSoure.Replace("$beginEnd$", "");
                }
                else
                {
                    TempSoure = TempSoure.Replace("$beginEnd$", "<li><strong>【有效期】:</strong><span>" + maModel.Effectivedata.ToString().Trim() + "年—" + maModel.Invaliddata.ToString() + "年</span></li>");
                }
                if (string.IsNullOrEmpty(viewModel.Publishingdate.ToString()))
                {
                    TempSoure = TempSoure.Replace("$publishTime$", "");//创建时间
                }
                else
                {
                    TempSoure = TempSoure.Replace("$publishTime$", "更新时间:" + viewModel.Publishingdate.ToString());//创建时间
                }

                TempSoure = TempSoure.Replace("$KeyWord$", viewModel.Keywords.ToString().Trim());
                TempSoure = TempSoure.Replace("$DisplayTitle$", viewModel.Description.ToString().Trim());
                if (string.IsNullOrEmpty(maModel.OverTime.ToString()))
                {
                    TempSoure = TempSoure.Replace("$OverTime$", "");
                }
                else
                {
                    TempSoure = TempSoure.Replace("$OverTime$", "<li><strong>【交付时间】:</strong><span>" + maModel.OverTime.ToString().Trim() + "</span></li>");
                }
                TempSoure = TempSoure.Replace("$message$", viewModel.Message.ToString().Trim());

                //string inPathTo = "/report";
                if (string.IsNullOrEmpty(maModel.Html))
                {
                    maModel.Html = "htmlLink/" + DateTime.Now.ToString("yyyyMM") + "/" + DateTime.Now.ToString("yyyyMMdd") + id + ".shtml";
                }
                string   htmlFile = maModel.Html.ToString().Trim();//report/201104/201104087.shtml
                string[] html     = htmlFile.Split('/');

                string folder = ReportPath + html[1].Replace("report", "");
                if (!Directory.Exists(folder))
                {
                    Directory.CreateDirectory(folder);
                }
                string htmlpaths = folder + "/" + html[2];
                Compage.Writer(htmlpaths, TempSoure);
                return(1);
            }
            catch (Exception)
            {
                return(0);
            }
        }
Пример #13
0
        //Tz888.SQLServerDAL.report.reportTabDAL reporttabdal = new reportTabDAL();
        /// <summary>
        /// 向两个表中插入数据
        /// </summary>
        /// <param name="report"></param>
        /// <param name="view"></param>
        /// <returns></returns>
        public int InsertReport(ReportTab report, ReportView view)
        {
            int identity = 0;

            SqlParameter[] para =
            {
                new SqlParameter("@reportname",     SqlDbType.VarChar,    200),
                new SqlParameter("@bigtypeid",      SqlDbType.Int,          4),
                new SqlParameter("@smalltypeid",    SqlDbType.Int,          4),
                new SqlParameter("@price",          SqlDbType.VarChar,    200),
                new SqlParameter("@explain",        SqlDbType.NVarChar,  1000),
                new SqlParameter("@effectivedata",  SqlDbType.VarChar,     50),
                new SqlParameter("@invaliddata",    SqlDbType.VarChar,     50),
                new SqlParameter("@charges",        SqlDbType.Int,          4),
                new SqlParameter("@createdate",     SqlDbType.DateTime),
                new SqlParameter("@FormID",         SqlDbType.Int,          4),
                new SqlParameter("@Html",           SqlDbType.VarChar,    200),
                new SqlParameter("@auditid",        SqlDbType.Int,          4),
                new SqlParameter("@recommendID",    SqlDbType.Int,          4),
                new SqlParameter("@paytype",        SqlDbType.VarChar,    200),
                new SqlParameter("@Chartcount",     SqlDbType.Int,          4),
                new SqlParameter("@pagecount",      SqlDbType.Int,          4),
                new SqlParameter("@writing",        SqlDbType.VarChar,    200),
                new SqlParameter("@Publishingdate", SqlDbType.VarChar,     50),
                new SqlParameter("@message",        SqlDbType.NText),
                new SqlParameter("@Title",          SqlDbType.VarChar,    100),
                new SqlParameter("@keywords",       SqlDbType.VarChar,    100),
                new SqlParameter("@description",    SqlDbType.VarChar,    200),
                new SqlParameter("@OverTime",       SqlDbType.NVarChar,   150),
                new SqlParameter("@entityId",       SqlDbType.Int, 4)
            };
            para[0].Value      = report.Reportname;
            para[1].Value      = report.Bigtypeid;
            para[2].Value      = report.Smalltypeid;
            para[3].Value      = report.Price;
            para[4].Value      = report.Explain;
            para[5].Value      = report.Effectivedata;
            para[6].Value      = report.Invaliddata;
            para[7].Value      = report.Charges;
            para[8].Value      = report.Createdate;
            para[9].Value      = report.FormID;
            para[10].Value     = report.Html;
            para[11].Value     = report.Auditid;
            para[12].Value     = report.RecommendID;
            para[13].Value     = view.Paytype;
            para[14].Value     = view.Chartcount;
            para[15].Value     = view.Pagecount;
            para[16].Value     = view.Writing;
            para[17].Value     = view.Publishingdate;
            para[18].Value     = view.Message;
            para[19].Value     = view.Title;
            para[20].Value     = view.Keywords;
            para[21].Value     = view.Description;
            para[22].Value     = report.OverTime;
            para[23].Direction = ParameterDirection.Output;
            if (DBHelper.RunProcLob("ReportTab_insert", para))
            {
                if (para[23].Value != null)
                {
                    identity = Convert.ToInt32(para[23].Value);
                }
                else
                {
                    identity = 0;
                }
            }
            return(identity);
        }
Пример #14
0
 /// <summary>
 /// 向两个表中插入数据
 /// </summary>
 /// <param name="report"></param>
 /// <param name="view"></param>
 /// <returns></returns>
 public int InsertReport(ReportTab report, ReportView view)
 {
     return(dal.InsertReport(report, view));
 }
Пример #15
0
 /// <summary>
 /// 更新一条数据
 /// </summary>
 /// <param name="report"></param>
 /// <param name="view"></param>
 /// <returns></returns>
 public bool UpdateReport(ReportTab report, ReportView view)
 {
     return(dal.UpdateReport(report, view));
 }
Пример #16
0
        public ReportTab GetModel(int reportID)
        {
            StringBuilder strSql = new StringBuilder();

            strSql.Append("select  top 1 reportID,reportname,bigtypeid,smalltypeid,price,explain,OverTime,effectivedata,invaliddata,charges,clickId,createdate,FormID,html,auditid,recommendID from reportTab ");
            strSql.Append(" where reportID=@reportID");
            SqlParameter[] parameters =
            {
                new SqlParameter("@reportID", SqlDbType.Int, 4)
            };
            parameters[0].Value = reportID;

            ReportTab model = new ReportTab();
            DataSet   ds    = DBHelper.Query(strSql.ToString(), parameters);

            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["reportID"].ToString() != "")
                {
                    model.ReportID = int.Parse(ds.Tables[0].Rows[0]["reportID"].ToString());
                }
                model.Reportname = ds.Tables[0].Rows[0]["reportname"].ToString();
                if (ds.Tables[0].Rows[0]["bigtypeid"].ToString() != "")
                {
                    model.Bigtypeid = int.Parse(ds.Tables[0].Rows[0]["bigtypeid"].ToString());
                }
                if (ds.Tables[0].Rows[0]["smalltypeid"].ToString() != "")
                {
                    model.Smalltypeid = int.Parse(ds.Tables[0].Rows[0]["smalltypeid"].ToString());
                }
                if (ds.Tables[0].Rows[0]["OverTime"].ToString() != "")
                {
                    model.OverTime = ds.Tables[0].Rows[0]["OverTime"].ToString();
                }
                else
                {
                    model.OverTime = "";
                }
                model.Price         = ds.Tables[0].Rows[0]["price"].ToString();
                model.Explain       = ds.Tables[0].Rows[0]["explain"].ToString();
                model.Effectivedata = ds.Tables[0].Rows[0]["effectivedata"].ToString();
                model.Invaliddata   = ds.Tables[0].Rows[0]["invaliddata"].ToString();
                if (ds.Tables[0].Rows[0]["charges"].ToString() != "")
                {
                    model.Charges = int.Parse(ds.Tables[0].Rows[0]["charges"].ToString());
                }
                if (ds.Tables[0].Rows[0]["createdate"].ToString() != "")
                {
                    model.Createdate = ds.Tables[0].Rows[0]["createdate"].ToString();
                }
                if (ds.Tables[0].Rows[0]["FormID"].ToString() != "")
                {
                    model.FormID = int.Parse(ds.Tables[0].Rows[0]["FormID"].ToString());
                }
                model.Html = ds.Tables[0].Rows[0]["html"].ToString();
                if (ds.Tables[0].Rows[0]["auditid"].ToString() != "")
                {
                    model.Auditid = int.Parse(ds.Tables[0].Rows[0]["auditid"].ToString());
                }
                if (ds.Tables[0].Rows[0]["clickId"].ToString() != "")
                {
                    model.ClickId = int.Parse(ds.Tables[0].Rows[0]["clickId"].ToString());
                }
                if (ds.Tables[0].Rows[0]["recommendID"].ToString() != "")
                {
                    model.RecommendID = int.Parse(ds.Tables[0].Rows[0]["recommendID"].ToString());
                }
                return(model);
            }
            else
            {
                return(null);
            }
        }