Beispiel #1
0
 /// <summary>
 /// 从DataReader中读取专题类别信息
 /// </summary>
 /// <param name="rdr">DataReader</param>
 /// <returns></returns>
 private static M_SpecCate GetInfoFromReader(SqlDataReader rdr)
 {
     M_SpecCate info = new M_SpecCate();
     info.SpecCateID = DataConverter.CLng(rdr["SpecCateID"]);
     info.SpecCateName = rdr["SpecCateName"].ToString();
     info.SpecCateDir = rdr["SpecCateDir"].ToString();
     info.SpecCateDesc = rdr["SpecCateDesc"].ToString();
     info.OpenNew = DataConverter.CBool(rdr["OpenType"].ToString());
     info.FileExt = DataConverter.CLng(rdr["FileExt"]);
     info.ListTemplate = rdr["ListTemplate"].ToString();
     return info;
 }
Beispiel #2
0
 protected void EBtnSubmit_Click(object sender, EventArgs e)
 {
     if (this.Page.IsValid)
     {
         M_SpecCate info = new M_SpecCate();
         info.SpecCateID = DataConverter.CLng(this.HdnSpecCateID.Value);
         info.SpecCateName = this.TxtSpecCateName.Text;
         info.SpecCateDir = this.TxtSpecCateDir.Text;
         info.SpecCateDesc = this.TxtSpecCateDesc.Text;
         info.OpenNew = DataConverter.CBool(this.RBLOpenType.SelectedValue);
         info.FileExt = DataConverter.CLng(this.RBLFileExt.SelectedValue);
         info.ListTemplate = this.TxtListTemplate.Text;
         if (info.SpecCateID > 0)
         {
             this.bll.AddSpecCate(info);
         }
         else
         {
             this.bll.UpdateCate(info);
         }
         Response.Redirect("SpecialManage.aspx");
     }
 }
Beispiel #3
0
 public void AddSpecCate(M_SpecCate SpecCate)
 {
     dal.AddCate(SpecCate);
 }
Beispiel #4
0
 public void UpdateCate(M_SpecCate SpecCate)
 {
     dal.Update(SpecCate);
 }
Beispiel #5
0
 /// <summary>
 /// 将专题类别信息的各属性值传递到参数中
 /// </summary>
 /// <param name="administratorInfo"></param>
 /// <returns></returns>
 private static SqlParameter[] GetParameters(M_SpecCate SpecCate)
 {
     SqlParameter[] parameter = new SqlParameter[] {
         new SqlParameter("@SpecCateID", SqlDbType.Int),
         new SqlParameter("@SpecCateName", SqlDbType.NVarChar, 50),
         new SqlParameter("@SpecCateDir", SqlDbType.NVarChar, 50),
         new SqlParameter("@SpecCateDesc", SqlDbType.NVarChar, 255),
         new SqlParameter("@OpenType", SqlDbType.Bit, 1),
         new SqlParameter("@FileExt", SqlDbType.Int, 4),
         new SqlParameter("@ListTemplate", SqlDbType.NVarChar, 255)
     };
     parameter[0].Value = SpecCate.SpecCateID;
     parameter[1].Value = SpecCate.SpecCateName;
     parameter[2].Value = SpecCate.SpecCateDir;
     parameter[3].Value = SpecCate.SpecCateDesc;
     parameter[4].Value = SpecCate.OpenNew;
     parameter[5].Value = SpecCate.FileExt;
     parameter[6].Value = SpecCate.ListTemplate;
     return parameter;
 }
Beispiel #6
0
 void ID_SpecCate.Update(M_SpecCate SpecCate)
 {
     string strSql = "PR_SpecCate_AddUpdate";
     SqlParameter[] cmdParams = GetParameters(SpecCate);
     SqlHelper.ExecuteProc(strSql, cmdParams);
 }