Esempio n. 1
0
 private void BuildSearchHeader()
 {
     searchHeader                = new SearchHeader();
     searchHeader.ParentPage     = this;
     searchHeader.OnSearchClick += SearchButton_Clicked;
     mainLayout.Children.Add(searchHeader,
                             Constraint.Constant(0), Constraint.Constant(0));
 }
Esempio n. 2
0
        /// <summary>
        /// 取得内容を各コントロールに設定
        /// </summary>
        /// <param name="ds"></param>
        private void SetTblData(DataSet ds)
        {
            // 移動ヘッダ情報設定
            DataTable tblHd = ds.Tables[T05_HEADER_TABLE_NAME];

            SearchHeader = tblHd.Rows[0];
            SearchHeader.AcceptChanges();

            // 移動明細情報設定
            DataTable tblDtl = ds.Tables[T05_DETAIL_TABLE_NAME];

            SearchDetail = tblDtl;
            SearchDetail.AcceptChanges();

            // データ状態から編集状態を設定
            if (SearchDetail.Select("品番コード > 0").Count() == 0)
            {
                // 新規行を追加
                for (int i = 0; i < 10; i++)
                {
                    DataRow row = SearchDetail.NewRow();
                    row["伝票番号"] = AppCommon.IntParse(tblHd.Rows[0]["伝票番号"].ToString());
                    row["行番号"]  = (i + 1);

                    SearchDetail.Rows.Add(row);
                    //SearchDetail.Rows[i].SetAdded();
                }

                this.MaintenanceMode = AppConst.MAINTENANCEMODE_ADD;
                F6.IsEnabled         = true;
                ChangeKeyItemChangeable(false);     // No.245 Add
                this.txt移動日.Focus();
            }
            else
            {
                this.MaintenanceMode = AppConst.MAINTENANCEMODE_EDIT;
                F6.IsEnabled         = false;

                // 取得明細の自社品番をロック(編集不可)に設定
                foreach (var row in gcSpreadGrid.Rows)
                {
                    if (row.Cells[(int)GridColumnsMapping.自社品番].Value != null &&
                        string.IsNullOrEmpty(row.Cells[(int)GridColumnsMapping.自社品番].Value.ToString()))
                    {
                        row.Cells[(int)GridColumnsMapping.自社品番].Locked = true;
                    }
                }

                ChangeKeyItemChangeable(false);     // No.245 Add
                this.gcSpreadGrid.Focus();
                this.gcSpreadGrid.ActiveCellPosition = new CellPosition(0, (int)GridColumnsMapping.自社品番);
            }
        }
        private void SearchButton_Click(object sender, RoutedEventArgs e)
        {
            foreach (var item in ResultsListView.Items.Cast <object>().ToArray())
            {
                ResultsListView.Items.Remove(item);
            }

            var results = new SearchHeader().Search(DirectoryText.Text.Split(','), RecursiveFlag.IsChecked.Value, FiltersStackPanel.Children.OfType <DynamicFilterUserControl>().Select(x => x.Filter));

            foreach (var result in results)
            {
                ResultsListView.Items.Add(result);
            }
        }
Esempio n. 4
0
        /// <summary>
        /// 取得内容を各コントロールに設定
        /// </summary>
        /// <param name="ds"></param>
        private void SetTblData(DataSet ds)
        {
            // 仕入ヘッダ情報設定
            DataTable tblHd = ds.Tables[HEADER_TABLE_NAME];

            SearchHeader = tblHd.Rows[0];
            SearchHeader.AcceptChanges();

            // 仕入詳細情報設定
            DataTable tblDtl = ds.Tables[DETAIL_TABLE_NAME];

            SearchDetail = tblDtl;
            SearchDetail.AcceptChanges();

            // 消費税情報保持
            taxCalc = new TaxCalculator(ds.Tables[ZEI_TABLE_NAME]);

            // データ状態から編集状態を設定
            if (bool.Parse(SearchHeader["データ状態"].ToString()))
            {
                // 新規の場合は新規行として扱う
                foreach (DataRow row in SearchDetail.Rows)
                {
                    row.SetAdded();
                }

                this.MaintenanceMode = AppConst.MAINTENANCEMODE_ADD;

                this.c返品日.Focus();
            }
            else
            {
                this.MaintenanceMode = AppConst.MAINTENANCEMODE_EDIT;

                // No-94 Add Start
                foreach (var row in gcSpreadGrid.Rows)
                {
                    row.Cells[(int)GridColumnsMapping.税区分].Locked = true;
                }
                // No-94 Add End

                gridCtl.SetCellFocus(0, (int)GridColumnsMapping.自社品番);
            }

            // グリッド内容の再計算を実施
            summaryCalculation();
        }
Esempio n. 5
0
        private void BuildSearchHeader()
        {
            searchHeader = new SearchHeader();
            searchHeader.BackgroundColor         = Color.White;
            searchHeader.filterIcon.IsVisible    = false;
            searchHeader.filtersLayout.IsVisible = true;
            searchHeader.OnSearchClick          += SearchButton_Clicked;

            searchContainer = new RelativeLayout();
            searchContainer.BackgroundColor = Props.BlackoutColor;
            searchContainer.GestureRecognizers.Add(new TapGestureRecognizer((v) => { searchContainer.IsVisible = false; }));
            searchContainer.Children.Add(searchHeader,
                                         Constraint.Constant(0), Constraint.Constant(50));
            mainLayout.Children.Add(searchContainer, Constraint.Constant(0), Constraint.Constant(0),
                                    Constraint.RelativeToParent(p => p.Width), Constraint.RelativeToParent(p => p.Height));
            searchContainer.IsVisible = false;
        }
Esempio n. 6
0
        private void SearchByCreditedAs(List <SearchEntry> rootElements
                                        , OleDbCommand command)
        {
            StringBuilder commandText = new StringBuilder("SELECT DISTINCT FirstName, MiddleName, LastName, OriginalTitle, Title, ProductionYear, CastId, CreditedAs FROM vCastNames WHERE ");

            AppendSearchCondition(commandText, "CreditedAs");

            AddSortOrder(commandText);

            SearchHeader header = new SearchHeader();

            header.FirstName = "Search by Credited As";

            rootElements.Add(header);

            GetSearchResults(command, commandText, header, false);
        }
Esempio n. 7
0
        /// <summary>
        /// 取得内容を各コントロールに設定
        /// </summary>
        /// <param name="ds"></param>
        private void SetTblData(DataSet ds)
        {
            // 出金ヘッダ情報設定
            DataTable tblHd = ds.Tables[T12_HEADER_TABLE_NAME];

            SearchHeader = tblHd.Rows[0];
            SearchHeader.AcceptChanges();

            // 出金明細情報設定
            DataTable tblDtl = ds.Tables[T12_DETAIL_TABLE_NAME];

            SearchDetail = tblDtl;
            SearchDetail.AcceptChanges();

            // データ状態から編集状態を設定
            if (SearchDetail.Select("金種コード > 0").Count() == 0)
            {
                // 新規行を追加
                for (int i = 0; i < 10; i++)
                {
                    DataRow row = SearchDetail.NewRow();
                    row["伝票番号"] = AppCommon.IntParse(tblHd.Rows[0]["伝票番号"].ToString());
                    row["行番号"]  = (i + 1);

                    SearchDetail.Rows.Add(row);
                }

                this.MaintenanceMode = AppConst.MAINTENANCEMODE_ADD;

                this.txt出金日.Focus();
            }
            else
            {
                this.MaintenanceMode = AppConst.MAINTENANCEMODE_EDIT;

                // 金種名称を設定
                int rIdx = 0;
                foreach (DataRow row in SearchDetail.Rows)
                {
                    if (string.IsNullOrEmpty(row["金種コード"].ToString()))
                    {
                        continue;
                    }

                    setSpreadGridValue(rIdx, GridColumnsMapping.金種名, 金種Dic[int.Parse(row["金種コード"].ToString())]);

                    rIdx++;
                }

                // 不足分レコードを追加
                for (int i = SearchDetail.Rows.Count; i < 10; i++)
                {
                    DataRow row = SearchDetail.NewRow();
                    row["伝票番号"] = AppCommon.IntParse(tblHd.Rows[0]["伝票番号"].ToString());
                    row["行番号"]  = (i + 1);

                    SearchDetail.Rows.Add(row);
                }

                this.gcSpreadGrid.Focus();
                this.gcSpreadGrid.ActiveCellPosition = new CellPosition(0, GridColumnsMapping.金種コード.GetHashCode());
            }
        }
Esempio n. 8
0
        /// <summary>
        /// 取得内容を各コントロールに設定
        /// </summary>
        /// <param name="ds"></param>
        private void SetTblData(DataSet ds)
        {
            // 移動ヘッダ情報設定
            DataTable tblHd = ds.Tables[T05_HEADER_TABLE_NAME];

            if (tblHd.Select("出荷元倉庫コード > 0").Count() == 0)
            {
                // 新規追加
                SearchHeader = tblHd.Rows[0];

                this.MaintenanceMode = AppConst.MAINTENANCEMODE_ADD;
            }
            else
            {
                SearchHeader = tblHd.Rows[0];
                SearchHeader.AcceptChanges();

                this.MaintenanceMode = AppConst.MAINTENANCEMODE_EDIT;
            }

            // 移動出庫明細
            DataTable tblOutDtl = ds.Tables[T05_SYUKO_TABLE_NAME];

            // データ状態から編集状態を設定
            if (tblOutDtl.Select("品番コード > 0").Count() == 0)
            {
                // 新規追加
                DataRow row = tblOutDtl.NewRow();
                row["伝票番号"] = AppCommon.IntParse(SearchHeader["伝票番号"].ToString());
                row["行番号"]  = 2;
                row["数量"]   = 0.00;
                tblOutDtl.Rows.Add(row);

                OutSearchDetail = tblOutDtl.Rows[0];
            }
            else
            {
                // 取得データをセット
                OutSearchDetail = tblOutDtl.Rows[0];
                OutSearchDetail.AcceptChanges();

                出庫自社色情報 = tblOutDtl.Rows[0]["自社色"].ToString() + " " + tblOutDtl.Rows[0]["自社色名"].ToString();
            }

            // 移動入庫明細
            DataTable tblInDtl = ds.Tables[T05_NYUKO_TABLE_NAME];

            if (tblInDtl.Select("品番コード > 0").Count() == 0)
            {
                // 新規追加
                DataRow row = tblInDtl.NewRow();
                row["伝票番号"] = AppCommon.IntParse(SearchHeader["伝票番号"].ToString());
                row["行番号"]  = 1;
                row["数量"]   = 0.00;
                tblInDtl.Rows.Add(row);
                InSearchDetail = tblInDtl.Rows[0];
            }
            else
            {
                // 取得データをセット
                InSearchDetail = tblInDtl.Rows[0];
                InSearchDetail.AcceptChanges();

                入庫自社色情報 = tblInDtl.Rows[0]["自社色"].ToString() + " " + tblInDtl.Rows[0]["自社色名"].ToString();
            }
        }
Esempio n. 9
0
        /// <summary>
        /// 取得内容を各コントロールに設定
        /// </summary>
        /// <param name="ds"></param>
        private void SetTblData(DataSet ds)
        {
            // 売上ヘッダ情報設定
            DataTable tblHd = ds.Tables[T02_HEADER_TABLE_NAME];

            SearchHeader = tblHd.Rows[0];
            SearchHeader.AcceptChanges();

            // 売上明細情報設定
            DataTable tblDtl = ds.Tables[T02_DETAIL_TABLE_NAME];

            SearchDetail = tblDtl;
            SearchDetail.AcceptChanges();

            // 消費税情報保持
            taxCalc = new TaxCalculator(ds.Tables[M73_ZEI_TABLE_NAME]);

            // 自社区分取得
            DataTable dtJis = ds.Tables[M70_JIS_TABLE_NAME];

            if (dtJis.Rows.Count > 0)
            {
                _自社区分 = dtJis.Rows[0].Field <int>("自社区分");
            }
            else
            {
                _自社区分 = (int)自社販社区分.販社;  // データが取得できなかった場合は販社として扱う
            }
            // データ状態から編集状態を設定
            if (bool.Parse(SearchHeader["データ状態"].ToString()))
            {
                // 取得データを元に編集する為、RowStatusをAddedとする
                foreach (DataRow row in SearchDetail.Rows)
                {
                    row.SetAdded();
                }

                this.MaintenanceMode = AppConst.MAINTENANCEMODE_ADD;

                this.cmb伝票要否.SelectedIndex = 0;

                // No-94 Add Start
                foreach (var row in gcSpreadGrid.Rows)
                {
                    row.Cells[(int)GridColumnsMapping.税区分].Locked = true;
                }
                // No-94 Add End

                this.txt返品日.Focus();
            }
            else
            {
                this.MaintenanceMode = AppConst.MAINTENANCEMODE_EDIT;

                // 取得明細の自社品番をロック(編集不可)に設定
                foreach (var row in gcSpreadGrid.Rows)
                {
                    row.Cells[(int)GridColumnsMapping.自社品番].Locked  = true;
                    row.Cells[(int)GridColumnsMapping.得意先品番].Locked = true;
                    row.Cells[(int)GridColumnsMapping.税区分].Locked   = true;             // No-94 Add
                }

                gridCtl.SetCellFocus(0, (int)GridColumnsMapping.自社品番);
            }

            // グリッド内容の再計算を実施
            summaryCalculation();
        }
Esempio n. 10
0
        private static void GetSearchResults(OleDbCommand command
                                             , StringBuilder commandText
                                             , SearchHeader header
                                             , Boolean isPending)
        {
            command.CommandText = commandText.ToString();

            using (OleDbDataReader reader = command.ExecuteReader())
            {
                if (reader.HasRows)
                {
                    Dictionary <Int32, List <SearchResult> > results = new Dictionary <Int32, List <SearchResult> >();

                    while (reader.Read())
                    {
                        Int32 castId = reader.GetInt32(6);

                        List <SearchResult> resultList;
                        if (results.TryGetValue(castId, out resultList) == false)
                        {
                            resultList = new List <SearchResult>();

                            results.Add(castId, resultList);
                        }

                        SearchResult result = new SearchResult();

                        if (isPending)
                        {
                            result.CastId = CastListControl.NewId + castId.ToString();
                        }
                        else
                        {
                            result.CastId = castId.ToString();
                        }

                        if (reader.IsDBNull(0) == false)
                        {
                            String temp = reader.GetString(0);

                            MainForm.ClearNull(ref temp);

                            result.FirstName = temp;
                        }

                        if (reader.IsDBNull(1) == false)
                        {
                            String temp = reader.GetString(1);

                            MainForm.ClearNull(ref temp);

                            result.MiddleName = temp;
                        }

                        if (reader.IsDBNull(2) == false)
                        {
                            String temp = reader.GetString(2);

                            MainForm.ClearNull(ref temp);

                            result.LastName = temp;
                        }

                        if (reader.IsDBNull(3) == false)
                        {
                            String temp = reader.GetString(3);

                            MainForm.ClearNull(ref temp);

                            result.Title = temp;
                        }

                        if (String.IsNullOrEmpty(result.Title))
                        {
                            if (reader.IsDBNull(4) == false)
                            {
                                String temp = reader.GetString(4);

                                MainForm.ClearNull(ref temp);

                                result.Title = temp;
                            }
                        }

                        if (reader.IsDBNull(5) == false)
                        {
                            result.ProductionYear = reader.GetInt32(5).ToString();
                        }

                        if (isPending == false)
                        {
                            if (reader.IsDBNull(7) == false)
                            {
                                String temp = reader.GetString(7);

                                MainForm.ClearNull(ref temp);

                                result.CreditedAs = temp;
                            }
                        }

                        resultList.Add(result);
                    }

                    header.ResultList = new List <SearchResult>(results.Count);

                    foreach (KeyValuePair <Int32, List <SearchResult> > kvp in results)
                    {
                        SearchResult subHeader = new SearchResult();

                        subHeader.FirstName  = kvp.Value[0].FirstName;
                        subHeader.MiddleName = kvp.Value[0].MiddleName;
                        subHeader.LastName   = kvp.Value[0].LastName;
                        subHeader.CastId     = kvp.Value[0].CastId;
                        subHeader.Title      = "(CastId: " + kvp.Key.ToString() + ")";
                        subHeader.ResultList = new List <SearchResult>(kvp.Value);

                        header.ResultList.Add(subHeader);
                    }
                }
            }
        }