qileilove

          blog已經(jīng)轉(zhuǎn)移至github,大家請?jiān)L問 http://qaseven.github.io/

          EnterpriseFrameWork框架基礎(chǔ)功能之字典數(shù)據(jù)配置管理

          框架中的“通用字典數(shù)據(jù)配置管理”主要解決的問題是,所有的行業(yè)軟件給客戶實(shí)施第一步一般都是基礎(chǔ)數(shù)據(jù)的維護(hù),一個系統(tǒng)的字典是少不了的,涉及業(yè)務(wù)范圍越廣字典就越多,如果每一個字典數(shù)據(jù)都做一個界面來進(jìn)行維護(hù)數(shù)據(jù)的話,那開發(fā)工作量還是比較大的,所以得考慮設(shè)計(jì)一個通用的模塊來管理這些字典數(shù)據(jù);
            1)通用字典管理功能清單
            2)通用字典管理界面展示,包括Winform版和Web版
           3)通用字典管理核心業(yè)務(wù)流程圖與數(shù)據(jù)庫表關(guān)系圖
            4)通用字典管理關(guān)鍵點(diǎn)技術(shù)實(shí)現(xiàn)
            1.字典保存數(shù)據(jù)實(shí)現(xiàn)
          //保存數(shù)據(jù)
          public Object SaveResultDataTable(int titleId, string IdName, object IdValue, Dictionary<string, object> fieldAndValue)
          {
          if (IdValue.Equals(System.DBNull.Value) == true)//插入數(shù)據(jù)
          {
          string fields = "";
          string values = "";
          string strsql = "insert into {0} ({1}) values({2})";
          foreach (KeyValuePair<string, object> val in fieldAndValue)
          {
          fields += (fields == "" ? "" : ",") + val.Key;
          values += (values == "" ? "" : ",") + ConvertDBValue(val.Value);
          }
          BaseGeneralTitle title = NewObject<BaseGeneralTitle>().getmodel(titleId) as BaseGeneralTitle;
          IdValue = oleDb.InsertRecord(string.Format(strsql, title.TableName, fields, values));
          }
          else//更新數(shù)據(jù)
          {
          string field_values = "";
          string strsql = "update  {0} set {1} where {2}";
          foreach (KeyValuePair<string, object> val in fieldAndValue)
          {
          field_values += (field_values == "" ? "" : ",") + val.Key + "=" + ConvertDBValue(val.Value);
          }
          BaseGeneralTitle title = NewObject<BaseGeneralTitle>().getmodel(titleId) as BaseGeneralTitle;
          oleDb.DoCommand(string.Format(strsql, title.TableName, field_values, IdName + "=" + ConvertDBValue(IdValue)));
          }
          return IdValue;
          }
            2.Web版JqueryEasyUI的Gird控件動態(tài)列
          <div id="resulttool" class="toolbar">
          <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-search" onclick="btnresult_search();">查詢</a>
          <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-add" onclick="btnresult_addData();">增加</a>
          <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-edit" onclick="btnresult_editData();">編輯</a>
          <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-cancel" onclick="btnresult_delData();">刪除</a>
          </div>
          <table id="resultGird"  class="easyui-datagrid" fit="true" border="false" toolbar="#resulttool" iconCls="icon-edit" pagination="true" idField="<%=Session["resulstDataKeyName"]%>">
          <thead>
          <tr>
          <th field="ck" checkbox="true"></th>
          <%=Session["resulstDatacolmodel"]%>
          </tr>
          </thead>
          </table>

          posted on 2014-09-24 15:34 順其自然EVO 閱讀(209) 評論(0)  編輯  收藏 所屬分類: 測試學(xué)習(xí)專欄數(shù)據(jù)庫

          <2014年9月>
          31123456
          78910111213
          14151617181920
          21222324252627
          2829301234
          567891011

          導(dǎo)航

          統(tǒng)計(jì)

          常用鏈接

          留言簿(55)

          隨筆分類

          隨筆檔案

          文章分類

          文章檔案

          搜索

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 福鼎市| 仪陇县| 蒙自县| 沅江市| 台南市| 图木舒克市| 天柱县| 宿松县| 茂名市| 元氏县| 虹口区| 河北省| 诸暨市| 汕头市| 靖远县| 二连浩特市| 互助| 阿瓦提县| 棋牌| 香港 | 浦东新区| 理塘县| 台东市| 邮箱| 青神县| 齐齐哈尔市| 潜山县| 罗平县| 太湖县| 扶风县| 北碚区| 盱眙县| 台南县| 眉山市| 乌鲁木齐县| 安陆市| 楚雄市| 观塘区| 根河市| 鹰潭市| 团风县|