public override global::System.Data.DataTable Clone()
            {
                customersDataTable cln = ((customersDataTable)(base.Clone()));

                cln.InitVars();
                return(cln);
            }
 private void InitClass()
 {
     this.DataSetName             = "dsCustomers";
     this.Prefix                  = "";
     this.Namespace               = "http://tempuri.org/dsCustomers.xsd";
     this.EnforceConstraints      = true;
     this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema;
     this.tablecustomers          = new customersDataTable();
     base.Tables.Add(this.tablecustomers);
 }
 internal void InitVars(bool initTable)
 {
     this.tablecustomers = ((customersDataTable)(base.Tables["customers"]));
     if ((initTable == true))
     {
         if ((this.tablecustomers != null))
         {
             this.tablecustomers.InitVars();
         }
     }
 }
Esempio n. 4
0
        private void SavePriceChanges()
        {
            CustomerAdapter = new customersTableAdapter();
            customersDataTable customerDT = CustomerAdapter.GetCustomerDataByID(CustomerID);
            customersRow       cRow       = (customersRow)customerDT.Rows[0];

            if (!string.IsNullOrWhiteSpace(txtNewPrice.Text))
            {
                float.TryParse(txtNewPrice.Text, out _price);
                cRow.stdHourlyPrice = _price;
            }

            if (!string.IsNullOrWhiteSpace(txtNewPrice.Text))
            {
                float.TryParse(txtNewOvertime1.Text, out _overtime1);
                cRow.stdOvertime1 = _overtime1;
            }

            if (!string.IsNullOrWhiteSpace(txtNewPrice.Text))
            {
                float.TryParse(txtNewOvertime2.Text, out _overtime2);
                cRow.stdOvertime2 = _overtime2;
            }

            CustomerAdapter.Update(customerDT);
            CustomerAdapter.Dispose();

            ActivitiesAdapter = new activitiesTableAdapter();
            activitiesDataTable ActivitiesTable;
            activitiesRow       row;

            foreach (TreeNode Parent in treeViewHourlyRate.Nodes)
            {
                if (Parent.Checked == true)
                {
                    ActivitiesTable = ActivitiesAdapter.GetActivityPriceDataByID((int)Parent.Tag);
                    row             = (activitiesRow)ActivitiesTable.Rows[0];

                    if (!string.IsNullOrWhiteSpace(txtNewPrice.Text))
                    {
                        float.TryParse(txtNewPrice.Text, out _price);
                        row.price = _price;
                    }
                    if (!string.IsNullOrWhiteSpace(txtNewOvertime1.Text))
                    {
                        float.TryParse(txtNewOvertime1.Text, out _overtime1);
                        row.overtime1 = _overtime1;
                    }
                    if (!string.IsNullOrWhiteSpace(txtNewOvertime2.Text))
                    {
                        float.TryParse(txtNewOvertime2.Text, out _overtime2);
                        row.overtime2 = _overtime2;
                    }


                    ActivitiesAdapter.Update(ActivitiesTable);
                    ActivitiesAdapter.Dispose();
                }
                foreach (TreeNode child in Parent.Nodes)
                {
                    if (child.Checked == true)
                    {
                        ActivitiesTable = ActivitiesAdapter.GetActivityPriceDataByID((int)child.Tag);
                        row             = (activitiesRow)ActivitiesTable.Rows[0];
                        if (!string.IsNullOrWhiteSpace(txtNewPrice.Text))
                        {
                            float.TryParse(txtNewPrice.Text, out _price);
                            row.price = _price;
                        }
                        if (!string.IsNullOrWhiteSpace(txtNewOvertime1.Text))
                        {
                            float.TryParse(txtNewOvertime1.Text, out _overtime1);
                            row.overtime1 = _overtime1;
                        }
                        if (!string.IsNullOrWhiteSpace(txtNewOvertime2.Text))
                        {
                            float.TryParse(txtNewOvertime2.Text, out _overtime2);
                            row.overtime2 = _overtime2;
                        }
                        ActivitiesAdapter.Update(ActivitiesTable);
                        ActivitiesAdapter.Dispose();
                    }
                }
            }
        }
 internal customersRow(global::System.Data.DataRowBuilder rb) :
     base(rb)
 {
     this.tablecustomers = ((customersDataTable)(this.Table));
 }