コード例 #1
0
    private void LoadData()
    {
        try
        {
            IIPservice service = null;

            // Create service.
            service            = AppService.Create <IIPservice>();
            service.AppManager = this.Master.AppManager;

            // Call service method.
            gvwIPList.DataSource = service.Search(txtIpAddress.Value, txtLocation.Value, ddlLink.Value, ddlStatus.Value);
            gvwIPList.DataBind();


            if (gvwIPList.Rows.Count == 0)
            {
                this.dvinitalvalue.Visible      = true;
                this.hideSpan.InnerHtml         = "";
                this.InitalspnMessage.InnerHtml = "No Data Found";
            }
            else
            {
                this.dvinitalvalue.Visible = false;
            }
        }
        catch { throw; }
    }
コード例 #2
0
    private Boolean UpdateIPconfigInfo(int id)
    {
        IIPservice service = null;

        // Create service.
        service            = AppService.Create <IIPservice>();
        service.AppManager = this.Master.AppManager;
        bool validatelocation = true;

        this.HideStatusMessage(string.Empty, false);
        try
        {
            // Validate the entity values.
            if (this.ValidateControls() == false)
            {
                return(false);
            }
            else
            {
                // create instance

                if (id != 0)
                {
                    service.Update(txtEntityIPAddress.Value, hdnEntityLocationId.Value.ToString(), ddlEntitylink.Value, chkEntityActive.Checked.ToString(), txtEntityReason.Value, Convert.ToInt16(hiddenEntityId.Value.ToString()));
                }

                else
                {
                    service.Update(txtEntityIPAddress.Value, hdnEntityLocationId.Value.ToString(), ddlEntitylink.Value, chkEntityActive.Checked.ToString(), txtEntityReason.Value, 0);
                }

                // clear
                this.ClearControls();
                this.CloseDialogControl();
            }
        }
        catch (ValidationException ve)
        {
            // Display validation erros.

            this.DisplayValidationError(this.ErrorMessage(ve));
            validatelocation = false;
        }



        finally
        {
            if (service != null)
            {
                service.Dispose();
            }
        }
        return(validatelocation);
    }
コード例 #3
0
    private DataTable SearchIP(string IPAddress, string Location, string Linktype, string status)
    {
        IIPservice service = null;

        try
        {
            // Create service.
            service            = AppService.Create <IIPservice>();
            service.AppManager = this.Master.AppManager;

            // Call service method.
            return(service.Search(IPAddress, Location, Linktype, status));
        }
        catch { throw; }
        finally
        {
            if (service != null)
            {
                service.Dispose();
            }
        }
    }
コード例 #4
0
    // Display Location info
    private void DisplayIPInfo(string IPAddress)
    {
        IIPservice service = null;

        try
        {
            // Create service.
            service            = AppService.Create <IIPservice>();
            service.AppManager = this.Master.AppManager;

            // Call service method.
            DataTable dt = service.Search(IPAddress, "", "", "ALL");

            if (dt.Rows.Count > 0)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    hiddenEntityId.Value      = dr["IpId"].ToString();
                    ddlEntitylink.Value       = dr["Linktype"].ToString();
                    txtEntityIPAddress.Value  = dr["IPAddress"].ToString();
                    txtEntityLocation.Value   = dr["Location"].ToString();
                    hdnEntityLocationId.Value = dr["LocationId"].ToString();
                    txtEntityReason.Value     = "";
                    chkEntityActive.Checked   = Convert.ToBoolean(dr["Status"]);
                }
            }
            //Show/Hide the controls.
            //this.ShowHideEditControls(true);
        }
        catch { throw; }
        finally
        {
            if (service != null)
            {
                service.Dispose();
            }
            service = null;
        }
    }