예제 #1
0
        public LotView(Site site)
        {
            //This represents if a new Lot is being created for a Site Object
            InitializeComponent();
            try
            {
                mLot = new Lot(db);

            }
            catch (Exception ex)
            {
                MessageBox.Show("Lot Object - " + msgCodes.GetString("M2101") + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            txtAddress.Text = site.GetAddress();
            txtCity.Text = site.GetCity();
            txtServiceSize.Text = ((site.GetServiceSize() == 0) ? "" : "" + site.GetServiceSize());
            unlockForm();
            this.Name = "NewLotView";
            mLot.SetAssociationID(site.GetSiteID());
            DataSet data = db.Select("*", Client.Table, Client.Fields.clientID.ToString() + " = '" + site.GetClientID() + "'");
            data.Read();
            Client client = new Client(data.GetRecordDataSet());
            mLot.SetRoughInValue(client.GetRoughInValue());
            mLot.SetServiceValue(client.GetServiceValue());
            mLot.SetFinalValue(client.GetFinalValue());

            totalPortions[0] = client.GetRoughInValue();
            totalPortions[1] = client.GetServiceValue();
            totalPortions[2] = client.GetFinalValue();
        }
        public LotRepairView(Lot pLot)
        {
            InitializeComponent();
            txtLotNumber.Text = "" + pLot.GetLotNumber();
            txtAddress.Text = pLot.GetAddress();
            txtModel.Text = pLot.GetLotType();

            mLot = pLot;

            cmdSaveEdit.IsEnabled = false;
            cmdSaveEdit.Content = saveBtnTxt;
            isNew = true;
            this.Name = "LotRepairViewNewRepair";
            try
            {
                mRepair = new LotRepair(pLot.GetLotID());
                db.BeginTransaction();
            }
            catch (Exception ex)
            {
                LockFields();
                cmdSaveEdit.IsEnabled = false;
                MessageBox.Show("Loading New Lot Repair - " + msgCodes.GetString("M2102") + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            isModified = false;
            LoadRepairActions();

        }
 private void dgSitesOrLots_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         if (dgSitesOrLots.SelectedCells.Count > 0)
         {
             SelectedItem = null;
             if (cmboType.SelectedIndex == 0)
             {
                 SiteBinding obj = (SiteBinding)dgSitesOrLots.SelectedCells[0].Item;
                 dataGridViewData.SeekToPrimaryKey(obj.siteID);
                 Site siteObj = new Site(dataGridViewData.GetRecordDataSet());
                 SelectedItem = siteObj;
             }
             else
             {
                 LotSelectorBinding obj = (LotSelectorBinding)dgSitesOrLots.SelectedCells[0].Item;
                 dataGridViewData.SeekToPrimaryKey(obj.lotID);
                 Lot lotObj = new Lot(dataGridViewData.GetRecordDataSet());
                 SelectedItem = lotObj;
             }
             RoutedEventArgs args = new RoutedEventArgs(ObjectSelectedEvent);
             RaiseEvent(args);
             this.Close();
         }
     }
 }
 public LotSummaryView(Lot pLot)
 {
     InitializeComponent();
     mLot = pLot;
     LoadSummary();
     LoadRepairs();
 }
 public LotRepairsView(Lot pLot)
 {
     InitializeComponent();
     mLot = pLot;
     LoadRepairs();
     this.Name = "RepairsView" + mLot.GetLotID();
 }
 public TimeSheetView(Lot pLot)
 {
     InitializeComponent();
     mLot = pLot;
     LoadTimeSheets();
     displayOrHideForm();
     LockFields();
     cmdSaveEdit.Content = unlockBtnText;
     cmdSaveEdit.IsEnabled = false;
     cmdCancel.IsEnabled = false;
 }
 public InventoryTransactionView(Lot lot)
 {
     InitializeComponent();
     this.Name = "TransactionViewNewTransaction";
     isNewTransaction = true;
     txtReciever.Text = lot.LotDisplayName();
     displayOrHideForm();
     lockItemFields();
     ClearFields();
     db.BeginTransaction();
     mTransaction = new InventoryTransaction(lot.GetLotID());
     mTransaction.SetClientType(InventoryTransaction.ClientType.Client);
 }
예제 #8
0
 private void dgLots_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         if (dgLots.SelectedIndex > -1)
         {
             LotBinding obj = (LotBinding)dgLots.SelectedCells[0].Item;
             itemRecords.SeekToPrimaryKey(obj.lotID);
             Lot mLot = new Lot(itemRecords.GetRecordDataSet());
             MainWindow.OpenTab(new LotView(mLot), (Image)App.iconSet["home"], mLot.LotDisplayName());
         }
     }
 }
        private void dgLotsCompleted_MouseDown(object sender, MouseButtonEventArgs e)
        {
                if (e.ClickCount == 2)
                {
                    if (dgLotsCompleted.SelectedCells.Count > 0)
                    {
                            LotBinding obj = (LotBinding)dgLotsCompleted.SelectedCells[0].Item;
                            itemRecords.SeekToPrimaryKey(obj.lotID);
                            Lot lotObj = new Lot(itemRecords.GetRecordDataSet());
                            MainWindow.OpenTab(new LotView(lotObj), (Image)App.iconSet["home"], lotObj.LotDisplayName());

                    }
                }
            
        }
        public LotRepairView(LotRepair repair, Lot pLot)
        {
            InitializeComponent();
            txtLotNumber.Text = "" + pLot.GetLotNumber();
            txtAddress.Text = pLot.GetAddress();
            txtModel.Text = pLot.GetLotType();

            mLot = pLot;
            mRepair = repair;

            this.Name = "LotRepairView" + mRepair.GetRepairID();
            LockFields();
            PopulateFields();
            isModified = false;
            cmdSaveEdit.IsEnabled = true;
            cmdCancel.IsEnabled = false;
            cmdSaveEdit.Content = unlockBtnTxt;
            LoadRepairActions();
        }
예제 #11
0
 public LotService(Database db,Lot.LotServices serviceType,String lotID)
     : base(Table, db)
 {
     PrimaryKeyColumns = PrimaryKeys;
     int serviceNum = 0;
     switch (serviceType)
     {
         case Lot.LotServices.RoughIn:
             serviceNum = 0;
             break;
         case Lot.LotServices.Service:
             serviceNum = 1;
             break;
         case Lot.LotServices.Final:
             serviceNum = 2;
             break;
     }
     SetValue(Fields.ServiceType.ToString(), serviceNum);
     SetValue(Fields.lotID.ToString(), lotID);
 }
예제 #12
0
        public LotView(Client client)
        {
            //This represents if a Client is directly creating a Lot Obj
            InitializeComponent();
            try
            {
                mLot = new Lot(db);

            }
            catch (Exception ex)
            {
                MessageBox.Show("Lot Object - " + msgCodes.GetString("M2101") + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
            }
            unlockForm();
            this.Name = "NewLotView";
            mLot.SetAssociationID(client.GetClientID());
            mLot.SetRoughInValue(client.GetRoughInValue());
            mLot.SetServiceValue(client.GetServiceValue());
            mLot.SetFinalValue(client.GetFinalValue());

            totalPortions[0] = client.GetRoughInValue();
            totalPortions[1] = client.GetServiceValue();
            totalPortions[2] = client.GetFinalValue();
        }
        private void dgLabourHours_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (dgLabourHours.SelectedItem != null)
            {
                try
                {
                    if (cmboType.SelectedItem.Equals(builderItem))
                    {
                        SiteMaterialCostsBinding obj = (SiteMaterialCostsBinding)dgLabourHours.SelectedItem;
                        DataSet data = db.Select("*", Site.Table, Site.Fields.siteID.ToString() + " = '" + obj.siteID + "'");
                        if (data.NumberOfRows() == 1)
                        {
                            data.Read();
                            Site site = new Site(data.GetRecordDataSet());

                            data = db.Select("*", Client.Table, Client.Fields.clientID.ToString() + " = '" + site.GetClientID() + "'");
                            data.Read();
                            Client client = new Client(data.GetRecordDataSet());

                            MainWindow.OpenTab(new SiteView(site, client), (Image)App.iconSet["symbol-site"], site.GetSiteName());
                        }
                    }
                    else
                    {
                        LotMaterialCostsBinding obj = (LotMaterialCostsBinding)dgLabourHours.SelectedItem;
                        DataSet data = db.Select("*", Lot.Table, Lot.Fields.lotID.ToString() + " = '" + obj.lotID + "'");
                        if (data.NumberOfRows() == 1)
                        {
                            data.Read();
                            Lot lot = new Lot(data.GetRecordDataSet());
                            MainWindow.OpenTab(new LotView(lot), (Image)App.iconSet["home"], lot.LotDisplayName());
                        }
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error loading selected lot/site - " + msgCodes.GetString("M2102") + " " + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
예제 #14
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["siteObj"] == null)
            {
                Uri req = Request.Url;
                Response.Redirect("http://" + req.Authority + "/portal/Login.aspx");
            }

            NameValueCollection requestParams = this.Request.Params;
            if (requestParams["id"] == null)
            {
                Response.StatusCode = 404;
                Response.End();
                return;
            }
            if (!Formating.TitleCheck(requestParams["id"]))
            {
                Response.StatusCode = 404;
                Response.End();
                return;
            }

            try
            {
                DataSet data = db.Select("*", LotRepair.Table, LotRepair.Fields.repairID.ToString() + " = '" + requestParams["id"] + "'");
                if (data.NumberOfRows() == 0)
                {
                    Response.StatusCode = 404;
                    Response.End();
                    return;
                }
                data.Read();
                LotRepair repair = new LotRepair(data);
                data = db.Select("*", Lot.Table, Lot.Fields.lotID.ToString() + " = '" + repair.GetLotID() + "'");
                data.Read();

                Lot lot = new Lot(data.GetRecordDataSet());


                this.Title = "Work Order " + repair.GetWorkOrder() + " - Ragno Electric";
                this.pageTitle.InnerText = "Work Order " + repair.GetWorkOrder();
                this.tdLotNum.InnerText = "" + lot.GetLotNumber();
                this.tdLotAddress.InnerText = "" + lot.GetAddress();
                this.tdLotModel.InnerText = "" + lot.GetLotType();
                this.tdtLotWorkOrder.InnerText = "" + repair.GetWorkOrder();

                tdApptDate.InnerText = ((repair.GetDateOfAppointment().Equals(DateTime.MinValue)) ? "" : repair.GetDateOfAppointment().ToLongDateString());
                tdApptInspection.InnerText = ((repair.GetInspectionPassed().Equals(DateTime.MinValue)) ? "" : repair.GetInspectionPassed().ToLongDateString());
                tdApptRequested.InnerText = repair.GetRequestedBy();
                tdApptWindow.InnerText = repair.GetWindowOfAppointment();
                tdApptSourceCode.InnerText = repair.GetSourceCode();

                tdClientName.InnerText = repair.GetOwnerName();
                tdClientPhone.InnerText = repair.GetHomeNumber();
                tdClientAltPhone.InnerText = repair.GetAltNumber();
                tdClientEmail.InnerText = repair.GetEmail();

                pageNotes.InnerHtml = repair.GetNotes().Replace(Environment.NewLine,"<br/>");
                String header = "<table width=\"100%\"><tr class=\"rowHeader\"><td>Problem Area</td><td>Description</td><td>Completed Date</td><td>Time</td><td>Action Taken</td></tr>";
                StringBuilder repActionTable = new StringBuilder();
                repActionTable.Append(header);
                data = db.Select("*", LotRepairAction.Table, LotRepairAction.Fields.repairID.ToString() + " = '" + repair.GetRepairID() + "'");
                int actionCount = 0;
                while (data.Read())
                {
                    LotRepairAction action = new LotRepairAction(data.GetRecordDataSet());
                    if (actionCount % 2 == 0)
                    {
                        repActionTable.Append("<tr class=\"itemRow itemRowActions\">");
                    }
                    else
                    {
                        repActionTable.Append("<tr class=\"itemRow itemRowOdd itemRowActions\">");
                    }
                    repActionTable.Append("<td>"+action.GetProblemArea()+"</td>");
                    repActionTable.Append("<td>" + action.GetDescription() + "</td>");
                    repActionTable.Append("<td>" + ((action.GetDate().Equals(DateTime.MinValue)) ? "" : action.GetDate().ToLongDateString()) + "</td>");
                    repActionTable.Append("<td>" + action.GetTime() + "</td>");
                    repActionTable.Append("<td>" + action.GetAction() + "</td>");
                    repActionTable.Append("</tr>");

                    actionCount++;
                }
                repActionTable.Append("</table>");
                pageRepairActions.InnerHtml = repActionTable.ToString();

            }
            catch (Exception)
            {
                Response.StatusCode = 500;
                Response.StatusDescription = "Error loading Repair objects from database.";
                Response.End();
                return;
            }

        }
 private void dgHours_MouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (dgHours.SelectedItem != null)
     {
         LotServicesBilledBinding obj = (LotServicesBilledBinding)dgHours.SelectedItem;
         try
         {
             DataSet data = db.Select("*", Lot.Table, Lot.Fields.lotID.ToString() + " = '" + obj.lotID + "'");
             if (data.NumberOfRows() == 1)
             {
                 data.Read();
                 Lot lot = new Lot(data.GetRecordDataSet());
                 MainWindow.OpenTab(new LotView(lot), (Image)App.iconSet["home"], lot.LotDisplayName());
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Error loading selected lot - " + msgCodes.GetString("M2102") + " " + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
 }
예제 #16
0
 /// <summary>
 /// Handles the event when a lot is double clicked.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void lotGridView_MouseDown(object sender, MouseButtonEventArgs e)
 {
     if (e.ClickCount == 2)
     {
         try
         {
             if (lotGridView.SelectedCells.Count > 0)
             {
                 LotBinding obj = (LotBinding)lotGridView.SelectedCells[0].Item;
                 dataGridViewData.SeekToPrimaryKey(obj.lotID);
                 Lot lotObj = new Lot(dataGridViewData.GetRecordDataSet());
                 MainWindow.OpenTab(new LotView(lotObj));
             }
         }
         catch (Exception ex)
         {
             MessageBox.Show("Loading Clients - " + msgCodes.GetString("M2102") + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
         }
     }
 }
        private void dgRepair_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (dgRepair.SelectedItem != null)
            {
                LotRepairBinding obj = (LotRepairBinding)dgRepair.SelectedItem;
                try
                {
                    DataSet data = db.Select("*", LotRepair.Table, LotRepair.Fields.repairID.ToString() + " = '" + obj.repairID + "'");
                    if (data.NumberOfRows() == 1)
                    {
                        data.Read();
                        LotRepair repair = new LotRepair(data.GetRecordDataSet());

                        data = db.Select("*", Lot.Table, Lot.Fields.lotID.ToString() + " = '" + repair.GetLotID() + "'");
                        data.Read();
                        Lot lot = new Lot(data.GetRecordDataSet());

                        MainWindow.OpenTab(new LotRepairView(repair, lot), (Image)App.iconSet["symbol-repair"], repair.GetWorkOrder());
                    }
                }
                catch (Exception ex)
                {
                    MessageBox.Show("Error loading selected repair - " + msgCodes.GetString("M2102") + " " + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }
        }
예제 #18
0
        public LotView(Lot lot)
        {
            //This represents if the lot is being provided
            InitializeComponent();
            mLot = lot;
            this.Name = "LotView" + mLot.GetLotID();
            lockForm();
            populateFields();
            isNew = false;

            totalPortions[0] = mLot.GetRoughInValue();
            totalPortions[1] = mLot.GetServiceValue();
            totalPortions[2] = mLot.GetFinalValue();

        }
 private void LoadTransaction()
 {
     ClearFields();
     try
     {
         if (mTransaction.GetClientType().Equals(InventoryTransaction.ClientType.Inventory))
         {
             isRestock = true;
             txtReciever.Text = "Inventory";
         }
         else
         {
             DataSet data = db.Select("*", Site.Table, Site.Fields.siteID.ToString() + " = '" + mTransaction.GetAssocID() + "'");
             if (data.NumberOfRows() > 0)
             {
                 data.Read();
                 Site site = new Site(data.GetRecordDataSet());
                 txtReciever.Text = site.GetSiteName();
             }
             else
             {
                 data = db.Select("*", Lot.Table, Lot.Fields.lotID.ToString() + " = '" + mTransaction.GetAssocID() + "'");
                 if (data.NumberOfRows() > 0)
                 {
                     data.Read();
                     Lot lot = new Lot(data.GetRecordDataSet());
                     txtReciever.Text = lot.LotDisplayName();
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Loading Transaction Failed - " + msgCodes.GetString("M2102") + ex.Message, "Error - 2102", MessageBoxButton.OK, MessageBoxImage.Error);
     }
     isTransactionLocked = true;
     dpTransactionDate.Text = mTransaction.GetDateOfTransaction().ToShortDateString();
     dpTransactionDate.IsReadOnly = true;
     LoadDateGrid();
 }