コード例 #1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile   = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage        = new Pages(intProfile, dsn);
     oPlatform    = new Platforms(intProfile, dsn);
     oType        = new Types(intProfile, dsn);
     oLocation    = new Locations(intProfile, dsn);
     oAsset       = new Asset(intProfile, dsnAsset);
     oRacks       = new Racks(intProfile, dsn);
     oClasses     = new Classes(intProfile, dsn);
     oRooms       = new Rooms(intProfile, dsn);
     oFloor       = new Floor(intProfile, dsn);
     oEnvironment = new Environments(intProfile, dsn);
     oDepot       = new Depot(intProfile, dsn);
     oDepotRoom   = new DepotRoom(intProfile, dsn);
     oShelf       = new Shelf(intProfile, dsn);
     oUser        = new Users(intProfile, dsn);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (!IsPostBack)
     {
         if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
         {
             LoadLists();
             Load(Int32.Parse(Request.QueryString["id"]));
             txtDate.Text = DateTime.Today.ToShortDateString();
             imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
             btnSubmit.Attributes.Add("onclick", "return ValidateText('" + txtAsset.ClientID + "','Please enter the asset tag')" +
                                      " && ValidateDropDown('" + ddlDepot.ClientID + "','Please make a selection for the location of the asset')" +
                                      " && ValidateText('" + txtDepotRoom.ClientID + "','Please enter the depot room')" +
                                      " && ValidateText('" + txtShelf.ClientID + "','Please enter the shelf')" +
                                      " && ValidateNumber0('" + txtPorts.ClientID + "','Please enter a valid number of available ports')" +
                                      " && ValidateHidden0('" + hdnLocation.ClientID + "','ddlState','Please select a location')" +
                                      " && ValidateText('" + txtRoom.ClientID + "','Please enter the room')" +
                                      " && ValidateText('" + txtRack.ClientID + "','Please enter the rack')" +
                                      " && ValidateText('" + txtRackPosition.ClientID + "','Please enter the rack position')" +
                                      " && ValidateDropDown('" + ddlEnvironment.ClientID + "','Please make a selection for the environment')" +
                                      " && ValidateDropDown('" + ddlClass.ClientID + "','Please make a selection for the current class')" +
                                      " && ValidateText('" + txtName.ClientID + "','Please enter the device name')" +
                                      " && ValidateNumber0('" + txtIP1.ClientID + "','Please enter a valid IP address')" +
                                      " && ValidateNumber0('" + txtIP2.ClientID + "','Please enter a valid IP address')" +
                                      " && ValidateNumber0('" + txtIP3.ClientID + "','Please enter a valid IP address')" +
                                      " && ValidateNumber0('" + txtIP4.ClientID + "','Please enter a valid IP address')" +
                                      " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid date')" +
                                      ";");
             ddlClass.Attributes.Add("onchange", "PopulateEnvironments('" + ddlClass.ClientID + "','" + ddlEnvironment.ClientID + "',0);");
             ddlEnvironment.Attributes.Add("onchange", "UpdateDropDownHidden('" + ddlEnvironment.ClientID + "','" + hdnEnvironment.ClientID + "');");
         }
     }
 }
コード例 #2
0
        public void LoadLists()
        {
            Depot oDepot = new Depot(intProfile, dsn);

            ddlLocation.DataValueField = "id";
            ddlLocation.DataTextField  = "name";
            ddlLocation.DataSource     = oDepot.Gets(1);
            ddlLocation.DataBind();
            DepotRoom oDepotRoom = new DepotRoom(intProfile, dsn);

            ddlRoom.DataValueField = "id";
            ddlRoom.DataTextField  = "name";
            ddlRoom.DataSource     = oDepotRoom.Gets(1);
            ddlRoom.DataBind();
            Shelf oShelf = new Shelf(intProfile, dsn);

            ddlShelf.DataValueField = "id";
            ddlShelf.DataTextField  = "name";
            ddlShelf.DataSource     = oShelf.Gets(1);
            ddlShelf.DataBind();
            Classes oClasses = new Classes(intProfile, dsn);

            ddlClass.DataValueField = "id";
            ddlClass.DataTextField  = "name";
            ddlClass.DataSource     = oClasses.Gets(1);
            ddlClass.DataBind();
            ddlClass.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            Locations oLocation = new Locations(intProfile, dsn);

            ddlLocation.DataValueField = "id";
            ddlLocation.DataTextField  = "fullname";
            if (Request.QueryString["address"] != null)
            {
                ddlLocation.DataSource = oLocation.GetAddresss(1);
            }
            else
            {
                ddlLocation.DataSource = oLocation.GetAddressCommon();
            }
            ddlLocation.DataBind();
            ddlLocation.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            Rooms oRooms = new Rooms(intProfile, dsn);

            ddlRoom.DataValueField = "id";
            ddlRoom.DataTextField  = "name";
            ddlRoom.DataSource     = oRooms.Gets(1);
            ddlRoom.DataBind();
            ddlRoom.Items.Insert(0, new ListItem("-- SELECT --", "0"));
            Racks oRacks = new Racks(intProfile, dsn);

            ddlRack.DataValueField = "id";
            ddlRack.DataTextField  = "name";
            ddlRack.DataSource     = oRacks.Gets(1);
            ddlRack.DataBind();
            ddlRack.Items.Insert(0, new ListItem("-- SELECT --", "0"));
        }
コード例 #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile        = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage             = new Pages(intProfile, dsn);
     oAsset            = new Asset(intProfile, dsnAsset);
     oPlatform         = new Platforms(intProfile, dsn);
     oType             = new Types(intProfile, dsn);
     oModel            = new Models(intProfile, dsn);
     oModelsProperties = new ModelsProperties(intProfile, dsn);
     oDepot            = new Depot(intProfile, dsn);
     oDepotRoom        = new DepotRoom(intProfile, dsn);
     oShelf            = new Shelf(intProfile, dsn);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (Request.QueryString["save"] != null && Request.QueryString["save"] != "")
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "saved", "<script type=\"text/javascript\">alert('Asset Successfully Added');window.navigate('" + oPage.GetFullLink(intPage) + "?pid=" + Request.QueryString["pid"] + "&tid=" + Request.QueryString["tid"] + "&mid=" + Request.QueryString["mid"] + "');<" + "/" + "script>");
     }
     if (Request.QueryString["duplicate"] != null && Request.QueryString["duplicate"] != "")
     {
         Page.ClientScript.RegisterClientScriptBlock(typeof(Page), "duplicated", "<script type=\"text/javascript\">alert('Duplicate Asset Information Found.\\n\\nAnother asset has the same serial number or asset tag as the one you entered. You can locate this device by using the search page.');window.navigate('" + oPage.GetFullLink(intPage) + "?pid=" + Request.QueryString["pid"] + "&tid=" + Request.QueryString["tid"] + "&mid=" + Request.QueryString["mid"] + "');<" + "/" + "script>");
     }
     if (!IsPostBack)
     {
         LoadLists();
         txtDate.Text = DateTime.Today.ToShortDateString();
     }
     imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
     btnSubmit.Attributes.Add("onclick", "return ValidateDropDown('" + ddlModel.ClientID + "','Please make a selection for the model')" +
                              " && ValidateText('" + txtSerial.ClientID + "','Please enter the serial number')" +
                              " && ValidateDropDown('" + ddlDepot.ClientID + "','Please make a selection for the location of the asset')" +
                              " && ValidateText('" + txtDepotRoom.ClientID + "','Please enter the depot room')" +
                              " && ValidateText('" + txtShelf.ClientID + "','Please enter the shelf')" +
                              " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid date')" +
                              " && ValidateNumber0('" + txtPorts.ClientID + "','Please enter a valid number of available ports')" +
                              ";");
 }
コード例 #4
0
 protected void Page_Load(object sender, EventArgs e)
 {
     intProfile = Int32.Parse(Request.Cookies["profileid"].Value);
     oPage      = new Pages(intProfile, dsn);
     oUser      = new Users(intProfile, dsn);
     oAsset     = new Asset(intProfile, dsnAsset);
     oDepot     = new Depot(intProfile, dsn);
     oDepotRoom = new DepotRoom(intProfile, dsn);
     oShelf     = new Shelf(intProfile, dsn);
     if (Request.QueryString["applicationid"] != null && Request.QueryString["applicationid"] != "")
     {
         intApplication = Int32.Parse(Request.QueryString["applicationid"]);
     }
     if (Request.QueryString["pageid"] != null && Request.QueryString["pageid"] != "")
     {
         intPage = Int32.Parse(Request.QueryString["pageid"]);
     }
     if (Request.Cookies["application"] != null && Request.Cookies["application"].Value != "")
     {
         intApplication = Int32.Parse(Request.Cookies["application"].Value);
     }
     if (!IsPostBack)
     {
         if (Request.QueryString["decom"] != null)
         {
             btnCancel.Visible = true;
         }
         if (Request.QueryString["id"] != null && Request.QueryString["id"] != "")
         {
             LoadLists();
             Load(Int32.Parse(Request.QueryString["id"]));
             txtDate.Text = DateTime.Today.ToShortDateString();
             imgDate.Attributes.Add("onclick", "return ShowCalendar('" + txtDate.ClientID + "');");
             radStatusDecom.Attributes.Add("onclick", "ShowHideDiv('" + divDecom1.ClientID + "','inline');ShowHideDiv('" + divDecom2.ClientID + "','inline');ShowHideDiv('" + divDecom3.ClientID + "','inline');");
             radStatusDispose.Attributes.Add("onclick", "ShowHideDiv('" + divDecom1.ClientID + "','none');ShowHideDiv('" + divDecom2.ClientID + "','none');ShowHideDiv('" + divDecom3.ClientID + "','none');");
             btnSubmit.Attributes.Add("onclick", "return ValidateRadioButtons('" + radStatusDecom.ClientID + "','" + radStatusDispose.ClientID + "','Please select an asset status')" +
                                      " && ValidateDate('" + txtDate.ClientID + "','Please enter a valid date')" +
                                      " && (document.getElementById('" + radStatusDecom.ClientID + "').checked == false || (document.getElementById('" + radStatusDecom.ClientID + "').checked == true && ValidateDropDown('" + ddlDecomLocation.ClientID + "','Please make a selection for the depot location')))" +
                                      " && (document.getElementById('" + radStatusDecom.ClientID + "').checked == false || (document.getElementById('" + radStatusDecom.ClientID + "').checked == true && ValidateDropDown('" + ddlRoom.ClientID + "','Please make a selection for the room')))" +
                                      " && (document.getElementById('" + radStatusDecom.ClientID + "').checked == false || (document.getElementById('" + radStatusDecom.ClientID + "').checked == true && ValidateDropDown('" + ddlShelf.ClientID + "','Please make a selection for the shelf on which the asset resides')))" +
                                      ";");
         }
     }
 }
コード例 #5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     Response.Cookies["loginreferrer"].Value   = "/admin/asset/asset_depot_room.aspx";
     Response.Cookies["loginreferrer"].Expires = DateTime.Now.AddDays(30);
     if (Request.Cookies["adminid"] != null && Request.Cookies["adminid"].Value != "")
     {
         intProfile = Int32.Parse(Request.Cookies["adminid"].Value);
     }
     else
     {
         Response.Redirect("/admin/login.aspx");
     }
     oDepotRoom = new DepotRoom(intProfile, dsn);
     if (!IsPostBack)
     {
         LoopRepeater();
         btnOrder.Attributes.Add("onclick", "return OpenWindow('SUPPORTORDER','" + hdnId.ClientID + "','" + hdnOrder.ClientID + "&type=A_ROOM_STOCK" + "',false,400,400);");
         btnDelete.Attributes.Add("onclick", "return confirm('Are you sure you want to delete this item?');");
         btnCancel.Attributes.Add("onclick", "return Cancel();");
     }
 }
コード例 #6
0
        protected int GetDepotRoom(string _name)
        {
            if (_name.Trim() == "")
            {
                return(0);
            }
            DataSet ds = SqlHelper.ExecuteDataset(dsn, CommandType.Text, "SELECT * FROM cv_depot_rooms WHERE name = '" + _name + "' AND enabled = 1 AND deleted = 0");

            if (ds.Tables[0].Rows.Count == 0)
            {
                DepotRoom oDepotRoom = new DepotRoom(intProfile, dsn);
                oDepotRoom.Add(_name, 1);
                sb.Append("<tr><td>-</td><td>Add Depot Room ");
                sb.Append(_name);
                sb.Append("</td></tr>");
                return(GetDepotRoom(_name));
            }
            else
            {
                return(Int32.Parse(ds.Tables[0].Rows[0]["id"].ToString()));
            }
        }