예제 #1
0
        private void patternGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            if (e.FocusedRowHandle < 0)
            {
                return;
            }

            DataRow row = patternGridView.GetDataRow(e.FocusedRowHandle);

            slaveSet.Fetch(row);

            SetEditValueFromDataSet();
        }
예제 #2
0
        private void DeleteRecipe()
        {
            FbTransaction trans = AppRes.DB.BeginTrans();

            try
            {
                Int64 recipeNo = recipeSet.RecNo;
                masterSet.Select(recipeNo, trans);

                for (int i = 0; i < masterSet.RowCount; i++)
                {
                    masterSet.Fetch(i);

                    slaveSet.MasterPatternNo = masterSet.RecNo;
                    slaveSet.Select(masterSet.RecNo, trans);

                    for (int j = 0; j < slaveSet.RowCount; j++)
                    {
                        slaveSet.Fetch(i);

                        slaveLedSet.SlavePatternNo = slaveSet.RecNo;
                        slaveLedSet.Delete(trans);
                    }

                    slaveSet.Delete(masterSet.RecNo, trans);

                    masterLedSet.MasterPatternNo = masterSet.RecNo;
                    masterLedSet.Delete(trans);
                }

                masterSet.RecipeNo = recipeNo;
                masterSet.Delete(trans);

                smuSet.RecipeNo = recipeNo;
                smuSet.Delete(trans);

                recipeSet.Delete(trans);

                AppRes.DB.CommitTrans();
            }
            catch
            {
                AppRes.DB.RollbackTrans();
            }
        }
예제 #3
0
        private void Load(Int64 recipeNo)
        {
            masterSet.Select(recipeNo);
            masterSet.Fetch(0);

            MasterNo = masterSet.RecipeNo;

            keys  = new Dictionary <Int64, PatternObject>();
            names = new Dictionary <string, PatternObject>();

            slaveSet.Select(MasterNo);
            for (int i = 0; i < slaveSet.RowCount; i++)
            {
                slaveSet.Fetch(i);

                PatternObject item = new PatternObject(slaveSet.RecNo);
                item.RecNo = slaveSet.RecNo;
                item.Name  = slaveSet.Name;
                item.Memo  = slaveSet.Memo;

                keys.Add(item.RecNo, item);
                names.Add(item.Name, item);
            }
        }