Пример #1
0
        //修改
        int IStoreRepository.UptStore(Model.Store a)
        {
            string sql = $"Update Store Set MName='{a.MName}', Shopowner='{a.Shopowner}', Goods='{a.Goods}'," +
                         $"Volume='{a.Volume}', Extraction='{a.Extraction}', StoreType='{a.StoreType}', State='{a.State}' where Mid='{a.Mid}' ";

            return(DapperHelper.Execute(sql));
        }
Пример #2
0
        public void Delete(Model.Store model)
        {
            #region 取資料
            Model.Store query = this.Get(model.ID_Store);
            //var queryoverseastaff = this._overseaService.GetForOverType(query.ID_OverType);
            #endregion

            #region 邏輯驗證
            if (query == null)//沒有資料
            {
                throw new Exception("MessageNoData".ToLocalized());
            }

            //驗證
            //if (queryoverseastaff == null)//沒有資料
            //    throw new Exception("MessageDataHasLinking".ToLocalized());
            #endregion

            #region 變為Models需要之型別及邏輯資料

            #endregion

            #region Models資料庫
            this._repository.Delete(query);
            this._unitOfWork.SaveChange();
            #endregion
        }
Пример #3
0
        public Search(Control Parent, Model.Store Store)
            : base(Parent)
        {
            // Save Store
            this.Store = Store;

            // Set Title
            if (this.Store != null)
            {
                this.Title = "Select " + this.Store.ItemType.SingularLabel;
            }
            else
            {
                this.Title = null;
            }

            // Set Default Width
            this.Width = 600;

            // Set Default Height
            this.Height = 800;

            // Create Border Content
            this.Content         = new Containers.BorderContainers.Search(this.Session);
            this.Content.Binding = this.Store;
        }
Пример #4
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            bool isvalid = true;                                                       //지역변수-->전역변수

            LblStoreName.Visibility = LblStoreLocation.Visibility = Visibility.Hidden; //화면에 뜬 값들을 숨겨준다.
            var store = new Model.Store();                                             // user는 DB모델의 사용자 목록들을 가져오겠따.

            isvalid = IsValidInput();                                                  //유효성 체크-->개발자에게 필수이다.-->어디에서든 다 필요적인 것이다.
            if (isvalid)
            {
                //MessageBox.Show("DB수정처리!")
                store.StoreName     = TxtStoreName.Text;
                store.StoreLocation = TxtStoreLocation.Text;
                try
                {
                    var result = Logic.DataAccess.SetStore(store);
                    if (result == 0)
                    {
                        //수정 안됨
                        Commons.LOGGER.Error("AddStore.xaml.cs 창고정보 저장오류 발생");
                        Commons.ShowMessageAsync("오류", "저장 시 오류가 발생했습니다.");
                        return;
                    }
                    else
                    {
                        //정상적 수정됨
                        NavigationService.Navigate(new StoreList());
                    }
                }
                catch (Exception ex)//페이지는 메트로 인트로가 아니기 때문에 메시지 박스가 발생하지 않는다.
                {
                    Commons.LOGGER.Error($"예외발생 : {ex}");
                }
            }
        }
Пример #5
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            bool isValid = true;

            LblStoreName.Visibility = LblStoreLocation.Visibility = Visibility.Hidden;

            var store = new Model.Store();

            isValid = IsValidInput();//유효성체크

            if (isValid)
            {
                store.StoreName     = TxtStoreName.Text;
                store.StoreLocation = TxtStoreLocation.Text;

                try
                {
                    var result = Logic.DataAccess.SetStores(store);
                    if (result == 0)
                    {
                        Commons.LOGGER.Error("AddStore.xaml.cs 창고 정보 저장오류 발생");
                        Commons.ShowMessageAsync("오류", "저장시 오류가 발생했습니다.");
                    }
                    else
                    {
                        NavigationService.Navigate(new StoreList());
                    }
                }
                catch (Exception ex)
                {
                    Commons.LOGGER.Error($"예외발생: {ex}");
                }
            }
        }
Пример #6
0
        public int UptStore([FromForm] Model.Store Model)
        {
            logger.Debug($"用户修改了门店表信息,修改的门店的名称为:{Model.MName}");
            int i = _storeRepository.UptStore(Model);

            return(i);
        }
Пример #7
0
        public int InsertStore([FromForm] Model.Store Model)
        {
            logger.Debug($"用户添加了门店表信息,添加的门店的名称为:{Model.MName}");
            int i = _storeRepository.InsertStore(Model);

            return(i);
        }
Пример #8
0
        //添加
        int IStoreRepository.AddStore(Model.Store a)
        {
            string sql = $"insert into Store values (null,'{a.MName}', '{a.Shopowner}', '{a.Goods}'," +
                         $"'{a.Volume}','{a.Extraction}','{a.StoreType}','{a.State}')";

            return(DapperHelper.Execute(sql));
        }
Пример #9
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            bool isValid = true; // 입력된 값이 모두 만족하는지 판별하는 플래그

            LblStoreName.Visibility = LblStoreLocation.Visibility = LblResult.Visibility = Visibility.Hidden;

            var store = new Model.Store();

            if (string.IsNullOrEmpty(TxtStoreName.Text))
            {
                LblStoreName.Visibility = Visibility.Visible;
                LblStoreName.Text       = "창고명을 입력하세요";
                isValid = false;
            }
            else if (!StoreNameCheck(TxtStoreName.Text))
            {
                LblStoreName.Visibility = Visibility.Visible;
                LblStoreName.Text       = "중복된 창고명 입니다..";
                isValid = false;
            }
            if (string.IsNullOrEmpty(TxtStoreLocation.Text))
            {
                LblStoreLocation.Visibility = Visibility.Visible;
                LblStoreLocation.Text       = "창고위치를 입력하세요";
                isValid = false;
            }


            if (isValid)
            {
                store.StoreName     = TxtStoreName.Text;
                store.StoreLocation = TxtStoreLocation.Text;

/*                store.ItemStatus = bool.Parse(CboItemStatus.SelectedValue.ToString());
 *              store.TagID = int.Parse(TxtTagID.Text);
 *              store.BarcodeID = int.Parse(TxtBarcodeID.Text);*/

                try
                {
                    var result = Logic.DataAccess.SetStore(store);

                    if (result == 0)
                    {
                        LblResult.Text       = "창고 추가에 문제가 발생했습니다. 관리자에게 문의 바랍니다.";
                        LblResult.Foreground = Brushes.Red;
                    }
                    else
                    {
                        NavigationService.GoBack();
                    }
                }
                catch (Exception ex)
                {
                    Commons.LOGGER.Error($"예외발생 AddUser: {ex}");
                }
            }
        }
Пример #10
0
        private void ShowInfo(int _id)
        {
            BLL.Store   bll   = new BLL.Store();
            Model.Store model = bll.GetModel(_id);

            ddlStoreDomain.SelectedValue = model.StoreDomainId.ToString();
            txtName.Text    = model.Name;
            txtManager.Text = model.Manager;
            txtAddress.Text = model.Address;
            txtRemark.Text  = model.Remark;
        }
Пример #11
0
 public Form(Manager.Session Session, Model.Store Store)
     : base(Session)
 {
     this.Store       = Store;
     this.Refresh     = new RefreshCommand(this);
     this.Create      = new CreateCommand(this);
     this.Edit        = new EditCommand(this);
     this.Save        = new SaveCommand(this);
     this.Promote     = new PromoteCommand(this);
     this.Undo        = new UndoCommand(this);
     this.Transaction = null;
 }
        public void Process(Payment source, Model.Payment destination)
        {
            Model.Store store = _storeRepository.GetStoreByName(source.StoreName);
            Model.Order order = _orderRepository.GetOrderByOrderId(source.OrderId);

            if (store != null && order != null)
            {
                destination.StoreId = store.StoreId;
                destination.OrderId = order.OrderId;
                //TODO:  verificar de map permite inserir item na lista do pai
                //order.Payments.Add(destination);
            }
        }
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            LblStoreName.Visibility = LblStoreLocation.Visibility = Visibility.Hidden;
            TxtStoreID.Text         = TxtStoreName.Text = TxtStoreLocation.Text = "";

            try
            {
                CurrentStore          = Logic.DataAccess.GetStores().Where(s => s.StoreID.Equals(StoreID)).FirstOrDefault();
                TxtStoreID.Text       = CurrentStore.StoreID.ToString();
                TxtStoreName.Text     = CurrentStore.StoreName;
                TxtStoreLocation.Text = CurrentStore.StoreLocation;
            }
            catch (Exception ex)
            {
                Commons.LOGGER.Error($"EditStore.xaml.cs Page_Loaded 예외발생 : {ex}");
                Commons.ShowMessageAsync($"예외", $"예외발생 : {ex}");
            }
        }
 private async void Page_Loaded(object sender, RoutedEventArgs e)
 {
     LblStoreName.Visibility = LblStoreLocation.Visibility = Visibility.Hidden; //레이블을 숨기고
     TxtStoreId.Text         = TxtStoreName.Text = TxtStoreLocation.Text = "";  //텍스트를 빈값으로 초기화해준다. 오류가 발생하지 않는 파트이다.
     try
     {
         //Store테이블에서 내용 읽음.
         CurrentStore          = Logic.DataAccess.GetStores().Where(s => s.StoreID.Equals(StoreID)).FirstOrDefault();//First로 하게 되면 값이 없을 때, 오류가 발생하게 됨.
         TxtStoreId.Text       = CurrentStore.StoreID.ToString();
         TxtStoreName.Text     = CurrentStore.StoreName;
         TxtStoreLocation.Text = CurrentStore.StoreLocation;
     }
     catch (Exception ex)
     {
         Commons.LOGGER.Error($"EditStore.xama.cs Page_Loaded 예외발생 : {ex}");
         Commons.ShowMessageAsync("예외", "예외발생");
     }
 }
Пример #15
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            // 입력된 값이 모두 만족하는지 판별하는 플래그
            bool isValid = true;

            // label 숨김
            LblStoreName.Visibility             = LblStoreLocation.Visibility
                                                = Visibility.Hidden;

            var store = new Model.Store();    // 새로운 Store 생성

            // textbox 비었는지 확인 (유효성 체크 Validation check)
            isValid = IsValidInput();

            if (isValid)
            {
                //MessageBox.Show("DB 수정 처리");
                store.StoreName     = TxtStoreName.Text;
                store.StoreLocation = TxtStoreLocation.Text;

                try
                {
                    // DB에 적용
                    var result = Logic.DataAccess.SetStores(store);

                    if (result == 0)
                    {
                        Commons.LOGGER.Error($"AddStore.xaml.cs 창고정보 저장오류 발생");
                        Commons.ShowMessageAsync("오류", "저장시 오류가 발생했습니다.");
                        return;
                    }
                    else
                    {
                        // 정상적 수정됨
                        Commons.ShowMessageAsync("저장", "데이터 베이스에 저장되었습니다.");
                        NavigationService.Navigate(new StoreList());    // 화면 refresh
                    }
                }
                catch (Exception ex)
                {
                    Commons.LOGGER.Error($"예외 발생 : {ex}");
                }
            }
        }
Пример #16
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            lblStoreName.Visibility = lblStoreLocation.Visibility = Visibility.Hidden;
            txtStoreName.Text       = txtStoreLocation.Text = "";
            txtStoreName.Focus();

            try
            {
                CurrentStore          = Logic.DataAccess.GetStores().Where(s => s.StoreID.Equals(StoreID)).FirstOrDefault();
                txtStoreID.Text       = CurrentStore.StoreID.ToString();
                txtStoreName.Text     = CurrentStore.StoreName.ToString();
                txtStoreLocation.Text = CurrentStore.StoreLocation.ToString();
                // store 테이블로부터 내용을 읽어옴.
            }
            catch (Exception ex)
            {
                Common.LOGGER.Error($"예외 발생 StoreEdit_Page_Loaded : 예외 발생 {ex}");
            }
        }
Пример #17
0
        private bool DoAdd()
        {
            bool result = false;
            Model.Store model = new Model.Store();
            BLL.Store bll = new BLL.Store();

            model.StoreDomainId = int.Parse(ddlStoreDomain.SelectedValue);
            model.Name = txtName.Text;
            model.Manager = txtManager.Text;
            model.Address = txtAddress.Text;
            model.Remark = txtRemark.Text;

            if (bll.Add(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加仓库:" + model.Name); //记录日志
                result = true;
            }
            return result;
        }
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            LblStoreName.Visibility = LblStoreLocation.Visibility = Visibility.Hidden;

            // 새로운 회원 정보
            Model.Store store = new Model.Store();

            // 전부 올바르면(유효성 체크)
            if (IsValidInput())
            {
                // DB 입력처리
                CurrentStore.StoreName     = TxtStoreName.Text;
                CurrentStore.StoreLocation = TxtStoreLocation.Text;

                try
                {
                    // SetUser -> System.Data.Entity.Migrations.AddOrUpdate는 바뀐 내용이 없으면 Update하지 않는다!!
                    int result = Logic.DataAccess.SetStore(CurrentStore);

                    if (result == 0)
                    {
                        // Application.Current : System.Windows.Application 현재에 대한 개체(Application 객체값)
                        // Application.Current.MainWindow : System.Windows.Application.MainWindow 와 같은 브라우저에서 호스팅되는 응용 프로그램에서 설정 된 XBAP(XAML
                        // 브라우저 응용 프로그램)합니다.
                        Commons.LOGGER.Error("AddStore.xaml.cs 창고정보 저장오류 발생");
                        ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("창고 수정 실패", "창고 생성에 문제가 발생했습니다. 관리자에게 문의 바랍니다.",
                                                                                         MessageDialogStyle.Affirmative, null);
                    }
                    // 수정 됨
                    else
                    {
                        ((MetroWindow)(Application.Current.MainWindow)).ShowMessageAsync("창고 수정 성공", "창고 수정 완료.",
                                                                                         MessageDialogStyle.Affirmative, null);
                        NavigationService.Navigate(new StoreList());
                    }
                }
                catch (Exception ex)
                {
                    // Commons.LOGGER.Error($"예외발생 : {ex}");
                }
            }
        }
Пример #19
0
        private bool DoEdit(int _id)
        {
            bool result = false;

            BLL.Store   bll   = new BLL.Store();
            Model.Store model = bll.GetModel(_id);

            model.StoreDomainId = int.Parse(ddlStoreDomain.SelectedValue);
            model.Name          = txtName.Text;
            model.Manager       = txtManager.Text;
            model.Address       = txtAddress.Text;
            model.Remark        = txtRemark.Text;

            if (bll.Update(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Edit.ToString(), "修改仓库信息:" + model.Name); //记录日志
                result = true;
            }
            return(result);
        }
Пример #20
0
        private bool DoAdd()
        {
            bool result = false;

            Model.Store model = new Model.Store();
            BLL.Store   bll   = new BLL.Store();

            model.StoreDomainId = int.Parse(ddlStoreDomain.SelectedValue);
            model.Name          = txtName.Text;
            model.Manager       = txtManager.Text;
            model.Address       = txtAddress.Text;
            model.Remark        = txtRemark.Text;

            if (bll.Add(model))
            {
                AddAdminLog(DTEnums.ActionEnum.Add.ToString(), "添加仓库:" + model.Name); //记录日志
                result = true;
            }
            return(result);
        }
Пример #21
0
        public void Create(Model.Store model)
        {
            #region 取資料

            #endregion

            #region 邏輯驗證


            #endregion

            #region 變為Models需要之型別及邏輯資料

            #endregion

            #region Models資料庫
            this._repository.Create(model);
            this._unitOfWork.SaveChange();
            #endregion
        }
Пример #22
0
        private async void btnAdd_Click(object sender, RoutedEventArgs e)
        {
            lblStoreName.Visibility = lblStoreLocation.Visibility = Visibility.Hidden;
            isValid = IsValidInput();


            if (isValid)
            {
                var store = new Model.Store();
                // MessageBox.Show("DB 입력 처리");

                store.StoreName     = txtStoreName.Text;
                store.StoreLocation = txtStoreLocation.Text;

                try
                {
                    var result      = Logic.DataAccess.SetScore(store);
                    var metroWindow = Application.Current.MainWindow as MetroWindow;
                    if (result == 0)
                    {
                        Common.LOGGER.Error("오류", "StoreAdd_btnAdd_Click 오류 발생");
                        await metroWindow.ShowMessageAsync("입력 실패", "창고 입력에 문제가 발생했습니다. \n관리자에게 문의하세요.",
                                                           MessageDialogStyle.Affirmative, null);
                    }
                    else
                    {
                        await metroWindow.ShowMessageAsync("창고 입력 완료", "",
                                                           MessageDialogStyle.Affirmative, null);

                        NavigationService.Navigate(new StoreView());
                    }
                }
                catch (Exception ex)
                {
                    var metroWindow = Application.Current.MainWindow as MetroWindow;
                    await metroWindow.ShowMessageAsync("예외", $"예외 발생 StoreAdd_btnAdd_Click : {ex.Message}");

                    Common.LOGGER.Error($"예외 발생 StoreAdd_btnAdd_Click : {ex}");
                }
            }
        }
        bool IsValid = true;  // 지역 변수를 전역 변수로 설정(i -> I 대문자로 구분)

        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            // 모든 라벨을 숨김
            LblStoreName.Visibility = LblStoreLocation.Visibility = Visibility.Hidden;

            var store = new Model.Store(); // 새롭게 사용자(데이터)가 INSERT되기위해 객체 생성

            IsValid = IsValidInput();      // 컴포넌트들을 제대로 입력했는지 확인(유효성 체크, 개발자에게 제일 중요함!)


            // 유효성 체크(제대로 잘 들어갔는지 확인하는 구문)
            if (IsValid)
            {
                // 컴포넌트에 값이 잘 입력됬으면 입력된 값으로 DB 데이터 수정
                store.StoreName     = TxtStoreName.Text;
                store.StoreLocation = TxtStoreLocation.Text;

                try
                {
                    var result = Logic.DataAccess.SetStore(store);     //Logic.DataAccess.SetUser(user);
                    if (result == 0)
                    {
                        // 사용자 데이터 입력 안됨(비정상적 작동)
                        Commons.LOGGER.Error($"AddStore.xaml.s 창고정보 저장오류 발생");
                        Commons.ShowMessageAsync("오류", "저장시 오류가 발생했습니다.");
                        return;
                    }
                    else
                    {
                        // 정상적으로 수정되면 원래화면(앞에 화면)으로 바꿈
                        NavigationService.Navigate(new StoreList());
                        // NavigationService.Navigate(new UserList());
                    }
                }

                catch (Exception ex)
                {
                    Commons.LOGGER.Error($"예외 발생 : 창고정보 저장 오류 발생 : {ex}");
                }
            }
        }
Пример #24
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            bool isValid = true; // 입력된 값이 모두 만족하는지 판별하는 플래그

            LblStoreLocation.Visibility = LblStoreName.Visibility = Visibility.Hidden;

            var store = new Model.Store();

            isValid = IsValidInput(); // 유효성체크


            if (isValid)
            {
                //MessageBox.Show("DB수정처리!");
                store.StoreName     = TxtStoreName.Text;
                store.StoreLocation = TxtStoreLocation.Text;

                try
                {
                    var result = Logic.DataAccess.SetStore(store); // Logic.DataAccess.SetUser(user);

                    if (result == 0)
                    {
                        //수정 안됨
                        Common.LOGGER.Error("AddStroe.xaml.cs 창고정보 저장오류 발생");
                        Common.ShowMessageAsync("오류", "저장시 오류가 발생했습니다");
                    }
                    else
                    {
                        //정상적 수정됨
                        NavigationService.Navigate(new StoreList());
                    }
                }
                catch (Exception ex)
                {
                    Common.LOGGER.Error($"예외발생 : {ex}");
                }
            }
        }
Пример #25
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e) //(object sender, RoutedEventArgs e) 입력값,  void 출력값 -> 화면상 나타나진않지만 내부에서 실행댐
        {
            LblStoreName.Visibility = LblStoreLocation.Visibility = Visibility.Hidden;


            var store = new Model.Store();

            IsValid = IsValidInput(); //유효성 체크(필수)


            if (IsValid)     //IsValid 값이 (빈값)true 일때만 실행댄다
            {
                // MessageBox.Show("DB 입력처리");
                store.StoreName     = TxtStoreName.Text;
                store.StoreLocation = TxtStoreLocation.Text;


                try
                {
                    var result = Logic.DataAccess.SetStore(store);     //Logic.DataAccess.SetUser(user)
                    if (result == 0)
                    {
                        //수정안댐
                        Commons.LOGGER.Error($"AddStore.xaml.cs 창고정보 저장오류 발생");
                        Commons.ShowMessageAsync("오류", "저장시 오류가 발생했습니다.");
                        return;
                    }
                    else
                    {
                        NavigationService.Navigate(new StoreList());
                    }
                }
                catch (Exception ex)
                {
                    Commons.LOGGER.Error($"예외발생 : {ex}");
                }
            }
        }
Пример #26
0
        private void BtnAdd_Click(object sender, RoutedEventArgs e)
        {
            LblStoreName.Visibility = LblStoreLocation.Visibility = Visibility.Hidden;

            var store = new Model.Store();

            isValid = IsValidInput(); //유효성 체크(필수과정)

            //유효성 체크
            if (isValid)
            {
                //MessageBox.Show("DB 입력처리!");
                store.StoreName     = TxtStoreName.Text;
                store.StoreLocation = TxtStoreLocation.Text;

                try
                {
                    var result = Logic.DataAccess.SetStore(store);
                    if (result == 0)
                    {
                        //수정 안됨
                        Commons.LOGGER.Error("AddStore.xaml.cs에서 창고 정보 저장 오류 발생");
                        Commons.ShowMessageAsync("오류", "저장시 오류가 발생했습니다.");
                        return;
                    }
                    else
                    {
                        //정상적으로 수정되면 원래화면으로 바꿈
                        NavigationService.Navigate(new StoreList());
                    }
                }
                catch (Exception ex)
                {
                    Commons.LOGGER.Error($"예외발생 : {ex}");
                }
            }
        }
Пример #27
0
        public void Update(Model.Store model)
        {
            #region 取資料
            Store query = this.Get(model.ID_Store);
            #endregion

            #region 邏輯驗證
            if (query == null)//沒有資料
            {
                throw new Exception("MessageNoData".ToLocalized());
            }
            #endregion

            #region 變為Models需要之型別及邏輯資料
            query.CX_Store_Name    = model.CX_Store_Name;
            query.NQ_Sort          = model.NQ_Sort;
            query.CX_Store_Remarks = model.CX_Store_Remarks;
            #endregion

            #region Models資料庫
            this._repository.Update(query);
            this._unitOfWork.SaveChange();
            #endregion
        }
Пример #28
0
 public CADStructure(Model.Store Store)
     : base(Store)
 {
 }
Пример #29
0
 public PartCAD(Model.Store Store, IO.Item DBItem)
     : base(Store, DBItem)
 {
 }
Пример #30
0
 public PartCAD(Model.Store Store)
     : base(Store)
 {
 }
Пример #31
0
 public CADStructure(Model.Store Store, IO.Item DBItem)
     : base(Store, DBItem)
 {
 }