protected void ibtn_brand_model_asm_Click(object sender, ImageClickEventArgs e) { _load_brand_model_grid(); btn_Brand_save_amms.Text = "Update"; ImageButton btn1 = (ImageButton)sender; GridViewRow gvr1 = (GridViewRow)btn1.NamingContainer; HiddenField hf_brand_model = (HiddenField)gvr1.FindControl("hf_brand_model_name"); // Label lb1 = (Label)gvr1.FindControl("lbl_brand_model_asm"); HiddenField hf_model = new HiddenField(); hf_model.Value = hf_brand_model.Value; CPU_Details cds = new CPU_Details(); cds.Cpu_model_make = hf_model.Value; AM_DB_Tranactions ad = new AM_DB_Tranactions(); DataTable dt = ad.view_Cpu_brand_model_edit_dispaly(cds); if (dt.Rows.Count > 0) { ddl_product_type_amms.SelectedItem.Value = dt.Rows[0]["bbm_brand_id"].ToString(); txt_Brand_amms.Text = dt.Rows[0]["bbm_model"].ToString(); } else { txt_Brand_amms.Text = string.Empty; } }
public List <CPU_Details> hia() { try { List <CPU_Details> obj = new List <CPU_Details>(); SqlCommand cmd = new SqlCommand("select * from tbl_Brand_Master", amon); cmd.CommandType = CommandType.Text; SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); foreach (DataRow item in dt.Rows) { CPU_Details clsobj = new CPU_Details(); clsobj.Cpu_brand_id = Convert.ToInt32(item["BM_id"]); clsobj.CPU_IP_ADDRESS = item["bm_brand"].ToString(); obj.Add(clsobj); } return(obj); //return dt; } catch (Exception) { throw; } }
protected void btn_processor_speed_asm_Click(object sender, EventArgs e) { if (!string.IsNullOrWhiteSpace(txt_processor_speed_asm.Text.ToString())) { CPU_Details cds = new CPU_Details(); cds.Cpu_brand_id = Convert.ToInt32(ddl_processor_Name_asm.SelectedItem.Value); cds.CPU_PROCESSOR_SPEED = txt_processor_speed_asm.Text.ToString(); cds.CPU_ITEM_CREATEDBY = "ahammed"; int i = adt.insert_Processor_speed(cds); if (i == 1) { // ScriptManager.RegisterClientScriptBlock(btn_product_type_Save, this.GetType(), "AlertMsg", "<script language='javascript'>alert('processor Name Saved Sucessfully');</script>", false); txt_processor_name_asm.Text = string.Empty; _load_processorName_grid(); } else { // ScriptManager.RegisterClientScriptBlock(btn_product_type_Save, this.GetType(), "AlertMsg", "<script language='javascript'>alert('Try a.... New Processor Name');</script>", false); txt_processor_name_asm.Text = string.Empty; _load_processorName_grid(); } } else { ScriptManager.RegisterStartupScript(this, GetType(), "msgbox", "typething();", true); } }
protected void ibtn_brand_asm_Click(object sender, ImageClickEventArgs e) { // btn_product_type_Save.Text = "Update"; ImageButton btn = (ImageButton)sender; GridViewRow gvr = (GridViewRow)btn.NamingContainer; HiddenField hf_brand = (HiddenField)gvr.FindControl("hf_brand_id"); HiddenField hf_val = new HiddenField(); hf_val.Value = hf_brand.Value; CPU_Details cds = new CPU_Details(); cds.Cpu_brand_id = Convert.ToInt32(hf_val.Value); AM_DB_Tranactions ad = new AM_DB_Tranactions(); DataTable dt = ad.view_Cpu_brand_edit_dispaly(cds); if (dt.Rows.Count > 0) { lbl_brand_id.Text = dt.Rows[0]["bm_id"].ToString(); ViewState["bm_brand_id"] = dt.Rows[0]["bm_id"].ToString(); txt_product_amms.Text = dt.Rows[0]["bm_brand"].ToString(); } else { txt_product_amms.Text = string.Empty; } }
public void _load_brand_model_grid() { CPU_Details cu1 = new CPU_Details(); cu1.Cpu_am_id3 = ddl_products_asm.SelectedItem.Value; DataTable dt = adt.view_brand_model(cu1); gv_brand_info_amms.DataSource = dt; gv_brand_info_amms.DataBind(); }
public void _load_brand_grid() { CPU_Details cu1 = new CPU_Details(); cu1.Brandidinc = ddl_products_asm.SelectedItem.Value; DataTable dt = adt.view_brands_byid(cu1); gv_products_type_info.DataSource = dt; gv_products_type_info.DataBind(); }
public void _load_brand_model_ddl() { CPU_Details cu1 = new CPU_Details(); cu1.Brandidinc = ddl_products_asm.SelectedItem.Value; DataTable dt = adt.view_brands_byid(cu1); ddl_product_type_amms.DataSource = dt; ddl_product_type_amms.DataTextField = "bm_brand"; ddl_product_type_amms.DataValueField = "type_id"; ddl_product_type_amms.DataBind(); }
public DataTable view_Cpu_brand_model_edit_dispaly(CPU_Details cu) { try { SqlCommand cmd = new SqlCommand("pro_view_brand_model_byID_cpu", amon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@bm_model", cu.Cpu_model_make)); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); return(dt); } catch (Exception) { throw; } }
public DataTable view_brand_model(CPU_Details cu) { try { SqlCommand cmd = new SqlCommand("pro_view_brand_model", amon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@modelinc3", cu.Cpu_am_id3)); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); return(dt); } catch (Exception) { throw; } }
public DataTable view_brands_byid(CPU_Details cu) { try { SqlCommand cmd = new SqlCommand("pro_view_Brands_byID", amon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@brandinc", cu.Brandidinc)); SqlDataAdapter da = new SqlDataAdapter(cmd); DataTable dt = new DataTable(); da.Fill(dt); return(dt); } catch (Exception) { throw; } }
public int insert_Processor_Name(CPU_Details cu) { try { SqlCommand cmd = new SqlCommand("pro_insert_Processor_Name", amon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@processor_Name", cu.CPU_PROCESSOR_MODEL)); cmd.Parameters.Add(new SqlParameter("@processor_createdby", cu.CPU_ITEM_CREATEDBY)); amon.Open(); return((int)cmd.ExecuteScalar()); } catch (Exception) { throw; } finally { amon.Close(); } }
public String Upadte_brand_Name_cpu(CPU_Details cu) { try { SqlCommand cmd = new SqlCommand("pro_Update_brand_Name", amon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@bm_id", cu.Cpu_brand_id)); cmd.Parameters.Add(new SqlParameter("@brand_name", cu.CPU_BRAND_MAKE)); amon.Open(); return(cmd.ExecuteScalar().ToString()); } catch (Exception) { throw; } finally { amon.Close(); } }
public String insert_brand_Name_cpu(CPU_Details cu) { try { SqlCommand cmd = new SqlCommand("pro_insert_barnd_Master_cpu", amon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@brandtype", cu.Cpu_am_id2)); cmd.Parameters.Add(new SqlParameter("@bmbrand", cu.CPU_BRAND_MAKE)); cmd.Parameters.Add(new SqlParameter("@cdby", cu.CPU_ITEM_CREATEDBY)); amon.Open(); return(cmd.ExecuteScalar().ToString()); } catch (Exception) { throw; } finally { amon.Close(); } }
public int insert_barnd_Model_cpu(CPU_Details cu) { try { SqlCommand cmd = new SqlCommand("pro_insert_Brand_Model_Master", amon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@bm_brand_id", cu.Cpu_am_id2)); // cmd.Parameters.Add(new SqlParameter("@bbm_type",cu.Cpu_am_id3)); cmd.Parameters.Add(new SqlParameter("@bm_model", cu.CPU_BRAND_MAKE)); cmd.Parameters.Add(new SqlParameter("@cdby", cu.CPU_ITEM_CREATEDBY)); cmd.Parameters.Add(new SqlParameter("@brandninc", cu.Brandidinc)); amon.Open(); return((int)cmd.ExecuteScalar()); } catch (Exception) { throw; } finally { amon.Close(); } }
public String insertCpuDetails(CPU_Details cd) { try { SqlCommand cmd = new SqlCommand("pro_insert_cpu_details", amon); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.Add(new SqlParameter("@cpu_AssetCode", cd.CPU_ASSETCODE)); cmd.Parameters.Add(new SqlParameter("@Cpu_Product_Number", cd.CPU_PRODUCT_NUMBER)); cmd.Parameters.Add(new SqlParameter("@Cpu_Serial_Number", cd.CPU_SERIAL_NUMBER)); cmd.Parameters.Add(new SqlParameter("@Cpu_PR_Number", cd.CPU_PR_NUMBER)); cmd.Parameters.Add(new SqlParameter("@Cpu_Voucher_Number", cd.CPU_VOUCHER_NUMBER)); cmd.Parameters.Add(new SqlParameter("@Cpu_Model", cd.CPU_MODEL)); cmd.Parameters.Add(new SqlParameter("@Cpu_Brand_Make", cd.CPU_BRAND_MAKE)); cmd.Parameters.Add(new SqlParameter("@Cpu_Receive_Date", cd.CPU_RECEIVE_DATE)); cmd.Parameters.Add(new SqlParameter("@Cpu_Warranty_Start_Date", cd.CPU_WARRANTY_START_DATE)); cmd.Parameters.Add(new SqlParameter("@Cpu_Warranty_End_Date", cd.CPU_WARRANTY_END_DATE)); cmd.Parameters.Add(new SqlParameter("@Cpu_IP_Address", cd.CPU_IP_ADDRESS)); cmd.Parameters.Add(new SqlParameter("@Cpu_MAC_ID", cd.CPU_MAC_ID)); cmd.Parameters.Add(new SqlParameter("@Cpu_Host_Name", cd.CPU_HOST_NAME)); cmd.Parameters.Add(new SqlParameter("@Cpu_Domain_Name_group", cd.CPU_DOMAIN_NAME_GROUP)); cmd.Parameters.Add(new SqlParameter("@Cpu_processor_SerialNumber", cd.CPU_SERIAL_NUMBER)); cmd.Parameters.Add(new SqlParameter("@Cpu_processor_Model", cd.CPU_PROCESSOR_MODEL)); // cmd.Parameters.Add(new SqlParameter("@Cpu_processor_Type", cd.CPU_PROCESSOR_TYPE)); cmd.Parameters.Add(new SqlParameter("@Cpu_processor_Speed", cd.CPU_PROCESSOR_SPEED)); cmd.Parameters.Add(new SqlParameter("@cpu_item_CreatedBy", cd.CPU_ITEM_CREATEDBY)); amon.Open(); return(cmd.ExecuteScalar().ToString()); } catch (Exception) { throw; } finally { amon.Close(); } }
/// <summary> /// Products Types Insertions /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btn_product_type_Save_amms_Click(object sender, EventArgs e) { string strptymessage = ""; if (btn_product_type_Save_amms.Text == "Save") { if (!string.IsNullOrWhiteSpace(txt_product_type_amms.Text.ToString())) { objs.Prfk_id = Convert.ToInt32(ddl_products_asm.SelectedItem.Value); objs.Pr_type_Name = txt_product_type_amms.Text.ToString(); string shname = txt_product_type_amms.Text.ToString(); // shname.Substring(0, 2); objs.Pr_type_SH_name = shname.Substring(0, 3).ToString(); objs.Pr_type_created_by = "ahammed"; int i = amdb._insert_product_type_info(objs); if (i == 1) { strptymessage = "Product Type " + txt_product_type_amms.Text + " Inserted Sucessfully"; ScriptManager.RegisterClientScriptBlock(btn_product_type_Save_amms, this.GetType(), "AlertMsg", "<script language='javascript'>alert('" + strptymessage + "');</script>", false); txt_product_type_amms.Text = string.Empty; _load_products_types_byid(); } else if (i == 0) { ScriptManager.RegisterClientScriptBlock(btn_product_type_Save_amms, this.GetType(), "AlertMsg", "<script language='javascript'>alert('!---!-----Try Again-----');</script>", false); // _load_brand_ddl(); _load_products_types_grid(); txt_product_type_amms.Text = string.Empty; } else { ScriptManager.RegisterClientScriptBlock(btn_product_type_Save_amms, this.GetType(), "AlertMsg", "<script language='javascript'>alert('Some Thing was Wrong');</script>", false); // _load_brand_ddl(); _load_products_types_grid(); txt_product_type_amms.Text = string.Empty; } } else { string textmess = "Please Enter Text" + lbl_brand_Name.InnerText; ScriptManager.RegisterClientScriptBlock(btn_product_type_Save_amms, this.GetType(), "AlertMsg", "<script language='javascript'>alert('" + textmess + "');</script>", false); } } else if (btn_product_type_Save_amms.Text == "Update") { if (!string.IsNullOrWhiteSpace(txt_product_type_amms.Text.ToString())) { CPU_Details cd = new CPU_Details(); cd.Cpu_brand_id = Convert.ToInt32(ViewState["bm_brand_id"]); cd.CPU_BRAND_MAKE = txt_product_type_amms.Text.ToString(); // cd.CPU_ITEM_CREATEDBY = "ahammed"; String i = adt.Upadte_brand_Name_cpu(cd); if (i == "1") { strptymessage = "Brand Name " + txt_product_type_amms.Text + " Updated Sucessfully"; ScriptManager.RegisterClientScriptBlock(btn_product_type_Save_amms, this.GetType(), "AlertMsg", "<script language='javascript'>alert('" + strptymessage + "');</script>", false); txt_product_type_amms.Text = string.Empty; btn_product_type_Save_amms.Text = "Save"; _load_brand_ddl(); _load_brand_grid(); } else if (i == "0") { ScriptManager.RegisterClientScriptBlock(btn_product_type_Save_amms, this.GetType(), "AlertMsg", "<script language='javascript'>alert('No chages has Done');</script>", false); _load_brand_ddl(); _load_brand_grid(); txt_product_type_amms.Text = string.Empty; } else { ScriptManager.RegisterClientScriptBlock(btn_product_type_Save_amms, this.GetType(), "AlertMsg", "<script language='javascript'>alert('Some Thing went Wrong');</script>", false); _load_brand_ddl(); txt_product_type_amms.Text = string.Empty; } } else { string textmess = "Please Enter Text"; ScriptManager.RegisterClientScriptBlock(btn_product_type_Save_amms, this.GetType(), "AlertMsg", "<script language='javascript'>alert('" + textmess + "');</script>", false); } } }