예제 #1
0
        public void AddCriteriaToQuery(O2CV1QueryDto queryDto, CriteriaDto criteriaDto)
        {
            using (var dc = new CriteriaDataContext())
            {
                var query = dc.O2CVQueries.Single(q => q.QueryName == queryDto.QueryName);

                var criteria = new O2CVQueryCriteria
                {
                    Sequence        = criteriaDto.Sequence,
                    TableName       = criteriaDto.TableName,
                    TableColumn     = criteriaDto.TableColumn,
                    CompareOperator = criteriaDto.CompareOperator,
                    CompareValue    = criteriaDto.CompareValue,
                    Description     = criteriaDto.Description,
                    Name            =
                        $"{criteriaDto.TableName} {criteriaDto.TableColumn} {criteriaDto.CompareOperator} {criteriaDto.CompareValue}",
                    DisableBy   = criteriaDto.Disabled ? criteriaDto.Createdby : null,
                    CreatedBy   = criteriaDto.Createdby,
                    Disabled    = criteriaDto.Disabled,
                    CreatedDate = Now
                };

                if (criteria.Disabled == true)
                {
                    criteria.DisabledDate = Now;
                }
                query.O2CVQueryCriterias.Add(criteria);
                dc.SubmitChanges();
            }
        }
예제 #2
0
        public void AddQueryAndFirstCriteriaToQuery(O2CV1QueryDto queryDto, CriteriaDto criteriaDto)
        {
            using (var dc = new CriteriaDataContext())
            {
                var query = new O2CVQuery
                {
                    QueryName   = queryDto.QueryName,
                    QuerySql    = queryDto.QuerySql,
                    CreatedBy   = queryDto.CreatedBy,
                    Deleted     = queryDto.Deleted,
                    Description = queryDto.Description,
                    CreatedDate = Now
                };

                var criteria = new O2CVQueryCriteria
                {
                    Sequence        = 1,
                    TableName       = criteriaDto.TableName,
                    TableColumn     = criteriaDto.TableColumn,
                    Name            = criteriaDto.Description,
                    CompareOperator = criteriaDto.CompareOperator,
                    CompareValue    = criteriaDto.CompareValue,
                    Description     = criteriaDto.Description,
                    DisableBy       = criteriaDto.Disabled ? criteriaDto.Createdby : null,
                    CreatedBy       = criteriaDto.Createdby,
                    Disabled        = criteriaDto.Disabled,
                    CreatedDate     = Now
                };

                if (criteria.Disabled == true)
                {
                    criteria.DisabledDate = Now;
                }
                query.O2CVQueryCriterias.Add(criteria);
                dc.O2CVQueries.InsertOnSubmit(query);
                dc.SubmitChanges();
            }
        }
예제 #3
0
 private void detach_O2CVQueryCriterias(O2CVQueryCriteria entity)
 {
     this.SendPropertyChanging();
     entity.O2CVQuery = null;
 }
예제 #4
0
 partial void DeleteO2CVQueryCriteria(O2CVQueryCriteria instance);
예제 #5
0
 partial void UpdateO2CVQueryCriteria(O2CVQueryCriteria instance);
예제 #6
0
 partial void InsertO2CVQueryCriteria(O2CVQueryCriteria instance);