Esempio n. 1
0
 private static void GetDownloadErrorParameters(DownloadErrorInfo downloadErrorInfo, Parameters parms)
 {
     parms.AddInParameter("@ErrorID", DbType.Int32, downloadErrorInfo.ErrorId);
     parms.AddInParameter("@InfoID", DbType.Int32, downloadErrorInfo.InfoId);
     parms.AddInParameter("@ErrorUrl", DbType.String, downloadErrorInfo.ErrorUrl);
     parms.AddInParameter("@ErrorTimes", DbType.Int32, downloadErrorInfo.ErrorTimes);
     parms.AddInParameter("@ErrorDate", DbType.DateTime, downloadErrorInfo.ErrorDate);
 }
Esempio n. 2
0
        public bool Add(DownloadErrorInfo downloadErrorInfo)
        {
            Parameters parms = new Parameters();

            downloadErrorInfo.ErrorId = DBHelper.GetMaxId("PE_DownloadError", "ErrorID") + 1;
            GetDownloadErrorParameters(downloadErrorInfo, parms);
            return(DBHelper.ExecuteProc("PR_Accessories_DownloadError_Add", parms));
        }
Esempio n. 3
0
        private static DownloadErrorInfo DownloadErrorInfoFromrdr(NullableDataReader rdr)
        {
            DownloadErrorInfo info = new DownloadErrorInfo();

            info.ErrorId    = rdr.GetInt32("ErrorID");
            info.InfoId     = rdr.GetInt32("InfoID");
            info.ErrorUrl   = rdr.GetString("ErrorUrl");
            info.ErrorTimes = rdr.GetInt32("ErrorTimes");
            info.ErrorDate  = rdr.GetDateTime("ErrorDate");
            return(info);
        }
Esempio n. 4
0
        public static bool Add(DownloadErrorInfo downloadErrorInfo)
        {
            bool flag = false;

            if (downloadErrorInfo.IsNull)
            {
                return(flag);
            }
            if (Exists(downloadErrorInfo.InfoId, downloadErrorInfo.ErrorUrl))
            {
                return(UpdateErrorTimes(downloadErrorInfo.InfoId, downloadErrorInfo.ErrorUrl));
            }
            return(dal.Add(downloadErrorInfo));
        }
        protected void EBtnSubmit_Click(object sender, EventArgs e)
        {
            bool      flag            = true;
            int       num             = BasePage.RequestInt32("type");
            int       generalId       = BasePage.RequestInt32("id");
            DataTable contentDataById = ContentManage.GetContentDataById(generalId);

            if (contentDataById == null)
            {
                DynamicPage.WriteErrMsg("对不起,错误的参数!");
            }
            if (contentDataById.Rows.Count > 0)
            {
                string        str     = contentDataById.Rows[0]["DownloadUrl"].ToString();
                string        str2    = contentDataById.Rows[0]["arrServerName"].ToString();
                StringBuilder builder = new StringBuilder();
                if (this.EgvDownloadError.SelectList.Length == 0)
                {
                    DynamicPage.WriteErrMsg("对不起,您还没选择要报错的信息!");
                }
                for (int i = 0; i < this.EgvDownloadError.Rows.Count; i++)
                {
                    CheckBox box = (CheckBox)this.EgvDownloadError.Rows[i].Cells[this.EgvDownloadError.CheckBoxColumnIndex].FindControl("CheckBoxButton");
                    if (box.Checked)
                    {
                        DownloadErrorInfo downloadErrorInfo = new DownloadErrorInfo();
                        if (num == 1)
                        {
                            if (string.IsNullOrEmpty(str))
                            {
                                downloadErrorInfo.InfoId     = generalId;
                                downloadErrorInfo.ErrorUrl   = new InsideStaticLabel().GetInfoPath(contentDataById.Rows[0]["NodeId"].ToString(), contentDataById.Rows[0]["GeneralId"].ToString(), contentDataById.Rows[0]["InputTime"].ToString(), contentDataById.Rows[0]["Title"].ToString());
                                downloadErrorInfo.ErrorDate  = DateTime.Now;
                                downloadErrorInfo.ErrorTimes = 1;
                            }
                            else if (!string.IsNullOrEmpty(str2))
                            {
                                int serverId = DataConverter.CLng(((HiddenField)this.EgvDownloadError.Rows[i].Cells[1].FindControl("HdnUrlID")).Value);
                                int urlId    = DataConverter.CLng(((HiddenField)this.EgvDownloadError.Rows[i].Cells[1].FindControl("HdnServerID")).Value);
                                downloadErrorInfo.InfoId     = generalId;
                                downloadErrorInfo.ErrorUrl   = DownloadError.GetDownloadurlById(str, urlId, serverId);
                                downloadErrorInfo.ErrorDate  = DateTime.Now;
                                downloadErrorInfo.ErrorTimes = 1;
                            }
                            else
                            {
                                downloadErrorInfo.InfoId     = generalId;
                                downloadErrorInfo.ErrorUrl   = DownloadError.GetDownloadurlById(str, i, 0);
                                downloadErrorInfo.ErrorDate  = DateTime.Now;
                                downloadErrorInfo.ErrorTimes = 1;
                            }
                        }
                        else
                        {
                            downloadErrorInfo.InfoId     = generalId;
                            downloadErrorInfo.ErrorUrl   = new InsideStaticLabel().GetInfoPath(contentDataById.Rows[0]["NodeId"].ToString(), contentDataById.Rows[0]["GeneralId"].ToString(), contentDataById.Rows[0]["InputTime"].ToString(), contentDataById.Rows[0]["Title"].ToString());
                            downloadErrorInfo.ErrorDate  = DateTime.Now;
                            downloadErrorInfo.ErrorTimes = 1;
                        }
                        if (!DownloadError.Add(downloadErrorInfo))
                        {
                            flag = false;
                        }
                    }
                }
                if (flag)
                {
                    DynamicPage.WriteSuccessMsg("感谢您的参与,提交成功!", SiteConfig.SiteInfo.VirtualPath + "Category_" + contentDataById.Rows[0]["NodeId"].ToString() + "/index.aspx");
                }
                else
                {
                    DynamicPage.WriteErrMsg("对不起,提交失败!");
                }
            }
            else
            {
                DynamicPage.WriteErrMsg("对不起,错误的参数!");
            }
        }