Exemplo n.º 1
0
        private void FillParentLineList()
        {
            string sql = "ZoneId NOT IN ('" + this.ZoneId.ToString() + "')";

            string[] orderBy = new string[] { "ZoneCode" };
            WorkplaceZoneEx.LoadCombo(ref cboParent, "ZoneCode", true, true, "", sql, orderBy);
        }
Exemplo n.º 2
0
        private void BindZoneList()
        {
            this.lvZoneList.ListViewItemSorter = new ListViewItemSorter(lvZoneList);
            this.lvZoneList.Items.Clear();

            int iCount = 1;

            using (var ctx = new EF6.RT2020Entities())
            {
                var list = ctx.WorkplaceZone.OrderBy(x => x.ZoneCode).AsNoTracking().ToList();
                foreach (var item in list)
                {
                    var objItem = this.lvZoneList.Items.Add(item.ZoneId.ToString());
                    objItem.SubItems.Add(iCount.ToString());
                    objItem.SubItems.Add(item.ParentZone.HasValue ?
                                         WorkplaceZoneEx.GetZoneNameById(item.ParentZone.Value) : "");
                    objItem.SubItems.Add(item.ZoneCode);
                    objItem.SubItems.Add(item.ZoneName);
                    objItem.SubItems.Add(item.ZoneName_Chs);
                    objItem.SubItems.Add(item.ZoneName_Cht);

                    iCount++;
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Fills the zone list.
        /// </summary>
        public void FillZoneList()
        {
            WorkplaceZoneEx.LoadCombo(ref cboZone, "ZoneName", true);

            if (ConfigHelper.CurrentZoneId != Guid.Empty)
            {
                cboZone.SelectedValue = ConfigHelper.CurrentZoneId;
            }
        }
Exemplo n.º 4
0
        private bool IsValid()
        {
            bool result = true;

            #region ZoneCode 唔可以吉
            errorProvider.SetError(txtZoneCode, string.Empty);
            if (txtZoneCode.Text.Length == 0)
            {
                errorProvider.SetError(txtZoneCode, "Cannot be blank!");
                return(false);
            }
            #endregion

            #region 新增,要 check ZoneCode 係咪 in use
            errorProvider.SetError(txtZoneCode, string.Empty);
            if (WorkplaceZoneEx.IsZoneCodeInUse(txtZoneCode.Text.Trim()))
            {
                errorProvider.SetError(txtZoneCode, "Zone Code in use");
                return(false);
            }
            #endregion

            return(result);
        }
Exemplo n.º 5
0
 private void FillZone()
 {
     WorkplaceZoneEx.LoadCombo(ref cboZone, "ZoneName", true);
 }