public void Delete(NewMadarsaOperation entity)
        {
            tbl_NewMadarsaOperations _tbl_EMO_LocalVar = new tbl_NewMadarsaOperations(entity);

            using (System.Transactions.TransactionScope scope = new System.Transactions.TransactionScope())
            {
                if (entity.Id != null && entity.Id != 0)
                {
                    _tbl_EMO_LocalVar.Id     = entity.Id;
                    _tbl_EMO_LocalVar.Status = false;
                    _tbl_NewMadarsaOperations.Update(_tbl_EMO_LocalVar);
                }
                scope.Complete();
            }
        }
        public int Save(NewMadarsaOperation model)
        {
            tbl_NewMadarsaOperations _tbl_EMO_LocalVar = new tbl_NewMadarsaOperations(model);

            if (model.Id != null && model.Id != 0)
            {
                _tbl_EMO_LocalVar.Status = true;
                _tbl_NewMadarsaOperations.Update(_tbl_EMO_LocalVar);
            }
            else
            {
                _tbl_EMO_LocalVar.CreateDate = System.DateTime.Now;
                _tbl_EMO_LocalVar.CreatedBy  = 1;
                _tbl_EMO_LocalVar.Status     = true;
                _tbl_EMO_LocalVar            = _tbl_NewMadarsaOperations.Insert(_tbl_EMO_LocalVar);
            }

            return(_tbl_EMO_LocalVar.Id);
        }