Exemplo n.º 1
0
        //private System.Windows.Forms.BindingSource recipeBindingSource;

        public RecipeEditor(dbDataSet dataSet)
        {
            this.dataSet            = dataSet;
            this.recipeTableAdapter = new Przepisy.dbDataSetTableAdapters.RecipeTableAdapter();
            //this.recipeBindingSource = new Przepisy.dbDataSetTableAdapters.ThingsUneedTableAdapter();
            this.thingsUneedTableAdapter = new Przepisy.dbDataSetTableAdapters.ThingsUneedTableAdapter();
        }
Exemplo n.º 2
0
        public override global::System.Data.DataSet Clone()
        {
            dbDataSet cln = ((dbDataSet)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Exemplo n.º 3
0
                private void UpdateClientInfo(dbDataSet.clientsRow client)
                {
                    dbDataSet.scheduleRulesRow hoursAdd = Db.Instance.dSet.scheduleRules.FindByid(client.plan);

                    client.hoursLeft += hoursAdd.hoursAdd;

                    Db.Instance.AcceptChanges();
                }
        public frmQueryPacketData()
        {
            InitializeComponent();

            if (dbDataSet == null)
            {
                dbDataSet = new dbDataSet();
            }
        }
Exemplo n.º 5
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            dbDataSet ds = new dbDataSet();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Exemplo n.º 6
0
        public IngredientSearcher(string unparsedIngrediance, dbDataSet dataSet)
            : base(unparsedIngrediance, dataSet)
        {
            List <int> ingredientIDlist = getIngredientID(ingredientsList);

            ingredientCount = ingredientIDlist.Count;
            Dictionary <int, int> suggestionList = createSuggestionList(ingredientIDlist);
            var sortedDict = from entry in suggestionList orderby entry.Value descending select entry;

            dict = new Dictionary <int, double>();

            foreach (var entry in sortedDict)
            {
                this.dict.Add(entry.Key, countPercentage(entry.Value));
            }
        }
Exemplo n.º 7
0
        public Form2(int id, dbDataSet dataSet)
        {
            InitializeComponent();
            this.dataSet = dataSet;
            DataRow recipeRow = null;

            foreach (DataRow row in dataSet.Recipe.Rows)
            {
                if ((int)row[0] == id)
                {
                    recipeRow = row;
                }
            }
            textBox2.Text      = (string)recipeRow[1];
            textBox2.TextAlign = HorizontalAlignment.Center;

            richTextBox1.Text = (string)recipeRow[2];

            List <int> idList = new List <int>();

            foreach (DataRow r in dataSet.ThingsUneed.Rows)
            {
                if ((int)r[1] == id)
                {
                    idList.Add((int)r[0]);
                }
            }
            string ingredients = "";

            foreach (int item in idList)
            {
                foreach (DataRow r in dataSet.Ingredient.Rows)
                {
                    if ((int)r[0] == item)
                    {
                        ingredients += r[1].ToString() + ", ";
                    }
                }
            }
            ingredients   = ingredients.Remove(ingredients.Length - 2);
            textBox3.Text = ingredients;
        }
Exemplo n.º 8
0
        private void InitializeIPList()
        {
            string      hostname = Dns.GetHostName();
            IPHostEntry ipHE     = Dns.Resolve(hostname);

            foreach (IPAddress item in ipHE.AddressList)
            {
                cmbIP.Items.Add(item.ToString());
            }

            if (cmbIP.Items.Count > 0)
            {
                cmbIP.SelectedIndex = 0;
            }

            if (db == null)
            {
                db = new dbDataSet();
            }
        }
Exemplo n.º 9
0
 public IngredientChecker(string unparsedingrediance, dbDataSet dataSet) : base(unparsedingrediance, dataSet)
 {
     this.idList = getIngredientIDlist(ingredientsList);
 }
Exemplo n.º 10
0
        private void UpdateTimesLeft(dbDataSet.clientsRow cr)
        {
            Logger.Enter();
            dbDataSet.userPrivilegesRow ur = Db.Instance.dSet.userPrivileges.FindByid(session.UserRoleId);
            if (dbDataSet.userPrivilegesRow.IsSet(ur.clients, UserRights.Write))
            {
                btnEnter.Enabled = true;
                btnChangeCode.Enabled = true;
            }

            textTimesLeft.Text = cr.hoursLeft.ToString();

            bool enabled = (cr.hoursLeft > 0);
            btnEnter.Enabled = enabled && btnEnter.Enabled;
            btnLeave.Enabled = enabled && btnLeave.Enabled;

            textLastEnter.Text = cr.lastEnter.ToString();
            textLastLeave.Text = cr.lastLeave.ToString();

            if (cr.openTicket.Date == DateTime.Now.Date)
            {
                btnEnter.Checked = true;
                btnEnter.Text = Session.GetResStr("cancel");
            }
            Logger.Leave();
        }
Exemplo n.º 11
0
 private void UpdateLastPaymentInfo(dbDataSet.clientsRow cr)
 {
     Logger.Enter();
     String[] paymentInfo = cr.LastPayment;
     textLastPaySum.Text = paymentInfo[0];
     textLastPayDate.Text = paymentInfo[1];
     Logger.Leave();
 }
Exemplo n.º 12
0
            public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedTableSchema(global::System.Xml.Schema.XmlSchemaSet xs)
            {
                global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
                global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
                dbDataSet ds = new dbDataSet();

                global::System.Xml.Schema.XmlSchemaAny any1 = new global::System.Xml.Schema.XmlSchemaAny();
                any1.Namespace       = "http://www.w3.org/2001/XMLSchema";
                any1.MinOccurs       = new decimal(0);
                any1.MaxOccurs       = decimal.MaxValue;
                any1.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any1);
                global::System.Xml.Schema.XmlSchemaAny any2 = new global::System.Xml.Schema.XmlSchemaAny();
                any2.Namespace       = "urn:schemas-microsoft-com:xml-diffgram-v1";
                any2.MinOccurs       = new decimal(1);
                any2.ProcessContents = global::System.Xml.Schema.XmlSchemaContentProcessing.Lax;
                sequence.Items.Add(any2);
                global::System.Xml.Schema.XmlSchemaAttribute attribute1 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute1.Name       = "namespace";
                attribute1.FixedValue = ds.Namespace;
                type.Attributes.Add(attribute1);
                global::System.Xml.Schema.XmlSchemaAttribute attribute2 = new global::System.Xml.Schema.XmlSchemaAttribute();
                attribute2.Name       = "tableTypeName";
                attribute2.FixedValue = "DTSampleDataTable";
                type.Attributes.Add(attribute2);
                type.Particle = sequence;
                global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
                if (xs.Contains(dsSchema.TargetNamespace))
                {
                    global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                    global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                    try {
                        global::System.Xml.Schema.XmlSchema schema = null;
                        dsSchema.Write(s1);
                        for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                        {
                            schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                            s2.SetLength(0);
                            schema.Write(s2);
                            if ((s1.Length == s2.Length))
                            {
                                s1.Position = 0;
                                s2.Position = 0;
                                for (; ((s1.Position != s1.Length) &&
                                        (s1.ReadByte() == s2.ReadByte()));)
                                {
                                    ;
                                }
                                if ((s1.Position == s1.Length))
                                {
                                    return(type);
                                }
                            }
                        }
                    }
                    finally {
                        if ((s1 != null))
                        {
                            s1.Close();
                        }
                        if ((s2 != null))
                        {
                            s2.Close();
                        }
                    }
                }
                xs.Add(dsSchema);
                return(type);
            }
Exemplo n.º 13
0
 private void FillPrivileges(dbDataSet.userPrivilegesRow priv)
 {
     Logger.Enter();
     privilegesGrid.Rows.Clear();
     int nRow = 0;
     nRow = privilegesGrid.Rows.Add(GetRightsRow("Users management", priv.users));
     privilegesGrid.Rows[nRow].Tag = priv.users;
     nRow = privilegesGrid.Rows.Add(GetRightsRow("Manage privileges", priv.privileges));
     privilegesGrid.Rows[nRow].Tag = priv.privileges;
     nRow = privilegesGrid.Rows.Add(GetRightsRow("Manage backup data", priv.backup));
     privilegesGrid.Rows[nRow].Tag = priv.backup;
     nRow = privilegesGrid.Rows.Add(GetRightsRow("Manage clients", priv.clients));
     privilegesGrid.Rows[nRow].Tag = priv.clients;
     nRow = privilegesGrid.Rows.Add(GetRightsRow("Manage payments", priv.payments));
     privilegesGrid.Rows[nRow].Tag = priv.payments;
     nRow = privilegesGrid.Rows.Add(GetRightsRow("Manage trainers", priv.trainers));
     privilegesGrid.Rows[nRow].Tag = priv.trainers;
     nRow = privilegesGrid.Rows.Add(GetRightsRow("Manage schedules", priv.schedule));
     privilegesGrid.Rows[nRow].Tag = priv.schedule;
     nRow = privilegesGrid.Rows.Add(GetRightsRow("Manage statistics", priv.statistics));
     privilegesGrid.Rows[nRow].Tag = priv.statistics;
     Logger.Leave();
 }
Exemplo n.º 14
0
 public IngredientParser(string unparsedingrediance, dbDataSet dataSet)
 {
     this.dataSet = dataSet;
     this.ingredientTableAdapter = new Przepisy.dbDataSetTableAdapters.IngredientTableAdapter();
     ingredientsList             = parseIngrediance(unparsedingrediance);
 }
Exemplo n.º 15
0
 public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs) {
     dbDataSet ds = new dbDataSet();
     global::System.Xml.Schema.XmlSchemaComplexType type = new global::System.Xml.Schema.XmlSchemaComplexType();
     global::System.Xml.Schema.XmlSchemaSequence sequence = new global::System.Xml.Schema.XmlSchemaSequence();
     global::System.Xml.Schema.XmlSchemaAny any = new global::System.Xml.Schema.XmlSchemaAny();
     any.Namespace = ds.Namespace;
     sequence.Items.Add(any);
     type.Particle = sequence;
     global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
     if (xs.Contains(dsSchema.TargetNamespace)) {
         global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
         global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
         try {
             global::System.Xml.Schema.XmlSchema schema = null;
             dsSchema.Write(s1);
             for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext(); ) {
                 schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                 s2.SetLength(0);
                 schema.Write(s2);
                 if ((s1.Length == s2.Length)) {
                     s1.Position = 0;
                     s2.Position = 0;
                     for (; ((s1.Position != s1.Length) 
                                 && (s1.ReadByte() == s2.ReadByte())); ) {
                         ;
                     }
                     if ((s1.Position == s1.Length)) {
                         return type;
                     }
                 }
             }
         }
         finally {
             if ((s1 != null)) {
                 s1.Close();
             }
             if ((s2 != null)) {
                 s2.Close();
             }
         }
     }
     xs.Add(dsSchema);
     return type;
 }
Exemplo n.º 16
0
 public DisplayListCreator(dbDataSet dataSet)
 {
     this.dataSet = dataSet;
 }