private void LoadInformation() { lblView.Text = oAssetSharedEnvOrder.GetOrderBody(intRequest, intItem, intNumber); //Get the Execution Tab Details DataSet ds = oAssetSharedEnvOrder.Get(intRequest, intItem, intNumber); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; hdnOrderId.Value = dr["OrderId"].ToString(); hdnModel.Value = dr["ModelId"].ToString(); LoadAssetsForOrder(); LoadDataStores(); string strComments = ""; DataSet dsDataStore = oAssetSharedEnvOrder.GetDataStoreSelection(Int32.Parse(hdnOrderId.Value)); if ((oWMServiceTasks.IsWMServiceTaskCompleted(intRequest, intService, intItem, intNumber) == false) || dsDataStore.Tables[0].Rows.Count < 1) { 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(); //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 LoadAssetsForOrder() { DataSet dsAsset = oAsset.GetAssetsByOrder(Int32.Parse(hdnOrderId.Value)); bool boolAssetBurninAndDeployed = true; foreach (DataRow drAssetTemp in dsAsset.Tables[0].Rows) { DataRow drAsset = dtAsset.NewRow(); drAsset["AssetID"] = Int32.Parse(drAssetTemp["id"].ToString()); drAsset["Serial"] = drAssetTemp["serial"].ToString(); drAsset["AssetTag"] = drAssetTemp["asset"].ToString(); drAsset["Returned"] = Int32.Parse(drAssetTemp["returned"].ToString() != "" ? drAssetTemp["returned"].ToString() : "0"); if (drAssetTemp["datestamp"].ToString() != "") { drAsset["ScanDateTime"] = DateTime.Parse(drAssetTemp["datestamp"].ToString()); } if (drAsset["Returned"].ToString() != "1") { string strComments = ""; bool IsAssetStagedAndConfigured = oWMServiceTasks.IsWMServiceTaskCompleted(intRequest, intService, intItem, intNumber, Int32.Parse(drAsset["AssetID"].ToString()), ref strComments); if (IsAssetStagedAndConfigured == false) { drAsset["Comments"] = strComments; drAsset["TaskStatus"] = 0; boolAssetBurninAndDeployed = false; } else { drAsset["TaskStatus"] = 1; } } dtAsset.Rows.Add(drAsset); } if (boolAssetBurninAndDeployed == true && ddlDepot.SelectedValue != "0") { btnComplete.Enabled = true; btnComplete.Visible = true; } else { btnComplete.Visible = false; } dtAsset.DefaultView.Sort = "Serial"; dlAssetList.DataSource = dtAsset; dlAssetList.DataBind(); }
private void LoadInformation() { lblView.Text = oAssetSharedEnvOrder.GetOrderBody(intRequest, intItem, intNumber); //Get the Execution Tab Details DataSet ds = oAssetSharedEnvOrder.Get(intRequest, intItem, intNumber); if (ds.Tables[0].Rows.Count > 0) { DataRow dr = ds.Tables[0].Rows[0]; hdnOrderId.Value = dr["OrderId"].ToString(); VMWare oVMWare = new VMWare(intProfile, dsn); string strHeader = ""; if (dr["OrderType"].ToString() == "1")//Add Cluster -Get folder { strHeader = oVMWare.GetFolder(Int32.Parse(dr["ParentId"].ToString()), "name"); } else if (dr["OrderType"].ToString() == "2")//Add Host -Get Cluster { strHeader = oVMWare.GetCluster(Int32.Parse(dr["ParentId"].ToString()), "name"); } else if (dr["OrderType"].ToString() == "3")//Add Storage -Get Host { strHeader = oVMWare.GetHost(Int32.Parse(dr["ParentId"].ToString()), "name"); } LoadWMServiceTasks(); LoadDataStores(); DataSet dsDataStore = oAssetSharedEnvOrder.GetDataStoreSelection(Int32.Parse(hdnOrderId.Value)); if ((oWMServiceTasks.IsWMServiceTaskCompleted(intRequest, intService, intItem, intNumber) == false) || dsDataStore.Tables[0].Rows.Count < 1) { btnComplete.Visible = false; } else { btnComplete.Enabled = true; btnComplete.Visible = true; } } }