Example #1
0
        /// <summary>
        /// 保存反馈单和反馈单数据
        /// </summary>
        /// <param name="fkdModel"></param>
        /// <param name="fkdSourceModel"></param>
        /// <returns></returns>
        public void Save(BUS_YGDCFKD fkdModel, BUS_YGDCFKD_SOURCE fkdSourceModel)
        {
            if (string.IsNullOrWhiteSpace(fkdModel.FKDID))
            {
                fkdModel.FKDID = CommonService.GetPrimaryId(new GI_SerialInfo()
                {
                    Name = "BUS_YGDCFKD", ColumnName = "FKDID", OrganID = fkdModel.ORGANID
                }) + "";
                fkdModel.SaveModelM();
            }

            if (string.IsNullOrWhiteSpace(fkdSourceModel.FKDSOURCEID))
            {
                fkdSourceModel.FKDSOURCEID = CommonService.GetPrimaryId(new GI_SerialInfo()
                {
                    Name = "BUS_YGDCFKD_SOURCE", ColumnName = "FKDSOURCEID", OrganID = fkdSourceModel.ORGANID
                }) + "";
                fkdSourceModel.FKDID = fkdModel.FKDID;
                fkdSourceModel.SaveModelM();
            }
            else
            {
                var model = EntityOperate <BUS_YGDCFKD_SOURCE> .GetEntityById(fkdSourceModel.FKDSOURCEID, "FKDSOURCEID");

                model.CZWT   = fkdSourceModel.CZWT;
                model.XCZP   = fkdSourceModel.XCZP;
                model.ZGJY   = fkdSourceModel.ZGJY;
                model.KSYYFX = fkdSourceModel.KSYYFX;
                model.KSZGCS = fkdSourceModel.KSZGCS;
                model.XGPJ   = fkdSourceModel.XGPJ;
                model.BZ     = fkdSourceModel.BZ;
                model.UpdateM("FKDSOURCEID");
            }
        }
        /// <summary>
        /// 增加和保存数据
        /// </summary>
        /// <returns></returns>
        public string Save(BUS_YGDCFKD fkdModel, BUS_YGDCFKD_SOURCE fkdSourceModel)
        {
            return(base.ExecuteActionJsonResult("保存信息", () =>
            {
                var userToken = Request["token"].GetUserToken();
                //完善反馈单信息
                if (string.IsNullOrWhiteSpace(fkdModel.FKDID))
                {
                    fkdModel.XZRYID = userToken.UserId;
                    fkdModel.XZRYMC = userToken.USERNAME;
                    fkdModel.XZRQ = DateTime.Now;
                    fkdModel.ORGANID = userToken.ORGANID;
                }
                //完善反馈单数据信息
                if (string.IsNullOrWhiteSpace(fkdSourceModel.FKDSOURCEID))
                {
                    fkdSourceModel.XZRYID = userToken.UserId;
                    fkdSourceModel.XZRYMC = userToken.USERNAME;
                    //fkdSourceModel.DEPTID = userToken.DpetID;
                    //fkdSourceModel.DEPTNAME = "没给登录人所在部门名";
                    fkdSourceModel.XZRQ = DateTime.Now;
                    fkdSourceModel.ORGANID = userToken.ORGANID;
                }

                feedBackService.Save(fkdModel, fkdSourceModel);
                return new WebApi_Result();
            }));
        }
Example #3
0
        /// <summary>
        /// 根据反馈单数据ID 查询单条反馈单数据
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public Tuple <BUS_YGDCFKD, BUS_YGDCFKD_SOURCE> GetFkdSourceModel(CommonFilter iFilter, string fkdSourceId)
        {
            string filter = "1=1";

            filter += iFilter.GetQueryString();
            // if (string.IsNullOrWhiteSpace(fkdSourceId)) { filter += " and FKDSOURCEID=" + fkdSourceId + ""; }

            BUS_YGDCFKD_SOURCE bus_ygdcfkd_source = EntityOperate <BUS_YGDCFKD_SOURCE> .GetEntityById(fkdSourceId, "FKDSOURCEID");

            BUS_YGDCFKD bus_ygdcfkd = EntityOperate <BUS_YGDCFKD> .GetEntityById((bus_ygdcfkd_source == null ? "" : bus_ygdcfkd_source.FKDID), "FKDID");

            var departList = EntityOperate <AI_DeptInfo> .GetEntityList(filter + (bus_ygdcfkd_source == null ? "" : " and deptid='" + bus_ygdcfkd.DEPTID + "'"), "ParentID,DeptID");

            bus_ygdcfkd_source.DpetList = departList;

            var tupe = new Tuple <BUS_YGDCFKD, BUS_YGDCFKD_SOURCE>(bus_ygdcfkd, bus_ygdcfkd_source);

            return(tupe);
        }
Example #4
0
        /// <summary>
        /// 根据反馈单数据ID获取单条反馈单数据
        /// </summary>
        /// <param name="iFilter"></param>
        /// <returns></returns>
        public BUS_YGDCFKD_SOURCE GetFkdSourceByID(string FKDSOURCEID)
        {
            BUS_YGDCFKD_SOURCE model = EntityOperate <BUS_YGDCFKD_SOURCE> .GetEntityById(FKDSOURCEID, "FKDSOURCEID");

            return(model);
        }