private void setInfo()
 {
     if (id > 0)
     {
         using (BLLDownLoad bll = new BLLDownLoad())
         {
             DownLoad dwinfor = bll.GetSingle(id);
             if (dwinfor != null)
             {
                 if (dwinfor.IsEnglish == 1)
                 {
                     rbtnIsChinese.Checked = true;
                 }
                 else if (dwinfor.IsEnglish == 2)
                 {
                     rbtnIsEnglish.Checked = true;
                 }
                 txtDLName.Text    = dwinfor.DLName;
                 txtRemarks.Text   = dwinfor.Remarks;
                 lblDLAddress.Text = dwinfor.DLAddress;
             }
         }
     }
 }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            using (BLLDownLoad bll = new BLLDownLoad())
            {
                DownLoad obj = new DownLoad();

                if (id > 0)
                {
                    obj    = bll.GetSingle(id);
                    obj.ID = id;
                }
                obj.DLName    = txtDLName.Text.Trim().ToString();
                obj.DLAddTime = Convert.ToDateTime(DateTime.Now.ToShortDateString());
                obj.Remarks   = txtRemarks.Text.ToString();
                if (Session["admin"] != null)
                {
                    AdminUser adminuser = GetAdminUser();
                    if (adminuser != null)
                    {
                        obj.DLAddName = adminuser.TrueName.ToString();
                    }
                }

                if (rbtnIsChinese.Checked == true)
                {
                    obj.IsEnglish = 1;
                }
                else if (rbtnIsEnglish.Checked == true)
                {
                    obj.IsEnglish = 2;
                }
                else
                {
                    ShowMsg("请选择语言类别!");
                    return;
                }


                #region   产品图片(前台产品图片来源于此)
                try
                {
                    if (this.UploadDLAddress.HasFile)
                    {
                        string extName = Path.GetExtension(UploadDLAddress.FileName);
                        string virFileFullName;
                        string fileName;
                        WebCommon.GetUploadRandFileName(extName, out virFileFullName, out fileName);
                        if (UploadDLAddress.PostedFile.ContentLength < 5000000)//文件小于5M
                        {
                            UploadDLAddress.SaveAs(StringPlus.MapPath(virFileFullName));
                        }
                        else
                        {
                            ShowMsg("文件大小不能超过5M!");
                            return;
                        }
                        if (IsAllowedExtension(StringPlus.MapPath(virFileFullName)))
                        {
                            if (id > 0)
                            {//新增时无需删除
                                if (File.Exists(StringPlus.MapPath(bll.GetSingle(id).DLAddress)))
                                {
                                    File.Delete(StringPlus.MapPath(bll.GetSingle(id).DLAddress));
                                }
                            }
                            obj.DLAddress = virFileFullName;
                        }
                        else
                        {
                            if (File.Exists(StringPlus.MapPath(virFileFullName)))
                            {
                                File.Delete(StringPlus.MapPath(virFileFullName));
                            }
                            ShowMsg("此文件类型不可以上传");
                            return;
                        }
                    }
                    else
                    {
                        obj.DLAddress = lblDLAddress.Text;
                    }
                }
                catch (DevNetException ex)
                {
                    ExceptionManager.ShowErrorMsg(this, ex);
                    return;
                }
                #endregion

                bll.Save(obj);

                if (bll.IsFail)
                {
                    ExceptionManager.ShowErrorMsg(this, bll.DevNetException);
                }
                else
                {
                    JSMsg.ShowWinRedirect(this, "保存成功", "cpDownLoadList.aspx");
                }
            }
        }