コード例 #1
0
        static ViewDesignBid()
        {
            dsNBD = new NBDDataSet();
            PROJECTTableAdapter        daProject       = new PROJECTTableAdapter();
            TASKTableAdapter           daTask          = new TASKTableAdapter();
            WORKER_TYPETableAdapter    daWorkerType    = new WORKER_TYPETableAdapter();
            MATERIALTableAdapter       daMaterial      = new MATERIALTableAdapter();
            INVENTORYTableAdapter      daInventory     = new INVENTORYTableAdapter();
            MATERIAL_REQTableAdapter   daMaterialReq   = new MATERIAL_REQTableAdapter();
            CLIENTTableAdapter         daClient        = new CLIENTTableAdapter();
            LABOUR_SUMMARYTableAdapter daLabourSummary = new LABOUR_SUMMARYTableAdapter();

            try
            {
                daProject.Fill(dsNBD.PROJECT);
                daTask.Fill(dsNBD.TASK);
                daWorkerType.Fill(dsNBD.WORKER_TYPE);
                daMaterial.Fill(dsNBD.MATERIAL);
                daInventory.Fill(dsNBD.INVENTORY);
                daMaterialReq.Fill(dsNBD.MATERIAL_REQ);
                daClient.Fill(dsNBD.CLIENT);
                daLabourSummary.Fill(dsNBD.LABOUR_SUMMARY);
            }
            catch { }
        }
コード例 #2
0
        public void AddClient()
        {
            try
            {
                // Make new client row
                NBDDataSet.CLIENTRow r = dsNBD.CLIENT.NewCLIENTRow();
                r.cliName    = txtName.Text.ToString();
                r.cliAddress = txtAddress.Text.ToString();
                if (ddlProvinces.SelectedValue != "-1")
                {
                    r.cliProvince = ddlProvinces.SelectedValue.ToString();
                }
                r.cliPCode       = txtPostal.Text.ToString();
                r.cliPhone       = txtPhone.Text.ToString();
                r.cliConFName    = txtFirst.Text.ToString();
                r.cliConLName    = txtLast.Text.ToString();
                r.cliConPosition = txtPosition.Text.ToString();

                // If city already exists...
                if (ddlCities.SelectedValue != "-2" && ddlCities.SelectedValue != "-1")
                {
                    r.cityID = Convert.ToInt32(ddlCities.SelectedValue.ToString());
                }

                // If city is new, add new row to city
                else if (ddlCities.SelectedValue != "-1")
                {
                    NBDDataSet.CITYRow city = dsNBD.CITY.NewCITYRow();
                    city.city = txtCities.Text.ToString();

                    dsNBD.CITY.Rows.Add(city);
                    CITYTableAdapter daCities = new CITYTableAdapter();
                    daCities.Update(dsNBD.CITY);

                    r.cityID = city.ID;
                }

                // Add row
                dsNBD.CLIENT.Rows.Add(r);

                CLIENTTableAdapter daClients = new CLIENTTableAdapter();
                daClients.Update(dsNBD.CLIENT);

                // Pop up alert
                ScriptManager.RegisterStartupScript(this, this.GetType(),
                                                    "alert",
                                                    "alert('New Client Added!');window.location ='../Clients.aspx';",
                                                    true);
            }
            catch (Exception ex)
            {
                lblMessage.Text = "Unable to add client: " + ex.Message;
            }
        }
コード例 #3
0
        static ClientEntry()
        {
            dsNBD = new NBDDataSet();
            CITYTableAdapter   daCities  = new CITYTableAdapter();
            CLIENTTableAdapter daClients = new CLIENTTableAdapter();

            try
            {
                daCities.Fill(dsNBD.CITY);
                daClients.Fill(dsNBD.CLIENT);
            }
            catch { }
        }
コード例 #4
0
        static NewProject()
        {
            dsNBD = new NBDDataSet();
            CLIENTTableAdapter  daClient  = new CLIENTTableAdapter();
            PROJECTTableAdapter daProject = new PROJECTTableAdapter();

            try
            {
                daClient.Fill(dsNBD.CLIENT);
                daProject.Fill(dsNBD.PROJECT);
            }
            catch { }
        }
コード例 #5
0
        //List<string> controlIDList = new List<string>(); //List to store Control IDs
        //int counter = 0;

        //protected override void LoadViewState(object savedState) //LoadViewState must come before Page_Load
        //{
        //    base.LoadViewState(savedState);

        //    controlIDList = (List<string>)ViewState["controlIDList"]; //Retrieving stored control ID

        //    foreach (string Id in controlIDList)
        //    {
        //        counter++;

        //        List<TextBox> txts = new List<TextBox>();
        //        List<PlaceHolder> phs = new List<PlaceHolder>() { phHTDTask, phHTDDate, phHTDHours, phEHTask,
        //        phEHDate, phEHHours};

        //        CreateTextboxes(txts, phs.Count());

        //        AddTextboxes(Id, phs, txts, false);
        //    }

        //}
        ////Add Hours to Date Button
        //protected virtual void btnAddHTD_Click(object sender, EventArgs e)
        //{

        //    counter++;

        //    List<TextBox> txts = new List<TextBox>();
        //    List<PlaceHolder> phs = new List<PlaceHolder>() { phHTDTask, phHTDDate, phHTDHours};

        //    CreateTextboxes(txts, phs.Count());

        //    foreach (PlaceHolder p in phs)
        //        AddTextboxes(p.ID, phs, txts, true);

        //    ViewState["controlIDList"] = controlIDList; //Storing ID of newly generated textboxes into view state

        //}

        ////Add Estimated Hours to Date button
        //protected void btnAddEH_Click(object sender, EventArgs e)
        //{
        //    counter++;

        //    List<TextBox> txts = new List<TextBox>();
        //    List<PlaceHolder> phs = new List<PlaceHolder>() {  phEHTask, phEHDate, phEHHours};

        //    CreateTextboxes(txts, phs.Count());

        //    foreach (PlaceHolder p in phs)
        //        AddTextboxes(p.ID, phs, txts, true);

        //    ViewState["controlIDList"] = controlIDList; //Storing ID of newly generated textboxes into view state
        //}

        //public void CreateTextboxes(List<TextBox> txts, int txtNumber)
        //{
        //    TextBox[] textboxes = new TextBox[txtNumber];

        //    for (int i = 0; i < txtNumber; i++)
        //    {
        //        textboxes[i] = new TextBox();
        //    }

        //    foreach (TextBox t in textboxes)
        //    {
        //        txts.Add(t);
        //    }
        //}

        //public void AddTextboxes(string Id, List<PlaceHolder> phs, List<TextBox> txts, bool btn)
        //{
        //    for (int i = 0; i < phs.Count(); i++)
        //    {
        //        if (Id.Contains(phs[i].ID.Substring(2)))
        //        {
        //            txts[i].ID = Id;
        //            if (btn == true)
        //                txts[i].ID += counter.ToString();
        //            LiteralControl lineBreak = new LiteralControl("<br /><br />");
        //            phs[i].Controls.Add(lineBreak);
        //            phs[i].Controls.Add(txts[i]);
        //            phs[i].Controls.Add(lineBreak);

        //            if (btn == true)
        //            {
        //                controlIDList.Add(txts[i].ID);
        //            }
        //        }
        //}
        //}

        static DesignBudget()
        {
            //load data at the beginning of the session
            dsNBD = new NBDDataSet();
            CLIENTTableAdapter  daClient  = new CLIENTTableAdapter();
            PROJECTTableAdapter daProject = new PROJECTTableAdapter();

            try
            {
                daClient.Fill(dsNBD.CLIENT);
                daProject.Fill(dsNBD.PROJECT);
            }
            catch { }
        }
コード例 #6
0
        static ViewClients()
        {
            //load data at the beginning of the session
            dsClient = new NBDViewClientDataSet();
            CLIENTTableAdapter  daClient  = new CLIENTTableAdapter();
            PROJECTTableAdapter daProject = new PROJECTTableAdapter();

            try
            {
                daClient.Fill(dsClient.CLIENT);
                daProject.Fill(dsClient.PROJECT);
            }
            catch { }
        }
コード例 #7
0
        static Home()
        {
            dsNBD = new NBDDataSet();
            PROJECTTableAdapter   daProject  = new PROJECTTableAdapter();
            CLIENTTableAdapter    daClient   = new CLIENTTableAdapter();
            WORKERTableAdapter    daWorker   = new WORKERTableAdapter();
            PROD_TEAMTableAdapter daProdTeam = new PROD_TEAMTableAdapter();

            try
            {
                daProject.Fill(dsNBD.PROJECT);
                daClient.Fill(dsNBD.CLIENT);
                daWorker.Fill(dsNBD.WORKER);
                daProdTeam.Fill(dsNBD.PROD_TEAM);
            }
            catch { }
        }
コード例 #8
0
        static DesignBid()
        {
            //load data at the beginning of the session
            dsNBD = new NBDDataSet();
            CLIENTTableAdapter       daClient   = new CLIENTTableAdapter();
            PROJECTTableAdapter      daProject  = new PROJECTTableAdapter();
            MATERIAL_REQTableAdapter daMatReq   = new MATERIAL_REQTableAdapter();
            MATERIALTableAdapter     daMaterial = new MATERIALTableAdapter();

            try
            {
                daClient.Fill(dsNBD.CLIENT);
                daProject.Fill(dsNBD.PROJECT);
                daMatReq.Fill(dsNBD.MATERIAL_REQ);
                daMaterial.Fill(dsNBD.MATERIAL);
            }
            catch { }
        }