Exemplo n.º 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 { }
        }
        static ProjectAdminReportApproval()
        {
            dsNBD = new NBDDataSet();
            PROJECTTableAdapter        daProjects      = new PROJECTTableAdapter();
            LABOUR_SUMMARYTableAdapter daLabourSummary = new LABOUR_SUMMARYTableAdapter();

            try
            {
                daProjects.Fill(dsNBD.PROJECT);
                daLabourSummary.Fill(dsNBD.LABOUR_SUMMARY);
            }
            catch { }
        }
        static NewProject()
        {
            dsNBD = new NBDDataSet();
            CLIENTTableAdapter  daClient  = new CLIENTTableAdapter();
            PROJECTTableAdapter daProject = new PROJECTTableAdapter();

            try
            {
                daClient.Fill(dsNBD.CLIENT);
                daProject.Fill(dsNBD.PROJECT);
            }
            catch { }
        }
        //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 { }
        }
Exemplo n.º 5
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 { }
        }
Exemplo n.º 6
0
        static ProductionPlanApproval()
        {
            dsNBD = new NBDDataSet();
            PROJECTTableAdapter     daProject    = new PROJECTTableAdapter();
            TASKTableAdapter        daTask       = new TASKTableAdapter();
            WORKER_TYPETableAdapter daWorkerType = new WORKER_TYPETableAdapter();
            MATERIALTableAdapter    daMaterial   = new MATERIALTableAdapter();

            try
            {
                daProject.Fill(dsNBD.PROJECT);
                daTask.Fill(dsNBD.TASK);
                daWorkerType.Fill(dsNBD.WORKER_TYPE);
                daMaterial.Fill(dsNBD.MATERIAL);
            }
            catch { }
        }
Exemplo n.º 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 { }
        }
Exemplo n.º 8
0
        protected void BtnShowBid_Click(object sender, EventArgs e)
        {
            this.lstbidInfo.Items.Clear();
            try
            {
                daproj.Fill(dsnbd.PROJECT, Convert.ToInt32(Session["Data"]));
            }
            catch { }


            foreach (DataRow r in dsnbd.PROJECT)
            {
                this.lstbidInfo.Items.Add("Project Name:" + r.ItemArray[1].ToString() + "   " + "Project Site:" + r.ItemArray[2].ToString() + "   " + "Bid Date:" + r.ItemArray[3].ToString());
            }
            this.lstbidInfo.Visible   = true;
            this.btnBidReport.Visible = true;
        }
Exemplo n.º 9
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 { }
        }
        static DailyWorkReport()
        {
            dsNBD = new NBDDataSet();
            LABOUR_SUMMARYTableAdapter     daLabSum    = new LABOUR_SUMMARYTableAdapter();
            PROJECTTableAdapter            daProject   = new PROJECTTableAdapter();
            TASKTableAdapter               daTask      = new TASKTableAdapter();
            LABOUR_REQUIREMENTTableAdapter daLabourReq = new LABOUR_REQUIREMENTTableAdapter();
            PROD_TEAMTableAdapter          daProdTeam  = new PROD_TEAMTableAdapter();

            try
            {
                daLabSum.Fill(dsNBD.LABOUR_SUMMARY);
                daProject.Fill(dsNBD.PROJECT);
                daTask.Fill(dsNBD.TASK);
                daLabourReq.Fill(dsNBD.LABOUR_REQUIREMENT);
                daProdTeam.Fill(dsNBD.PROD_TEAM);
            }
            catch { }
        }
Exemplo n.º 11
0
        private void LoadProject()
        {
            PROJECTTableAdapter daProject = new PROJECTTableAdapter();

            try { daProject.Fill(dsNBD.PROJECT); }
            catch { }
            rows = dsNBD.PROJECT.Select();

            foreach (DataRow p in rows)
            {
                if (Convert.ToInt32(p.ItemArray[0].ToString()) == 2)
                {
                    int id = Convert.ToInt32(p.ItemArray[0]);

                    double actBudget = Convert.ToDouble(p.ItemArray[9]);
                    double estBudget = Convert.ToDouble(p.ItemArray[8]);
                    double difBudget = (actBudget - estBudget);

                    DateTime estEnd  = Convert.ToDateTime(p.ItemArray[5]);
                    DateTime today   = DateTime.Now;
                    double   difDate = (today - estEnd).TotalDays;

                    lblProject.Text += p.ItemArray[1].ToString();
                    lblStart.Text   += p.ItemArray[6].ToString();
                    lblEnd.Text     += p.ItemArray[5].ToString();
                    lblBudget.Text  += "$" + actBudget.ToString() + "/$" + estBudget.ToString() + " budget spent";
                    lblTeam.Text    += "5 workers in project team";

                    if ((actBudget / estBudget) > 1)
                    {
                        lblBudget.Text     += "  [$" + difBudget.ToString("#.##") + " OVER BUDGET]";
                        lblBudget.ForeColor = System.Drawing.Color.Red;
                    }
                    if ((today > estEnd))
                    {
                        lblEnd.Text     += "  [" + Math.Floor(difDate) + " DAYS OVERDUE]";
                        lblEnd.ForeColor = System.Drawing.Color.Red;
                    }
                }
            }
        }
        static ProductionPlan()
        {
            // Set up data adapters/data set
            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();

            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);
            }
            catch { }
        }