예제 #1
0
        public virtual RequestEditRecordDomain CreateRequesteditrecordDomain()
        {
            RequestEditRecordEntity entity = new RequestEditRecordEntity();
            entity.Recordid = Guid.NewGuid().ToString();

            return new RequestEditRecordDomain(entity);
        }
예제 #2
0
 public RequestEditRecordDomain(RequestEditRecordEntity entity)
     : base(entity)
 {
     masterEntity = entity;
 }
예제 #3
0
 public virtual void UpdateRequesteditrecordEntity(RequestEditRecordEntity entity, DataAccessBroker broker)
 {
     DataAccess.Update(entity, broker);
 }
예제 #4
0
 public virtual void InsertRequesteditrecordEntity(RequestEditRecordEntity entity, DataAccessBroker broker)
 {
     DataAccess.Insert(entity, broker);
 }
예제 #5
0
        /// <summary>
        ///actionNO =  Raid Action No / Criminal  Criminal_Detail_ID
        ///RequestEditRecordEntity.ActionNo 存放 Raid Action No / Criminal  Criminal_Detail_ID
        ///RequestEditRecordEntity.ActionNoText 存放 Action No
        /// </summary>
        /// <param name="actionID"></param>
        /// <param name="requestAgencyID"></param>
        /// <param name="content"></param>
        /// <param name="raidOrCriminal"></param>
        /// <returns></returns>
        public virtual bool Apply(string actionNO, string requestAgencyID, string content, string raidOrCriminal)
        {
            using (DataAccessBroker objBroker = DataAccessFactory.Instance())
            {
                NormalRaidEntity normalEntity = null;
                CriminalDetailEntity criminalDetailEntity = null;
                if (raidOrCriminal.ToUpper() == "CRIMINAL")
                {
                    criminalDetailEntity = MainService.CriminalDetailBLLService.GetCriminalDetailEntityById(actionNO);
                }
                else
                {
                    normalEntity = MainService.NormalRaidBLLService.GetNormalRaidEntityById(actionNO);
                }
                AgencyEntity agency = MainService.AgencyService.GetAgencyEntityById(requestAgencyID);
                if (normalEntity != null || criminalDetailEntity!=null)
                {
                    objBroker.BeginTransaction();
                    try
                    {
                        RequestEditRecordEntity entity = new RequestEditRecordEntity();
                        entity.Recordid = Guid.NewGuid().ToString();
                        entity.ActionNo = actionNO;
                        entity.RequestAgencyID = requestAgencyID; //同一个Agency具有相同的权限
                        entity.ActionNoText = actionNO;
                        if (agency != null && agency.AgencyName != "")
                        {
                            entity.RequestAgency = agency.AgencyName;
                        }
                        entity.Requestcontent = content;
                        entity.Requesttime = DateTime.Now;
                        entity.Type = raidOrCriminal.ToUpper();
                       

                        if (raidOrCriminal.ToUpper() == "CRIMINAL")
                        {
                            entity.ActionNoText = criminalDetailEntity.ActionNo;

                            criminalDetailEntity.Editrecordid = entity.Recordid;
                            DataAccess.Update(criminalDetailEntity);
                        }
                        else
                        {
                            normalEntity.Editrecordid = entity.Recordid;
                            DataAccess.Update(normalEntity);
                        }

                        DataAccess.Insert(entity, objBroker);

                        objBroker.Commit();
                        return true;
                    }
                    catch
                    {
                        objBroker.RollBack();
                        return false;
                    }
                }
                else
                {
                    return false;
                }
            }
        }