示例#1
0
        private string AddTemp()
        {
            Cyvation.CCQE.Web.ZZJGHandler.JsonResult resultJson = new Cyvation.CCQE.Web.ZZJGHandler.JsonResult();

            try
            {
                string jsonText = Request.Params["jsonText"]; //保存模板的json集合

                string _sslbbm = Request.Params["sslbbm"];    //所属类别
                string _sslbmc = Request.Params["sslbmc"];    //所属类别
                string _ajlbbm = Request.Params["ajlbbm"];    //案件类别
                string _ajlbmc = Request.Params["ajlbmc"];    //案件类别
                EDRS.Model.XT_DM_QX    model = new EDRS.Model.XT_DM_QX();
                EDRS.BLL.XY_DZJZ_MBPZB bll   = new EDRS.BLL.XY_DZJZ_MBPZB(Request);
                JavaScriptSerializer   jsonH = new JavaScriptSerializer();
                List <TemplateModel>   list  = jsonH.Deserialize(jsonText, typeof(List <TemplateModel>)) as List <TemplateModel>;
                //将list 转换为 list<dictionary>
                List <Dictionary <string, string> > tempList = new List <Dictionary <string, string> >();
                foreach (TemplateModel tmodel in list)
                {
                    Dictionary <string, string> tempModel = new Dictionary <string, string>();
                    tempModel["id"]        = tmodel.id;
                    tempModel["text"]      = tmodel.text;
                    tempModel["parentId"]  = tmodel.parentId;
                    tempModel["SortIndex"] = tmodel.SortIndex;
                    tempModel["auto"]      = tmodel.auto;
                    tempList.Add(tempModel);
                }
                bool result = bll.AddList(tempList, UserInfo.DWBM, _ajlbbm, _ajlbmc, _sslbbm, _sslbmc);// bll.AddDW(list, _jsbm, _dwbm, _bmbm);
                resultJson.isTrue   = true;
                resultJson.errorMsg = resultJson.isTrue ? "操作成功!" : "操作失败,请稍后重试!";
                if (result)
                {
                    OperateLog.AddLog(OperateLog.LogType.角色权限管理Web, "新增模板配置成功!", _sslbbm, UserInfo, UserRole, Request);
                }
                else
                {
                    OperateLog.AddLog(OperateLog.LogType.角色权限管理Web, "新增模板配置失败!", _sslbbm, UserInfo, UserRole, Request);
                }
            }
            catch (Exception ex)
            {
                EDRS.Common.LogHelper.LogError(null, "", ex.Message, "ADDDWQX", "ZZJGHandler");
            }
            return(resultJson.ToJsonString());
        }
示例#2
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            Dictionary <string, string> SSLBList = new Dictionary <string, string>();

            EDRS.BLL.XT_DM_AJLBBM bll2 = new XT_DM_AJLBBM(Request);
            DataSet dsSSLB             = bll2.GetSSLBList("", null);

            foreach (DataRow dr in dsSSLB.Tables[0].Rows)
            {
                SSLBList.Add(dr["SSLBBM"].ToString(), dr["SSLBMC"].ToString());
            }
            if (FileUpload1.HasFile)
            {
                string  path = FileUpload1.PostedFile.FileName;
                DataSet ds   = new DataSet();
                ds.ReadXml(path);

                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    string        number = "00000001";
                    XY_DZJZ_MBPZB bll    = new XY_DZJZ_MBPZB(this.Request);
                    DataSet       ds1    = bll.GetListByPage("", "DOSSIERTYPEVALUEMEMBER desc", 0, 1);
                    if (ds1 != null && ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0)
                    {
                        number = ds1.Tables[0].Rows[0]["DOSSIERTYPEVALUEMEMBER"].ToString();
                        number = (int.Parse(number) + 1).ToString().PadLeft(8, '0');
                    }
                    EDRS.Model.XY_DZJZ_MBPZB model = new EDRS.Model.XY_DZJZ_MBPZB();
                    model.DossierTypeValueMember = number;
                    model.CaseInfoTypeID         = "0301";
                    model.CaseInfoTypeName       = "一审公诉案件";
                    model.UnitID = "370000";
                    model.DossierTypeDisplayMember   = dr["value"].ToString();
                    model.DossierParentMember        = "";
                    model.DossierEvidenceValueMember = "";
                    model.SortIndex = Convert.ToInt32(dr["index"]);
                    model.Category  = "J";
                    model.SSLBBM    = dr["key"].ToString();
                    model.SSLBMC    = SSLBList[model.SSLBBM];
                    model.Auto      = "N";
                    string pid = number;
                    EDRS.BLL.XY_DZJZ_MBPZB bll1 = new EDRS.BLL.XY_DZJZ_MBPZB(Request);
                    if (bll1.Add(model))
                    {
                        string key = dr["key"].ToString();
                        key = key.Split('-')[1];
                        DataRow[] drs = ds.Tables[1].Select("key like '" + key + "-%'");
                        foreach (DataRow dr1 in drs)
                        {
                            model.CaseInfoTypeID             = "0301";
                            model.CaseInfoTypeName           = "一审公诉案件";
                            model.UnitID                     = "370000";
                            model.DossierTypeDisplayMember   = dr1["value"].ToString();
                            model.DossierParentMember        = pid;
                            model.DossierEvidenceValueMember = "";


                            ds1 = bll.GetListByPage("", "DOSSIERTYPEVALUEMEMBER desc", 0, 1);
                            if (ds1 != null && ds1.Tables.Count > 0 && ds1.Tables[0].Rows.Count > 0)
                            {
                                number = ds1.Tables[0].Rows[0]["DOSSIERTYPEVALUEMEMBER"].ToString();
                                number = (int.Parse(number) + 1).ToString().PadLeft(8, '0');
                            }
                            model.DossierTypeValueMember = number;
                            model.SortIndex = Convert.ToInt32(dr1["index"]);;
                            model.Category  = "W";
                            model.SSLBBM    = dr1["key"].ToString();
                            model.SSLBMC    = SSLBList[model.SSLBBM];
                            model.Auto      = "N";
                            bll1.Add(model);
                        }
                    }
                }
            }
        }