예제 #1
0
 public frmcreateTypePart(int cateId, string strTextTag)
 {
     InitializeComponent();
     m_Category             = new GroupPart();
     m_Category.GroupPartId = cateId;
     _currentTextNode       = strTextTag;
 }
예제 #2
0
 public void Update(GroupPart entity)
 {
     if (entity == null)
     {
         throw new ArgumentNullException("entity");
     }
     base.Edit(entity);
 }
예제 #3
0
 public frmEditGroupPart(GroupPart groupPart)
 {
     InitializeComponent();
     lblNotify1.Text = "";
     Select();
     m_GroupPart = groupPart;
     txtCode.Select();
     txtCode.Focus();
 }
예제 #4
0
        public void Remove(GroupPart entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }

            base.Delete(entity);
        }
예제 #5
0
        public int AddandGetRequestPaymentId(GroupPart entity)
        {
            if (entity == null)
            {
                throw new ArgumentNullException("entity");
            }
            string insert = string.Format(@"insert into GroupPart(GroupPartCode,GroupPartName,Note,CreateDate,CreateBy,ModifyDate,ModifyBy) output inserted.GroupPartId values  (@GroupPartCode,@GroupPartName,@Note,@CreateDate,@CreateBy,@ModifyDate,@ModifyBy)");

            return(Connection.ExecuteScalar <int>(insert, entity, Transaction));
        }
예제 #6
0
        public bool FindExist(GroupPart entity)
        {
            List <GroupPart> lstCategory;

            lstCategory = Connection.Query <Model.GroupPart>("select * from GroupPart where GroupPartCode  = @GroupPartCode and GroupPartId <>@Id", new { GroupPartCode = entity.GroupPartCode, Id = entity.GroupPartId }, transaction: Transaction).ToList();
            if (lstCategory == null || lstCategory.Count > 0)
            {
                return(true);
            }
            return(false);
        }
예제 #7
0
        public string ToSql(SqlGenerator generator)
        {
            var sb = new StringBuilder();

            sb.Append("Select ");
            if (SelectPart.Any())
            {
                sb = SelectPart.Aggregate(sb, (s, i) => s.AppendFormat("{0},", i.ToSql(generator)));
                sb.Remove(sb.Length - 1, 1);
            }
            else
            {
                sb.Append("*");
            }
            sb.Append(" From ");
            sb = FromPart.Aggregate(sb, (s, i) => s.AppendFormat("{0} ", i.ToSql(generator)));

            if (WherePart != null)
            {
                sb.AppendFormat("Where {0}", WherePart.ToSql(generator));
            }

            if (GroupPart.Any())
            {
                sb.Append(" Group By ");
                sb = GroupPart.Aggregate(sb, (s, o) => s.AppendFormat("{0},", o.ToSql(generator, false)));
                sb.Remove(sb.Length - 1, 1);
            }

            if (OrderPart.Any())
            {
                sb.Append(" Order By ");
                sb = OrderPart.Aggregate(sb, (s, o) => s.AppendFormat("{0},", o.ToSql(generator)));
                sb.Remove(sb.Length - 1, 1);
            }

            if (Take.HasValue)
            {
                sb.Append(" limit ");
                if (Skip.HasValue)
                {
                    sb.AppendFormat("{0},", Skip.Value);
                }
                sb.Append(Take.Value);
            }

            return(sb.ToString());
        }
예제 #8
0
        private void cbbGroupPart_SelectedValueChanged(object sender, EventArgs e)
        {
            if (isLoad)
            {
                return;
            }
            GroupPart group = cbbGroupPart.SelectedItem as GroupPart;

            if (group == null)
            {
                return;
            }
            int grouppartId = group.GroupPartId;

            ComboboxUtility.BindTypePartWidthALl(cbbTypePart, grouppartId.ToString());
        }
예제 #9
0
        public static void BindGroupPartWidthALl(MetroSearchComboBox cbb)
        {
            IList <GroupPart> lstSupplier;

            using (IUnitOfWork uow = new UnitOfWork())
            {
                lstSupplier = uow.GroupPartBaseRepository.All();
                uow.Commit();
            }
            if (lstSupplier != null)
            {
                cbb.DataSource = null;
                GroupPart objAll = new GroupPart {
                    GroupPartName = "Tất cả", GroupPartId = 0
                };
                lstSupplier.Add(objAll);
                cbb.DataSource    = lstSupplier;
                cbb.DisplayMember = "GroupPartName";
                cbb.ValueMember   = "GroupPartId";
            }
        }
예제 #10
0
 public MeetingGroup(string groupName, GroupPart groupPart)
 {
     GroupName = groupName;
     GroupPart = groupPart;
 }
예제 #11
0
 public void Add(GroupPart entry)
 {
     throw new NotImplementedException();
 }
예제 #12
0
 private void InitializeForm(GroupPart groupPart)
 {
     txtCode.Text = groupPart.GroupPartCode;
     txtName.Text = groupPart.GroupPartName;
     txtNote.Text = groupPart.Note;
 }