EntityRepository.Update C# (CSharp) Method

Update() public method

public Update ( Entity entity ) : void
entity Entity
return void
        public void Update(Entity entity)
        {
            // TODO: Update existing entity in database here
        }
    }

Usage Example

Esempio n. 1
0
        /// <summary>
        /// تایید اضافه کار تشویقی یک دوره(ماه) توسط اداری جهت پرداخت
        /// </summary>
        /// <param name="year">سال</param>
        /// <param name="month">ماه</param>
        /// <returns>شناسه رکورد</returns>
        public decimal ApproveOverTime(int year, int month)
        {
            DateTime date;

            if (BLanguage.CurrentSystemLanguage == LanguagesName.Parsi)
            {
                date = Utility.ToMildiDate(String.Format("{0}/{1}/{2}", year, month, 1));
            }
            else
            {
                date = new DateTime(year, month, 1);
            }
            //-----------------------------------------------------------------------
            OverTime overTime = this.GetPeriodByDate(date);

            overTime.ApprovedDate = DateTime.Now;
            overTime.IsApproved   = true;
            //این دوره هنوز در دیتابیس تعریف نشده
            if (overTime == null)
            {
                return(0);
            }
            //قبلا تایید شده
            if (overTime.IsApproved == true)
            {
                return(0);
            }

            overTime = overTimeRepository.Update(overTime);
            return(overTime.ID);
        }
All Usage Examples Of EntityRepository::Update