protected void Btn_Get_UG_Click(object sender, EventArgs e) { try { SqlConnection con = new SqlConnection(constr.getconstr()); SqlCommand cmd = new SqlCommand("Get_UG_User_Count", con); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Project_Name", Drp_Project_Name.SelectedValue); SqlDataAdapter ad = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); ad.Fill(ds); Grd_User_List.DataSource = ds.Tables[0]; Grd_User_List.DataBind(); } catch (Exception ex) { lblErrorMsg.Text = ""; lblErrorMsg.Text = ex.Message; } }
private bool Validate() { if (Grd_User_List.Rows.Count <= 0) { MessageBox.Show("Requried User Name"); return(false); } for (int u = 0; u < Grd_User_List.Rows.Count; u++) { bool list = (bool)Grd_User_List[0, u].FormattedValue; if (list == true) { U_Check = 1; break; } else { U_Check = 0; } } if (U_Check == 0) { MessageBox.Show("Select atleast any one User"); Grd_User_List.Focus(); return(false); } return(true); }
private bool Validate_Copy() { if (Grid_List.Rows.Count <= 0) { MessageBox.Show("Requried List"); return(false); } if (Grid_Order_Type_Abs.Rows.Count <= 0) { MessageBox.Show("Requried Order Type Abbrivation"); return(false); } for (int u = 0; u < Grid_User_Copy_List.Rows.Count; u++) { bool list = (bool)Grid_User_Copy_List[0, u].FormattedValue; if (list == true) { U_Check = 1; break; } else { U_Check = 0; } } for (int i = 0; i < Grid_List.Rows.Count; i++) { bool list = (bool)Grid_List[0, i].FormattedValue; if (list == true) { List_Check = 1; break; } else { List_Check = 0; } } for (int k = 0; k < Grid_Order_Type_Abs.Rows.Count; k++) { bool ordertype = (bool)Grid_Order_Type_Abs[0, k].FormattedValue; if (ordertype == true) { Order_Type_Check = 1; break; } else { Order_Type_Check = 0; } } if (U_Check == 0) { MessageBox.Show("Select atleast any one User to Copy"); Grd_User_List.Focus(); return(false); } if (List_Check == 0) { MessageBox.Show("Select atleast any one List"); Grid_List.Focus(); return(false); } if (Order_Type_Check == 0) { MessageBox.Show("Select atleast any one Order Type Abbrivation"); Grid_Order_Type_Abs.Focus(); return(false); } return(true); }