private void LoadInformation() { lblView.Text = oAssetOrder.GetOrderBody(intRequest, intItem, intNumber); //Get the Execution Tab Details DataSet ds = oAssetOrder.Get(intRequest, intItem, intNumber); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; hdnOrderId.Value = dr["OrderId"].ToString(); hdnRequestedQuantity.Value = dr["RequestedQuantity"].ToString(); hdnModel.Value = dr["ModelId"].ToString(); //Populate Existing comments PopulateOrderReqComments(); LoadAssetsForOrder(); if (oWMServiceTasks.IsWMServiceTaskCompleted(intRequest, intService, intItem, intNumber) == false) { btnComplete.Visible = false; } else { btnComplete.Enabled = true; btnComplete.Visible = true; } } }
private void LoadInformation() { lblView.Text = oAssetOrder.GetOrderBody(intRequest, intItem, intNumber); //Get the Execution Tab Details DataSet ds = oAssetOrder.Get(intRequest, intItem, intNumber); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; hdnOrderId.Value = dr["OrderId"].ToString(); hdnRequestedQuantity.Value = dr["RequestedQuantity"].ToString(); hdnModel.Value = dr["ModelId"].ToString(); ddlDepot.SelectedValue = (dr["ReceivedDepotId"].ToString() == "" ? "0" : dr["ReceivedDepotId"].ToString()); //Populate Existing comments PopulateOrderReqComments(); LoadAssetsForOrder(); } }
protected void LoadOrderRequest() { DataSet ds = oAssetOrder.Get(Int32.Parse(hdnOrderId.Value)); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; trRequest.Visible = btnUpdate.Visible = true; btnUpdate.CommandArgument = dr["StatusId"].ToString(); hdnRequestId.Value = dr["RequestId"].ToString(); lblRequestID.Text = "CVT" + hdnRequestId.Value; hdnItemId.Value = dr["ItemId"].ToString(); hdnNumber.Value = dr["Number"].ToString(); rblOrderType.SelectedValue = dr["OrderType"].ToString(); txtDescription.Text = dr["NickName"].ToString(); ddlModel.SelectedValue = dr["ModelId"].ToString(); intModel = Int32.Parse(dr["ModelId"].ToString()); hdnAssetCategoryId.Value = oModelsProperties.Get(intModel, "asset_category"); txtLocation.Text = dr["Location"].ToString(); txtRoom.Text = dr["Room"].ToString(); txtRack.Text = dr["Rack"].ToString(); hdnRackId.Value = dr["RackId"].ToString(); txtRackPos.Text = dr["RackPos"].ToString(); //hdnLocation.Value = dr["LocationId"].ToString(); //ddlRoom.SelectedValue = dr["RoomId"].ToString(); //ddlRack.SelectedValue = dr["RackId"].ToString(); ddlClass.SelectedValue = dr["ClassId"].ToString(); if (dr["ClassId"].ToString() != "") { ddlEnvironment.DataTextField = "name"; ddlEnvironment.DataValueField = "id"; ddlEnvironment.SelectedValue = null; ddlEnvironment.DataSource = oClass.GetEnvironment(Int32.Parse(dr["ClassId"].ToString()), 0); ddlEnvironment.DataBind(); ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0")); hdnEnvironment.Value = (dr["EnvironmentId"].ToString() != "" ? dr["EnvironmentId"].ToString() : "0"); ddlEnvironment.SelectedValue = (dr["EnvironmentId"].ToString() != "" ? dr["EnvironmentId"].ToString() : "0"); } else { hdnEnvironment.Value = (dr["EnvironmentId"].ToString() != "" ? dr["EnvironmentId"].ToString() : "0"); ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0")); ddlEnvironment.SelectedValue = (dr["EnvironmentId"].ToString() != "" ? dr["EnvironmentId"].ToString() : "0"); } ddlResiliency.SelectedValue = dr["ResiliencyId"].ToString(); ddlEnclosure.SelectedValue = dr["EnclosureId"].ToString(); txtEnclosureSlot.Text = dr["EnclosureSlot"].ToString(); ddlOperatingSystemGroup.SelectedValue = dr["OperatingSystemGroupId"].ToString(); txtQuantity.Text = dr["RequestedQuantity"].ToString(); txtRequestedByDate.Text = DateTime.Parse(dr["RequestedByDate"].ToString()).ToShortDateString(); chkClustered.Checked = (dr["IsClustered"].ToString() == "1"); chkBootLuns.Checked = (dr["IsBootLun"].ToString() == "1"); bool boolInProcessOrder = (Int32.Parse(dr["StatusId"].ToString()) == (int)AssestOrderReqStatus.Pending ? true : false); trAssetsSummary.Style.Add("display", "none"); trAssetsSelection.Style.Add("display", "none"); //Load Asset Summary and Selected Assets if ((Int32.Parse(dr["OrderType"].ToString()) == (int)AssetOrderType.ReDeploy) || (Int32.Parse(dr["OrderType"].ToString()) == (int)AssetOrderType.Movement) || (Int32.Parse(dr["OrderType"].ToString()) == (int)AssetOrderType.Dispose)) { if (boolInProcessOrder == true) { PopulateAvailableAssetsSummary(); } else { PopulateSelectedAssetsOnly(); } } //Load Comments PopulateOrderReqComments(); //Verify if request is completed or in progress SetControls((boolInProcessOrder ? false : true), false); btnViewSelection.Enabled = false; if (boolInProcessOrder == false) //For Submitted requests { pnlInfo.Visible = true; lblInfo.Text = ""; btnNewRequest.Visible = true; } } else { trRequest.Visible = btnUpdate.Visible = false; } PopulateLocations(); }
private void LoadInformation() { lblView.Text = oAssetOrder.GetOrderBody(intRequest, intItem, intNumber); //Get the Execution Tab Details DataSet ds = oAssetOrder.Get(intRequest, intItem, intNumber); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; hdnOrderId.Value = dr["OrderId"].ToString(); int intProjectId = 0; Int32.TryParse(dr["ProjectId"].ToString(), out intProjectId); if (Request.QueryString["projectid"] != null) { if (Request.QueryString["projectid"] != "") { Int32.TryParse(Request.QueryString["projectid"], out intProjectId); } else { Page.ClientScript.RegisterStartupScript(typeof(Page), "reload", "<script type=\"text/javascript\">alert('There were " + Request.QueryString["projects"] + " projects found with that project number. Please try again.');<" + "/" + "script>"); } } DataSet dsProject = oProject.Get(intProjectId); if (dsProject.Tables[0].Rows.Count == 1) { txtProjectNumber.Text = dsProject.Tables[0].Rows[0]["number"].ToString(); txtProjectName.Text = dsProject.Tables[0].Rows[0]["name"].ToString(); int intLead = 0; Int32.TryParse(dsProject.Tables[0].Rows[0]["lead"].ToString(), out intLead); if (intLead > 0) { txtProjectManager.Text = oUser.GetFullName(intLead) + " (" + oUser.GetName(intLead) + ")"; txtProjectManager.Enabled = false; } else { txtProjectManager.Enabled = true; } } hdnProjectId.Value = intProjectId.ToString(); txtNickName.Text = dr["NickName"].ToString(); txtModel.Text = dr["ModelName"].ToString(); hdnModel.Value = dr["ModelId"].ToString(); txtQuantity.Text = dr["RequestedQuantity"].ToString(); txtProcureQuantity.Text = dr["ProcureQuantity"].ToString(); txtReDeployQuantity.Text = dr["ReDeployQuantity"].ToString(); txtReturnedQuantity.Text = dr["ReturnedQuantity"].ToString(); txtPurchaseOrderNumber.Text = dr["PurchaseOrderNumber"].ToString(); ddlPurchaseOrderStatus.SelectedValue = (dr["PurchaseOrderStatusId"].ToString() != "" ? dr["PurchaseOrderStatusId"].ToString() : "0"); txtPurchaseOrderDate.Text = (dr["PurchaseOrderDate"].ToString() != "" ? DateTime.Parse(dr["PurchaseOrderDate"].ToString()).ToShortDateString() : ""); txtApprovedQuantity.Text = dr["ApprovedQuantity"].ToString(); txtApprovedOn.Text = (dr["ApprovedOn"].ToString() != "" ? DateTime.Parse(dr["ApprovedOn"].ToString()).ToShortDateString() : ""); if (dr["PurchaseOrderUpload"].ToString() != "") { hypPurchaseOrderUpload.Text = "<img src='/images/file.gif' border='0' align='absmiddle'/> Click here to view the file"; hypPurchaseOrderUpload.NavigateUrl = dr["PurchaseOrderUpload"].ToString(); } else { hypPurchaseOrderUpload.Text = "<img src='/images/alert.gif' border='0' align='absmiddle'/> Please upload a file"; } txtQuoteNumber.Text = dr["QuoteNumber"].ToString(); txtQuoteDate.Text = (dr["QuoteDate"].ToString() != "" ? DateTime.Parse(dr["QuoteDate"].ToString()).ToShortDateString() : ""); txtWarrantyDate.Text = (dr["WarrantyDate"].ToString() != "" ? DateTime.Parse(dr["WarrantyDate"].ToString()).ToShortDateString() : ""); txtSystemPrice.Text = (dr["SystemPrice"].ToString() != "" ? dr["SystemPrice"].ToString() : "0.00"); txtPurchaseOrderPrice.Text = (dr["PurchaseOrderPrice"].ToString() != "" ? dr["PurchaseOrderPrice"].ToString() : "0.00"); txtSalesTax.Text = (dr["SalesTax"].ToString() != "" ? dr["SalesTax"].ToString() : "0.00"); if (dr["ManufacturerQuoteUpload"].ToString() != "") { hypManufacturerQuoteUpload.Text = "<img src='/images/file.gif' border='0' align='absmiddle'/> Click here to view the file"; hypManufacturerQuoteUpload.NavigateUrl = dr["ManufacturerQuoteUpload"].ToString(); } else { hypManufacturerQuoteUpload.Text = "<img src='/images/alert.gif' border='0' align='absmiddle'/> Please upload a file"; } txtVendorTrackingNumber.Text = dr["VendorTrackingNumber"].ToString(); txtVendorOrderDate.Text = (dr["VendorOrderDate"].ToString() != "" ? DateTime.Parse(dr["VendorOrderDate"].ToString()).ToShortDateString() : ""); ddlVendorOrderStatus.SelectedValue = (dr["VendorOrderStatusId"].ToString() != "" ? dr["VendorOrderStatusId"].ToString() : "0"); int intAttentionTo = 0; if (Int32.TryParse(dr["AttentionTo"].ToString(), out intAttentionTo) == true) { if (intAttentionTo > 0) { txtAttentionTo.Text = oUser.GetFullName(intAttentionTo) + " (" + oUser.GetName(intAttentionTo) + ")"; } } hdnAttentionTo.Value = intAttentionTo.ToString(); txtPurchaseOrderComments.Text = dr["PurchaseOrderComments"].ToString(); //if Purchase Order status= Approved and Vendor Order Status = Shipped OR //if Purchase Order status= Rejected Or if Purchase Order status= Skip if ((dr["PurchaseOrderStatusId"].ToString() == "2" && dr["VendorOrderStatusId"].ToString() == "1") || (dr["PurchaseOrderStatusId"].ToString() == "3" || dr["PurchaseOrderStatusId"].ToString() == "4")) { btnComplete.Visible = true; } else { btnComplete.Visible = false; } //Populate Existing comments PopulateOrderReqComments(); } }
private void LoadAssetInformation() { DataSet dsProcurementReq = oAssetOrder.Get(Int32.Parse(hdnOrderId.Value)); if (dsProcurementReq.Tables[0].Rows.Count > 0) { DataRow drProcurementReq = dsProcurementReq.Tables[0].Rows[0]; int intLocation = 0; Int32.TryParse(drProcurementReq["LocationId"].ToString(), out intLocation); string strLocationCommonName = (intLocation > 0 ? oLocation.GetAddress(intLocation, "commonname") : ""); if (strLocationCommonName == "") { lblIntendedLocation.Text = "Intended Location : " + drProcurementReq["Location"].ToString(); } else { lblIntendedLocation.Text = "Intended Location : " + strLocationCommonName; } lblIntendedRoom.Text = "Intended Room : " + drProcurementReq["Room"].ToString(); lblIntendedZone.Text = "Intended Zone : " + drProcurementReq["Zone"].ToString(); lblIntendedRack.Text = "Intended Rack : " + drProcurementReq["Rack"].ToString(); lblIntendedRackPosition.Text = "Intended Rack Position : " + (drProcurementReq["RackPos"].ToString() == "" ? "N / A" : drProcurementReq["RackPos"].ToString()); lblIntendedResiliency.Text = "Intended Resiliency : " + (drProcurementReq["Resiliency"].ToString() == "" ? "N / A" : drProcurementReq["Resiliency"].ToString()); lblIntendedClass.Text = "Intended Class : " + drProcurementReq["Class"].ToString(); lblIntendedEnvironment.Text = "Intended Environment : " + drProcurementReq["Environment"].ToString(); lblIntendedEnclosure.Text = "Intended Enclosure : " + (drProcurementReq["Enclosure"].ToString() == "" ? "N / A" : drProcurementReq["Enclosure"].ToString()); lblIntendedSlot.Text = "Intended Enclosure Slot : " + (drProcurementReq["Enclosure"].ToString() == "" ? "N / A" : drProcurementReq["EnclosureSlot"].ToString()); lblIntendedOperatingSystemGroup.Text = "Intended Operating System Group : " + (drProcurementReq["OperatingSystemGroup"].ToString() == "" ? "Not Specified" : drProcurementReq["OperatingSystemGroup"].ToString()); } DataSet dsAsset = oAsset.GetAssetsAll(Int32.Parse(hdnAssetId.Value)); if (dsAsset.Tables[0].Rows.Count == 1) { DataRow drAsset = dsAsset.Tables[0].Rows[0]; intAsset = Int32.Parse(drAsset["AssetId"].ToString()); lblAssetID.Text = "#" + intAsset.ToString(); string strSerial = drAsset["AssetSerial"].ToString(); string strAsset = drAsset["AssetTag"].ToString(); string strHeader = (strSerial.Length > 15 ? strSerial.Substring(0, 15) + "..." : strSerial); lblHeader.Text = """ + strHeader.ToUpper() + """; Master.Page.Title = "Asset Staging and Configuration (" + strHeader + ")"; lblHeaderSub.Text = "Stage and Configure a asset..."; int intModel = Int32.Parse(drAsset["AssetModelId"].ToString()); int intLocation = 0; Int32.TryParse(drAsset["LocationId"].ToString(), out intLocation); panSwitches.Visible = (oModelsProperties.IsConfigureSwitches(intModel) && oLocation.IsOffsite(intLocation) == false); panSwitchesPending.Visible = false; int intModelParent = Int32.Parse(oModelsProperties.Get(intModel, "modelid")); bool IsDell = oModelsProperties.IsDell(intModel); txtAssetSerial.Text = drAsset["AssetSerial"].ToString(); txtAssetTag.Text = drAsset["AssetTag"].ToString(); txtModel.Text = oModel.Get(intModelParent, "name"); txtModelProperty.Text = drAsset["ModelName"].ToString(); hdnModelPropertyId.Value = drAsset["AssetModelId"].ToString(); hdnAssetCategoryId.Value = drAsset["AssetCategoryId"].ToString(); SetControlsForAssetCategory(IsDell); if (hdnAssetCategoryId.Value == "4") //Rack { txtDeviceName.Text = drAsset["Rack"].ToString(); } else { txtDeviceName.Text = drAsset["AssetName"].ToString(); } ddlClass.SelectedValue = (drAsset["ClassId"].ToString() != "" ? drAsset["ClassId"].ToString() : "0"); if (drAsset["ClassId"].ToString() != "") { ddlEnvironment.DataTextField = "name"; ddlEnvironment.DataValueField = "id"; ddlEnvironment.DataSource = oClass.GetEnvironment(Int32.Parse(drAsset["ClassId"].ToString()), 0); ddlEnvironment.DataBind(); ddlEnvironment.Items.Insert(0, new ListItem("-- SELECT --", "0")); } hdnEnvironment.Value = (drAsset["EnvironmentId"].ToString() != "" ? drAsset["EnvironmentId"].ToString() : "0"); ddlEnvironment.SelectedValue = (drAsset["EnvironmentId"].ToString() != "" ? drAsset["EnvironmentId"].ToString() : "0"); //hdnLocation.Value = (drAsset["LocationId"].ToString() != "" ? drAsset["LocationId"].ToString() : "0"); hdnZoneId.Value = (drAsset["ZoneId"].ToString() != "" ? drAsset["ZoneId"].ToString() : "0"); hdnRackId.Value = (drAsset["RackId"].ToString() != "" ? drAsset["RackId"].ToString() : "0"); txtRackPosition.Text = (drAsset["RackPosition"].ToString() != "" ? drAsset["RackPosition"].ToString() : "0"); populateLocations(); ddlEnclosure.SelectedValue = (drAsset["EnclosureId"].ToString() != "" ? drAsset["EnclosureId"].ToString() : "0"); txtSlot.Text = (drAsset["Slot"].ToString() != "" ? drAsset["Slot"].ToString() : "0"); chkSpare.Checked = (drAsset["Spare"].ToString() == "1" ? true : false); txtILO.Text = drAsset["ILO"].ToString(); txtDummyName.Text = drAsset["DummyName"].ToString(); txtVLAN.Text = (drAsset["vLAN"].ToString() != ""? drAsset["vLAN"].ToString():"0"); ddlBuildNetwork.SelectedValue = (drAsset["BuildNetworkId"].ToString() != "" ? drAsset["BuildNetworkId"].ToString() : "0"); txtOAIP.Text = (drAsset["OAIP"].ToString() != "" ? drAsset["OAIP"].ToString() : ""); ddlResiliency.SelectedValue = (drAsset["resiliencyid"].ToString() != "" ? drAsset["resiliencyid"].ToString() : "0"); ddlOperatingSystemGroup.SelectedValue = (drAsset["operatingsystemgroupid"].ToString() != "" ? drAsset["operatingsystemgroupid"].ToString() : "0"); switch (hdnAssetCategoryId.Value) { case "1": //Physical Server if (IsDell == false) { LoadWorldWidePortNames(intAsset); } break; case "2": //Blade if (IsDell == false) { LoadWorldWidePortNames(intAsset); } break; case "3": //Enclosure break; case "4": //Rack break; default: break; } if (!IsPostBack && panSwitches.Visible == true) { int intRackID = 0; if (Int32.TryParse(drAsset["rackid"].ToString(), out intRackID) == true) { lblSwitchRack.Text = drAsset["rack"].ToString(); lblSwitchRack.ToolTip = drAsset["rackid"].ToString(); DataSet dsSwitches = oAsset.GetSwitchsByRack(intRackID, 1); LoadSwitch(ddlNetwork1, dsSwitches, ddlNetwork1Blade, txtNetwork1FexID, ddlNetwork1Port, txtNetwork1Interface, lblNetwork1Interface, hdnNetwork1Blade, hdnNetwork1Port, SwitchPortType.Network, 1, intAsset); LoadSwitch(ddlNetwork2, dsSwitches, ddlNetwork2Blade, txtNetwork2FexID, ddlNetwork2Port, txtNetwork2Interface, lblNetwork2Interface, hdnNetwork2Blade, hdnNetwork2Port, SwitchPortType.Network, 2, intAsset); LoadSwitch(ddlBackup, dsSwitches, ddlBackupBlade, txtBackupFexID, ddlBackupPort, txtBackupInterface, lblBackupInterface, hdnBackupBlade, hdnBackupPort, SwitchPortType.Backup, 1, intAsset); LoadSwitch(ddlRemote, dsSwitches, ddlRemoteBlade, txtRemoteFexID, ddlRemotePort, txtRemoteInterface, lblRemoteInterface, hdnRemoteBlade, hdnRemotePort, SwitchPortType.Remote, 1, intAsset); LoadSwitch(ddlCluster1, dsSwitches, ddlCluster1Blade, txtCluster1FexID, ddlCluster1Port, txtCluster1Interface, lblCluster1Interface, hdnCluster1Blade, hdnCluster1Port, SwitchPortType.Cluster, 1, intAsset); LoadSwitch(ddlCluster2, dsSwitches, ddlCluster2Blade, txtCluster2FexID, ddlCluster2Port, txtCluster2Interface, lblCluster2Interface, hdnCluster2Blade, hdnCluster2Port, SwitchPortType.Cluster, 2, intAsset); LoadSwitch(ddlStorage1, dsSwitches, ddlStorage1Blade, null, ddlStorage1Port, txtStorage1Interface, null, hdnStorage1Blade, hdnStorage1Port, SwitchPortType.Storage, 1, intAsset); LoadSwitch(ddlStorage2, dsSwitches, ddlStorage2Blade, null, ddlStorage2Port, txtStorage2Interface, null, hdnStorage2Blade, hdnStorage2Port, SwitchPortType.Storage, 2, intAsset); } else { panSwitches.Visible = false; panSwitchesPending.Visible = (oModelsProperties.IsConfigureSwitches(intModel) && oLocation.IsOffsite(intLocation) == false); btnSaveAndClose.Enabled = false; } } } }
protected void populateProcurementRequests() { string strStatusIds = ""; foreach (ListItem oList in lstStatus.Items) { if (oList.Selected == true) { strStatusIds = (strStatusIds == "" ? oList.Value : strStatusIds + "," + oList.Value); } } DataSet ds = oAssetOrder.Get( intPlatform, (ddlModel.SelectedValue != "0" ? Int32.Parse(ddlModel.SelectedValue) : (int?)null), strStatusIds, (txtStartDate.Text.Trim() != "" ? DateTime.Parse(txtStartDate.Text.Trim()) : (DateTime?)null), (txtEndDate.Text.Trim() != "" ? DateTime.Parse(txtEndDate.Text.Trim()) : (DateTime?)null), hdnOrderBy.Value.ToString(), Int32.Parse(hdnOrder.Value.ToString()), Int32.Parse(hdnPageNo.Value), Int32.Parse(hdnRecsPerPage.Value)); dlAssetOrders.DataSource = ds.Tables[0]; dlAssetOrders.DataBind(); if (ds.Tables[0].Rows.Count > 0) { long lngDisplayRecords = Int64.Parse(ds.Tables[0].Rows[0]["rownum"].ToString()) + Int64.Parse((ds.Tables[0].Rows.Count - 1).ToString()); lblRecords.Text = "Showing Results <b>" + ds.Tables[0].Rows[0]["rownum"].ToString() + " - " + lngDisplayRecords.ToString() + "</b> of <b>" + ds.Tables[1].Rows[0]["TotalRecords"].ToString() + "</b>..."; tdNavigation.Visible = true; } else { lblRecords.Text = "No Results Found..."; tdNavigation.Visible = false; } // Calculate total numbers of pages long lngRecsPerPage = Int64.Parse(hdnRecsPerPage.Value); if (lngRecsPerPage != 0) { long lngTotalRecsCount = Int64.Parse(ds.Tables[1].Rows[0]["TotalRecords"].ToString()); long lngPgCount = lngTotalRecsCount / lngRecsPerPage + ((lngTotalRecsCount % lngRecsPerPage) > 0 ? 1 : 0); if (Int32.Parse(hdnRecsPerPage.Value) != 0) { // Display Next button if (lngPgCount - 1 >= Convert.ToInt64(hdnPageNo.Value)) { btnNext.Enabled = true; } else { btnNext.Enabled = false; } // Display Prev button if ((Convert.ToInt64(hdnPageNo.Value)) > 1) { btnPrevious.Enabled = true; } else { btnPrevious.Enabled = false; } } } else { btnNext.Enabled = false; btnPrevious.Enabled = false; } }