public int ZoneCode(ZoneData ItemCode)
        {
            ZoneDal ZoneDal = new ZoneDal();

            try
            {
                switch (ItemCode.DataStatus)
                {
                case DataStatus.New:
                    ZoneDal.Add(ItemCode);
                    break;

                case DataStatus.Modified:
                    ZoneDal.update(ItemCode);
                    break;

                case DataStatus.Deleted:
                    ZoneDal.Delete(ItemCode);
                    return(0);
                }
                return(ItemCode.ID);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
示例#2
0
 private void OnFormLoad(object sender, EventArgs e)
 {
     locationDal = new LocationDal();
     zoneDal     = new ZoneDal();
     //channelDal = new ChannelDal();
     BindingCombox();
     BindChannel(locationEntity);
     if (locationEntity != null)
     {
         this.Text       = "货位-修改";
         txtCode.Enabled = false;
         layoutControlItem3.Visibility = DevExpress.XtraLayout.Utils.LayoutVisibility.Never;
         ShowEditInfo(locationEntity);
         isNew = false;
     }
 }
        public ZoneData GetZoneDataByID(string ID)
        {
            ZoneDal ZoneDal = new ZoneDal();

            return(ZoneDal.GetZoneDataByID(ID));
        }