Beispiel #1
0
        /// <summary>
        /// 根据类别编号获取数据
        /// </summary>
        /// <param name="DWBM"></param>
        /// <returns></returns>
        private string GetModel(string ajlbbm)
        {
            if (string.IsNullOrEmpty(ajlbbm))
            {
                ajlbbm = Request.Form.Get("id");
                if (string.IsNullOrEmpty(ajlbbm))
                {
                    return(ReturnString.JsonToString(Prompt.error, "参数错误", null));
                }
            }
            XT_DM_AJLBBM bll = new XT_DM_AJLBBM(this.Request);

            EDRS.Model.XT_DM_AJLBBM model = bll.GetModel(ajlbbm);
            if (model != null)
            {
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.参数配置Web, "根据编号获取类型信息成功", "", UserInfo, UserRole, this.Request);
                return(JsonHelper.JsonString(model));
            }
            //数据日志
            OperateLog.AddLog(OperateLog.LogType.参数配置Web, "根据编号获取类型信息失败", "", UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "获取数据失败", null));
        }
Beispiel #2
0
        /// <summary>
        /// 修改类别
        /// </summary>
        /// <returns></returns>
        private string UpData()
        {
            string ajlbbm = Request.Form.Get("key_hidd").Trim();

            if (string.IsNullOrEmpty(ajlbbm))
            {
                return(ReturnString.JsonToString(Prompt.error, "未找到需要修改信息", null));
            }
            string msg = string.Empty;

            if (!ProvingFrom(ref msg))
            {
                return(ReturnString.JsonToString(Prompt.error, msg, null));
            }

            XT_DM_AJLBBM bll = new XT_DM_AJLBBM(this.Request);

            EDRS.Model.XT_DM_AJLBBM model = bll.GetModel(ajlbbm);
            if (model != null)
            {
                string ywbm = Request.Form.Get("slct_type_val");

                string ajlbbmNew = ywbm + "01";
                //业务类型不同重新设置编号
                if (model.YWBM != ywbm)
                {
                    DataSet ds = bll.GetListByPage(" and ywbm=:ywbm ", "ajlbbm desc", 1, 1, new object[] { ywbm });
                    if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows.Count > 0)
                    {
                        //int num = int.Parse(ds.Tables[0].Rows[0]["AJLBBM"].ToString().Substring(2, 2));
                        //num++;
                        //ajlbbmNew = Request.Form.Get("slct_type_val") + num.ToString().PadLeft(2, '0');

                        string lb = ds.Tables[0].Rows[0]["AJLBBM"].ToString();
                        lb = lb.Substring(ywbm.Length, lb.Length - ywbm.Length);
                        int num = int.Parse(lb);
                        num++;
                        ajlbbmNew = ywbm + num.ToString().PadLeft(lb.Length, '0');
                    }

                    model.AJLBBM = ajlbbmNew;
                }

                model.YWBM   = Request.Form.Get("slct_type_val");
                model.AJLBMC = Request.Form.Get("txt_lbname");
                model.AJSLJC = Request.Form.Get("txt_sljc");

                if (bll.Update(model, ajlbbm))
                {
                    //数据日志
                    OperateLog.AddLog(OperateLog.LogType.参数配置Web, "修改类别成功", "", UserInfo, UserRole, this.Request);
                    return(ReturnString.JsonToString(Prompt.win, "保存成功", null));
                }
                //数据日志
                OperateLog.AddLog(OperateLog.LogType.参数配置Web, "修改类别失败", "", UserInfo, UserRole, this.Request);
                return(ReturnString.JsonToString(Prompt.error, "保存失败", null));
            }
            //数据日志
            OperateLog.AddLog(OperateLog.LogType.参数配置Web, "修改类别未找到信息", "", UserInfo, UserRole, this.Request);
            return(ReturnString.JsonToString(Prompt.error, "未找到需要修改信息", null));
        }