Exemplo n.º 1
0
 private void grid_bind()
 {
     obj = new clsHardware();
     GridView1.DataSource = obj.disp_rec();
     GridView1.DataBind();
     Free_Memory();
 }
Exemplo n.º 2
0
 protected void GridView1_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     obj    = new clsHardware();
     objPrp = new clsHardwarePrp();
     objPrp.Phardware_id = Convert.ToInt32(GridView1.DataKeys[e.RowIndex][0]);
     obj.del_rec(objPrp);
     Free_Memory();
     grid_bind();
 }
Exemplo n.º 3
0
    private void common_grid_bind()
    {
        objHardware = new clsHardware();
        GridView_hardware.DataSource = objHardware.disp_emp_HW_rec(Convert.ToString(Session["id"]));
        GridView_hardware.DataBind();

        objSoftware = new clsSoftware();
        GridView_software.DataSource = objSoftware.disp_emp_SW_rec(Convert.ToString(Session["id"]));
        GridView_software.DataBind();

        objMislaneous = new clsMiscellaneous();
        GridView_miscellaneous.DataSource = objMislaneous.disp_emp_MIS_rec(Convert.ToString(Session["id"]));
        GridView_miscellaneous.DataBind();

        objStationary = new clsStationary();
        GridView_stationary.DataSource = objStationary.disp_emp_Stationary_rec(Convert.ToString(Session["id"]));
        GridView_stationary.DataBind();
    }
Exemplo n.º 4
0
        public void HardwareTest()
        {
            clsHardware hardware = new clsHardware();

            Assert.IsNotNull(hardware);
        }
Exemplo n.º 5
0
    protected void Btn_Submit_Click(object sender, EventArgs e)         // SUBMIT AND UPDATE
    {
        if (Page.IsValid)
        {
            obj    = new clsHardware();
            objPrp = new clsHardwarePrp();
            objPrp.Phardware_name                 = DropDownList5.SelectedValue.ToString();
            objPrp.Phardware_manufacturer         = TextBox2.Text;
            objPrp.Phardware_model                = TextBox3.Text;
            objPrp.Phardware_purchase_date        = Convert.ToDateTime(TextBox4.Text);
            objPrp.Phardware_purchase_file_number = TextBox5.Text;
            if (TextBox6.Text != "" && TextBox7.Text != "")  // warrenty
            {
                objPrp.Phardware_warrenty_from = Convert.ToDateTime(TextBox6.Text);
                objPrp.Phardware_warrenty_to   = Convert.ToDateTime(TextBox7.Text);
            }
            if (TextBox8.Text != "" && TextBox9.Text != "") // AMC
            {
                objPrp.Phardware_annual_maintenance_contract_from = Convert.ToDateTime(TextBox8.Text);
                objPrp.Phardware_annual_maintenance_contract_to   = Convert.ToDateTime(TextBox9.Text);
            }
            objPrp.Phardware_annual_maintenance_contract_detail = TextArea1.Value;
            objPrp.Phardware_annual_maintenance_contract_number = TextBox10.Text;
            objPrp.Phardware_serial_no_or_service_tag_number    = TextBox11.Text;
            objPrp.Phardware_mac_address         = TextBox12.Text;
            objPrp.Phardware_type                = TextBox13.Text;
            objPrp.Phardware_usb_support         = Convert.ToBoolean(DropDownList1.SelectedValue == "Yes" ? true : false);
            objPrp.Phardware_resolution          = TextBox14.Text;
            objPrp.Phardware_night_vision        = Convert.ToBoolean(DropDownList2.SelectedValue == "Yes" ? true : false); //Convert.ToBoolean(DropDownList2.SelectedIndex);
            objPrp.Phardware_processor           = TextBox15.Text;
            objPrp.Phardware_graphics_card       = TextBox16.Text;
            objPrp.Phardware_dvd_writer          = TextBox17.Text;
            objPrp.Phardware_operating_system    = TextBox18.Text;
            objPrp.Phardware_keyboard            = TextBox19.Text;
            objPrp.Phardware_mouse               = TextBox20.Text;
            objPrp.Phardware_hard_disc_size      = TextBox21.Text;
            objPrp.Phardware_ram_size            = TextBox22.Text;
            objPrp.Phardware_monitor             = TextBox23.Text;
            objPrp.Phardware_system_architecture = TextBox24.Text;
            objPrp.Phardware_os_architecture     = TextBox25.Text;
            objPrp.Phardware_screen_guard        = TextBox26.Text;
            objPrp.Phardware_laptop_charger      = TextBox27.Text;
            objPrp.Phardware_ups_rating          = TextBox28.Text;
            objPrp.Phardware_wire_length         = TextBox29.Text;
            objPrp.Phardware_page_yield          = TextBox30.Text;
            objPrp.Phardware_wireless            = Convert.ToBoolean(DropDownList3.SelectedValue == "Yes" ? true : false);                  //---------------------------------------------------------
            objPrp.Phardware_supported_standards = TextBox31.Text;
            // objPrp.Phardware_emp_id
            if (CheckBox4.Checked == false)
            {
                objPrp.Phardware_emp_id = Convert.ToInt32(DropDownList4.SelectedValue);
            }


            // DropDownList1.
            if (Btn_Submit.Text == "Save")
            {
                obj.save_rec(objPrp);
                DropDownList5.Focus();
                //TextBox1.Focus();
            }
            else if (Btn_Submit.Text == "Update")
            {
                objPrp.Phardware_id = Convert.ToInt32(ViewState["Index_Of_Editing_Row"]);
                obj.upd_rec(objPrp);
                Btn_Submit.Text       = "Save";
                Btn_Cancel.Text       = "Reset";
                DropDownList5.Enabled = true;
            }
            clear_rec();
            grid_bind();
            Free_Memory();
        }
    }
Exemplo n.º 6
0
    protected void GridView1_RowEditing(object sender, GridViewEditEventArgs e)
    {
        obj    = new clsHardware();
        objPrp = new clsHardwarePrp();
        ViewState["Index_Of_Editing_Row"] = objPrp.Phardware_id = Convert.ToInt32(GridView1.DataKeys[e.NewEditIndex][0]);
        objPrp = obj.find_rec(objPrp);
        //if (div_hw_entry_form.Visible == false)
        //{
        //    div_hw_entry_form.Visible = true;
        //    GridView1_heading.Visible = false;
        //}
        DropDownList5.Enabled       = false;
        DropDownList5.SelectedValue = objPrp.Phardware_name;
        DropDownList5_SelectedIndexChanged(objPrp.Phardware_name, e);
        TextBox2.Text = objPrp.Phardware_manufacturer;
        TextBox3.Text = objPrp.Phardware_model;
        if (objPrp.Phardware_purchase_date != null)
        {
            TextBox4.Text = Convert.ToString(objPrp.Phardware_purchase_date).Substring(0, 10);
        }
        TextBox5.Text = objPrp.Phardware_purchase_file_number;
        if (objPrp.Phardware_warrenty_from != null && objPrp.Phardware_warrenty_from != null)
        {
            TextBox6.Text = Convert.ToString(objPrp.Phardware_warrenty_from).Substring(0, 10);
            TextBox7.Text = Convert.ToString(objPrp.Phardware_warrenty_to).Substring(0, 10);
        }
        if (objPrp.Phardware_annual_maintenance_contract_from != null && objPrp.Phardware_annual_maintenance_contract_to != null)
        {
            TextBox8.Text = Convert.ToString(objPrp.Phardware_annual_maintenance_contract_from).Substring(0, 10);
            TextBox9.Text = Convert.ToString(objPrp.Phardware_annual_maintenance_contract_to).Substring(0, 10);
        }
        TextArea1.Value             = objPrp.Phardware_annual_maintenance_contract_detail;
        TextBox10.Text              = objPrp.Phardware_annual_maintenance_contract_number;
        TextBox11.Text              = objPrp.Phardware_serial_no_or_service_tag_number;
        TextBox12.Text              = objPrp.Phardware_mac_address;
        TextBox13.Text              = objPrp.Phardware_type;
        DropDownList1.SelectedIndex = Convert.ToInt32(objPrp.Phardware_usb_support == true ? 1 : 2);
        TextBox14.Text              = objPrp.Phardware_resolution;
        DropDownList2.SelectedIndex = Convert.ToInt32(objPrp.Phardware_night_vision == true ? 1 : 2);
        TextBox15.Text              = objPrp.Phardware_processor;
        TextBox16.Text              = objPrp.Phardware_graphics_card;
        TextBox17.Text              = objPrp.Phardware_dvd_writer;
        TextBox18.Text              = objPrp.Phardware_operating_system;
        TextBox19.Text              = objPrp.Phardware_keyboard;
        TextBox20.Text              = objPrp.Phardware_mouse;
        TextBox21.Text              = objPrp.Phardware_hard_disc_size;
        TextBox22.Text              = objPrp.Phardware_ram_size;
        TextBox23.Text              = objPrp.Phardware_monitor;
        TextBox24.Text              = objPrp.Phardware_system_architecture;
        TextBox25.Text              = objPrp.Phardware_os_architecture;
        TextBox26.Text              = objPrp.Phardware_screen_guard;
        TextBox27.Text              = objPrp.Phardware_laptop_charger;
        TextBox28.Text              = objPrp.Phardware_ups_rating;
        TextBox29.Text              = objPrp.Phardware_wire_length;
        TextBox30.Text              = objPrp.Phardware_page_yield;
        DropDownList3.SelectedIndex = Convert.ToInt32(objPrp.Phardware_wireless == true ? 1 : 2);
        TextBox31.Text              = objPrp.Phardware_supported_standards;
        if (objPrp.Phardware_emp_id != 0)
        {
            DropDownList4.SelectedValue = objPrp.Phardware_emp_id.ToString();
            CheckBox4.Checked           = false;
            DropDownList4.Enabled       = true;
        }
        else
        {
            CheckBox4.Checked     = true;
            DropDownList4.Enabled = false;
        }

        Btn_Submit.Text = "Update";
        //Btn_Cancel.Visible = true;
        Btn_Cancel.Text = "Cancel";

        Free_Memory();
    }
Exemplo n.º 7
0
 private void Free_Memory()
 {
     objPrp = null;
     obj    = null;
     GC.Collect();
 }