public async Task <IActionResult> Put(int id, [FromBody] fw_cusgoods value)
        {
            var single = _fwCusgoodsRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <fw_cusgoods>(single, value, new string[] { "TypeName", "GoodsName", "GoodsPrice", "HouseCode", "OrderNo", "CusName", "Mobile", "Remark" });
            single.UpdatedAt = DateTime.Now;
            //更新字段内容
            if (User.Identity is ClaimsIdentity identity)
            {
                if (!string.IsNullOrEmpty(value.TakeBy))
                {
                    single.TakeBy   = identity.Name ?? "test";
                    single.TakeTime = DateTime.Now;
                }
                else
                {
                    single.CreatedBy = identity.Name ?? "test";
                }
            }
            _fwCusgoodsRpt.Commit();
            return(new NoContentResult());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 实现ESRI的对象复制方法
        /// </summary>
        /// <param name="pInObject">原始对象</param>
        /// <param name="pOverwriteObject">复制后的对象</param>
        public static void ObjectCopy(object pInObject, ref object pOverwriteObject)
        {
            IObjectCopy objectCopy = new ObjectCopy();
            object      copyedObj  = objectCopy.Copy(pInObject);

            objectCopy.Overwrite(copyedObj, ref pOverwriteObject);
        }
Ejemplo n.º 3
0
        private void ModifyProject(ClosureConsInvtChecking entity, string action)
        {
            // 2014-08-05 victor.huang: Recall 或Edit 后不需要重新再生成Task,不然会多生成一条冗余记录
            //TaskWorkCondition condition = new TaskWorkCondition();
            //condition.ProjectId = entity.ProjectId;
            //condition.Url = "/closure/Main#/closure/WOCheckList/" + entity.ProjectId;
            //condition.UserAccount = ClientCookie.UserCode;
            //condition.UserNameENUS = entity.UserNameENUS;
            //condition.UserNameZHCN = entity.UserNameZHCN;

            //taskWorkBll.ReSendTaskWork(condition);
            if (action == ProjectAction.Edit)
            {
                entity.IsHistory      = true;
                entity.LastUpdateTime = DateTime.Now;
                entity.Update();
                var objectCopy = new ObjectCopy();
                var newWo      = objectCopy.AutoCopy(entity);
                newWo.Id = Guid.NewGuid();
                ClosureConsInvtChecking.Add(newWo);

                var projectEntity = ProjectInfo.Get(entity.ProjectId, FlowCode.Closure_ConsInvtChecking);
                projectEntity.Status = ProjectStatus.UnFinish;
                ProjectInfo.Update(projectEntity);
            }
            ProjectInfo.Reset(entity.ProjectId, FlowCode.Closure_ConsInvtChecking);
        }
Ejemplo n.º 4
0
        public static void PostRemaindList(Remind remind, List <ProjectUsers> remindUsers)
        {
            var           objectCopy = new ObjectCopy();
            List <Remind> listRemind = new List <Remind>();

            try
            {
                foreach (var users in remindUsers)
                {
                    var entity = new Remind();
                    entity    = objectCopy.AutoCopy(remind);
                    entity.Id = Guid.NewGuid();
                    entity.ReceiverNameENUS = users.UserNameENUS;
                    entity.ReceiverNameZHCN = users.UserNameZHCN;
                    entity.ReceiverAccount  = users.UserAccount;
                    entity.CreateTime       = DateTime.Now;
                    listRemind.Add(entity);
                }
                Add(listRemind.ToArray());
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 5
0
        public object Clone()
        {
            var clone = new OhlcSymbol(Bars.Clone() as IBars);

            ObjectCopy.CopyProperties(this, clone);

            return(clone);
        }
Ejemplo n.º 6
0
        private void method_0(IMap imap_1, IMap imap_2)
        {
            IObjectCopy objectCopy = new ObjectCopy();
            object      pInObject  = objectCopy.Copy(imap_1);
            object      obj        = imap_2;

            objectCopy.Overwrite(pInObject, ref obj);
        }
Ejemplo n.º 7
0
        public static void CopyMap(IMap pMap, IMap targetMap)
        {
            IObjectCopy objectCopyClass = new ObjectCopy();
            object      obj             = objectCopyClass.Copy(pMap);
            object      imap1           = targetMap;

            objectCopyClass.Overwrite(obj, ref imap1);
        }
Ejemplo n.º 8
0
        public static void CopyMap(IMap imap_0, IMap imap_1)
        {
            IObjectCopy copy             = new ObjectCopy();
            object      pInObject        = copy.Copy(imap_0);
            object      pOverwriteObject = imap_1;

            copy.Overwrite(pInObject, ref pOverwriteObject);
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 同步布局
        /// </summary>
        public void copyToPageLayout()
        {
            IObjectCopy objectCopy  = new ObjectCopy();                      //对象拷贝接口
            object      copyFromMap = mapControl.Map;                        //地图对象
            object      copyMap     = objectCopy.Copy(copyFromMap);          //将axMapControl1的地图对象拷贝
            object      copyToMap   = pagelayoutcontrol.ActiveView.FocusMap; //axPageLayoutControl1活动视图中的地图

            objectCopy.Overwrite(copyMap, ref copyToMap);                    //将axMapControl1地图对象覆盖axPageLayout1当前地图
        }
Ejemplo n.º 10
0
        public override string Edit()
        {
            var taskWork = TaskWork.FirstOrDefault(e => e.ReceiverAccount == ClientCookie.UserCode && e.SourceCode == FlowCode.Closure && e.TypeCode == FlowCode.Closure_ExecutiveSummary && e.RefID == this.ProjectId);


            taskWork.Status         = TaskWorkStatus.UnFinish;
            taskWork.StatusNameZHCN = "任务";
            taskWork.StatusNameENUS = "任务";

            var closureEntity = ClosureInfo.GetByProjectId(this.ProjectId);

            taskWork.ReceiverAccount  = closureEntity.AssetActorAccount;
            taskWork.ReceiverNameENUS = closureEntity.AssetActorNameENUS;
            taskWork.ReceiverNameZHCN = closureEntity.AssetActorNameZHCN;
            taskWork.Id           = Guid.NewGuid();
            taskWork.CreateTime   = DateTime.Now;
            taskWork.Url          = TaskWork.BuildUrl(FlowCode.Closure_ExecutiveSummary, this.ProjectId, "");
            taskWork.ActivityName = NodeCode.Start;
            taskWork.ProcInstID   = null;
            taskWork.FinishTime   = null;
            taskWork.ActionName   = SetTaskActionName(ProjectId);
            TaskWork.Add(taskWork);

            this.IsHistory = true;

            this.Save();

            var objectCopy = new ObjectCopy();
            var newEntity  = objectCopy.AutoCopy(this);

            newEntity.Id         = Guid.NewGuid();
            newEntity.ProcInstID = 0;
            newEntity.IsHistory  = false;
            newEntity.Add();

            var projectEntity = ProjectInfo.Get(this.ProjectId, FlowCode.Closure_ExecutiveSummary);

            projectEntity.Status = ProjectStatus.UnFinish;

            ProjectInfo.Update(projectEntity);
            ProjectInfo.Reset(ProjectId, FlowCode.Closure_ExecutiveSummary);
            ProjectInfo.Reset(ProjectId, FlowCode.Closure);
            var attList = Attachment.Search(e => e.RefTableID == this.Id.ToString() && e.RefTableName == ClosureExecutiveSummary.TableName).AsNoTracking().ToList();

            var newList = new List <Attachment>();

            foreach (var att in attList)
            {
                var newAtt = objectCopy.AutoCopy(att);
                newAtt.RefTableID = newEntity.Id.ToString();
                newAtt.ID         = Guid.NewGuid();
                newList.Add(newAtt);
            }
            Attachment.Add(newList.ToArray());
            return(taskWork.Url);
        }
Ejemplo n.º 11
0
    static void mmmmm()
    {
        //this.m_renderer = GetComponent<SpriteRenderer>();
        Material material = Canvas.GetDefaultCanvasMaterial();
        //Shader shader = this.m_renderer.material.shader;
        Shader shader = new Shader();

        ObjectCopy.ObjectCopyTo <Shader>(material.shader, shader);
        AssetDatabase.CreateAsset(shader, "Assets/shader1.shader");
        AssetDatabase.Refresh();
    }
        private async Task SavePaymentRecord(Model.Payment payment, PaymentResponse paymentResult)
        {
            _logger.Verbose($"Calling SavePaymentRecord");

            var paymentEntity = new Data.Payment();

            ObjectCopy <Model.Payment, Data.Payment> .Copy(payment, paymentEntity);

            paymentEntity.PaymentStatus = (int)paymentResult.PaymentStatus;
            paymentEntity.UniqueId      = paymentResult.UniqueIdentifier;
            await _paymentRepository.Create(paymentEntity);
        }
Ejemplo n.º 13
0
        public void Edit(int id, PatientDto patientDto)
        {
            var entityPatient = unitOfWork.PatientRepository.GetAll().FirstOrDefault(a => a.Id == id);

            if (entityPatient != null)
            {
                patientDto.Id = entityPatient.Id;
                ObjectCopy.Patch(entityPatient, patientDto);
                unitOfWork.PatientRepository.Update(entityPatient);
                unitOfWork.Commit();
            }
        }
Ejemplo n.º 14
0
        public void Update(Worker worker)
        {
            if (!Contains(worker.Key))
            {
                Add(worker);
            }
            else
            {
                var target = Items[worker.Key];

                ObjectCopy.Copy(worker, target);
            }
        }
        /// <inheritdoc cref="ObjectCopyExtensions.CopyTo{TSource, TDestination}(TSource, TDestination)"/>
        public static TDestination CopyTo <TSource, TDestination>(this TSource source) where TSource : class where TDestination : class, new()
        {
            if (source is null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            TDestination destination = new();

            ObjectCopy <TSource, TDestination> .Copy(source, destination);

            return(destination);
        }
Ejemplo n.º 16
0
        public void Update(Message message)
        {
            if (!Items.Keys.Contains(message.MessageName))
            {
                Add(message);
            }
            else
            {
                var target = Items[message.Key];

                ObjectCopy.Copy(message, target);
            }
        }
        /// <summary>
        /// 将源对象的字段、属性赋值到目标对象的同名、同类型的字段、属性
        /// </summary>
        /// <typeparam name="TSource">源对象类型</typeparam>
        /// <typeparam name="TDestination">目标对象类型</typeparam>
        /// <param name="source">源对象</param>
        /// <param name="destination">目标对象</param>
        public static void CopyTo <TSource, TDestination>(this TSource source, TDestination destination) where TSource : class where TDestination : class
        {
            if (source is null)
            {
                throw new ArgumentNullException(nameof(source));
            }

            if (destination is null)
            {
                throw new ArgumentNullException(nameof(destination));
            }

            ObjectCopy <TSource, TDestination> .Copy(source, destination);
        }
Ejemplo n.º 18
0
        public void CopyPropertiesTest()
        {
            var firstObject = new TestClass(12.1)
            {
                FirstProperty = "Test", SecondProperty = 2
            };
            var secondObject = new TestClass(24.2);

            ObjectCopy.CopyProperties(firstObject, secondObject);

            Assert.AreEqual(firstObject.FirstProperty, secondObject.FirstProperty);
            Assert.AreEqual(firstObject.SecondProperty, secondObject.SecondProperty);
            Assert.AreNotEqual(firstObject.ThirdProperty, secondObject.ThirdProperty);
        }
Ejemplo n.º 19
0
        public IHttpActionResult CreateList(TaskWork entity, List <RemindUserInfo> users)
        {
            var        taskWorkEntity = new TaskWork();
            ObjectCopy objectCopy     = new ObjectCopy();

            foreach (var remindUserInfo in users)
            {
                taskWorkEntity = objectCopy.AutoCopy(entity);
                taskWorkEntity.ReceiverAccount  = remindUserInfo.UserAccount;
                taskWorkEntity.ReceiverNameENUS = remindUserInfo.UserNameENUS;
                taskWorkEntity.ReceiverNameZHCN = remindUserInfo.UserNameZHCN;
                taskWorkEntity.CreateTime       = DateTime.Now;
                Create(taskWorkEntity);
            }
            return(Ok());
        }
        public async Task <Model.Payment> Get(int id)
        {
            _logger.Verbose($"Calling Payment Repository Get {id}");
            var paymentEntity = await _paymentRepository.GetById(id);

            if (paymentEntity == null)
            {
                return(null);
            }

            var payment = new Model.Payment();

            ObjectCopy <Data.Payment, Model.Payment> .Copy(paymentEntity, payment);

            payment.CardNumber = MaskCardNumber(payment.CardNumber);
            return(payment);
        }
        public async Task <IActionResult> Put(int id, [FromBody] sms_template value)
        {
            var single = _smsTemplateRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <sms_template>(single, value, new string[] { "tmp_name", "to_business", "tmp_content", "remark" });
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "admin";
            }
            _smsTemplateRpt.Commit();
            return(new NoContentResult());
        }
        public async Task <IActionResult> Put(int id, [FromBody] set_paytype value)
        {
            var single = _setPaytypeRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <set_paytype>(single, value, new string[] { "IsReturn", "Name", "PayType", "IsIntegral", "IsDefault", "Remark" });
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "admin";
            }
            _setPaytypeRpt.Commit();
            return(new NoContentResult());
        }
Ejemplo n.º 23
0
        public void Add(PatientDto patientDto)
        {
            var patientEntity = unitOfWork.PatientRepository.GetByNationalCode(patientDto.NationalCode);

            if (patientEntity == null)
            {
                patientEntity = patientFactory.CreateEntity(patientDto);
            }
            else
            {
                patientDto.Id = patientEntity.Id;
                ObjectCopy.Patch(patientEntity, patientDto);
            }


            unitOfWork.PatientRepository.Add(patientEntity);
            unitOfWork.Commit();
        }
Ejemplo n.º 24
0
        public async Task <IActionResult> Put(int id, [FromBody] set_group value)
        {
            var single = _setGroupRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <set_group>(single, value, "address", "contractDate1", "contractDate2", "contractNo", "coupons", "linkMan", "mobile", "name", "remark");
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "test";
            }
            _setGroupRpt.Commit();
            return(new NoContentResult());
        }
Ejemplo n.º 25
0
        public async Task <IActionResult> Put(int id, [FromBody] set_agent value)
        {
            var single = _setAgentRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <set_agent>(single, value, new string[] { "name", "typeName", "linkMan", "mobile", "address", "contractNo", "contractDate1", "contractDate2", "commissionType", "commissionRate", "remark" });
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "admin";
            }
            _setAgentRpt.Commit();
            return(new NoContentResult());
        }
        public async Task <IActionResult> Put(int id, [FromBody] set_allhouse_price value)
        {
            var single = _setAllhousePriceRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <set_allhouse_price>(single, value, new string[] { "name", "halfPriceHours", "allPriceHours", "leaveTime", "addFeeHours", "addAllDay", "addAllHours", "remark" });
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "admin";
            }
            _setAllhousePriceRpt.Commit();
            return(new NoContentResult());
        }
Ejemplo n.º 27
0
        public async Task <IActionResult> Put(int id, [FromBody] kc_supplier value)
        {
            var single = _kcSupplierRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <kc_supplier>(single, value, new string[] { "name", "address", "linkMan", "tel", "linkManTitle", "linkManTel", "faxNo", "remark", "city" });
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "admin";
            }
            _kcSupplierRpt.Commit();
            return(new NoContentResult());
        }
Ejemplo n.º 28
0
        public async Task <IActionResult> Put(int id, [FromBody] kc_goods value)
        {
            var single = _kcGoodsRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <kc_goods>(single, value, new string[] { "name", "typeId", "unit", "goodsCode", "minAmount", "remark", "goodsNo", "price", "GoodsBrand" });
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "admin";
            }
            _kcGoodsRpt.Commit();
            return(new NoContentResult());
        }
Ejemplo n.º 29
0
        public async Task <IActionResult> Put(int id, [FromBody] yx_serviceitem value)
        {
            var single = _yxServiceitemRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy(single, value, "name", "typeId", "unit", "itemCode", "integral", "remark", "price");
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "test";
            }
            _yxServiceitemRpt.Commit();
            return(new NoContentResult());
        }
        public async Task <IActionResult> Put(int id, [FromBody] fw_houseinfo value)
        {
            var single = _fwHouseinfoRpt.GetSingle(id);

            if (single == null)
            {
                return(NotFound());
            }
            ObjectCopy.Copy <fw_houseinfo>(single, value, new string[] { "floor", "houseType", "tags", "remark" });
            //更新字段内容
            single.UpdatedAt = DateTime.Now;
            if (User.Identity is ClaimsIdentity identity)
            {
                single.CreatedBy = identity.Name ?? "test";
            }
            _fwHouseinfoRpt.Commit();
            return(new NoContentResult());
        }