public int DisplayTotalAmount(string stat) { int i = 0; i = Convert.ToInt32(SqlHelper.ExecuteScalar(ClsConnection.GetConnection(), CommandType.Text, stat)); return(i); }
public void InsertEmployee() { SqlParameter[] p = new SqlParameter[9]; p[0] = new SqlParameter("@Ename", SqlDbType.VarChar); p[0].Value = _EmpName; p[1] = new SqlParameter("@Surname", SqlDbType.VarChar); p[1].Value = _Surname; p[2] = new SqlParameter("@Address", SqlDbType.VarChar); p[2].Value = _Address; p[3] = new SqlParameter("@City", SqlDbType.VarChar); p[3].Value = _City; p[4] = new SqlParameter("@State", SqlDbType.VarChar); p[4].Value = _State; p[5] = new SqlParameter("@ZipCode", SqlDbType.Float); p[5].Value = _ZipCode; p[6] = new SqlParameter("@WorkOnVehicle", SqlDbType.Int); p[6].Value = _WorkOnVehicle; p[7] = new SqlParameter("@Salary", SqlDbType.Float); p[7].Value = _Salary; p[8] = new SqlParameter("@JobDesc", SqlDbType.VarChar); p[8].Value = _JobDesc; SqlHelper.ExecuteNonQuery(ClsConnection.GetConnection(), CommandType.StoredProcedure, "Insert_Employee", p); }
public static DataSet Getsemster_Detail(string batch_calcode_degree) { string[] splitval = batch_calcode_degree.Split(new char[] { '/' }); DataSet ds1 = new DataSet(); SqlConnection con = ClsConnection.Getconnection(); //SqlCommand cmd = new SqlCommand("BatchDetail"); //cmd.Parameters.Add("@type", SqlDbType.Int).Value = Convert.ToInt32(b); //cmd.Parameters.Add("@batch_year", SqlDbType.Int).Value = Convert.ToInt32(c); //cmd.Parameters.Add("@degree_code", SqlDbType.Int).Value = Convert.ToInt32(d); //cmd.Parameters.Add("@college_code", SqlDbType.Int).Value = Convert.ToInt32(e); //cmd.Parameters.Add("@user_code", SqlDbType.Int).Value = Convert.ToInt32(null); //cmd.Parameters.Add("@Courseid", SqlDbType.Int).Value = Convert.ToInt32(null); //cmd.Connection = con; //cmd.CommandType = CommandType.StoredProcedure; SqlCommand cmd = new SqlCommand("select distinct ndurations,first_year_nonsemester from ndegree where degree_code = " + splitval[2].ToString() + " and batch_year = " + splitval[0].ToString() + " and college_code = " + splitval[1].ToString() + " ", con); SqlDataAdapter da = new SqlDataAdapter(cmd); da.Fill(ds1); if (ds1.Tables[0].Rows.Count == 0) { ds1.Clear(); SqlCommand cmd1 = new SqlCommand("select distinct duration,first_year_nonsemester from degree where degree_code = " + splitval[2].ToString() + " and college_code =" + splitval[1].ToString() + "", con); SqlDataAdapter da1 = new SqlDataAdapter(cmd1); da1.Fill(ds1, batch_calcode_degree); } return(ds1); }
public void AcceptBooking() { SqlParameter[] p = new SqlParameter[6]; p[0] = new SqlParameter("@DateBooked", SqlDbType.VarChar); p[0].Value = _DateOfBooked; p[1] = new SqlParameter("@VehicleId", SqlDbType.VarChar); p[1].Value = _VehicleId; p[2] = new SqlParameter("@TimePeriod", SqlDbType.Int); p[2].Value = _TimeOfPeriod; p[3] = new SqlParameter("@AmountPaid", SqlDbType.VarChar); p[3].Value = _AmountPaid; p[4] = new SqlParameter("@BookingStatus", SqlDbType.Int); p[4].Value = _BookingStatus; p[5] = new SqlParameter("@UserId", SqlDbType.Int); p[5].Value = _UserId; SqlHelper.ExecuteNonQuery(ClsConnection.GetConnection(), CommandType.StoredProcedure, "AddBookingInfo", p); }
protected void btn_Confirm_Click(object sender, EventArgs e) { string email = Session["Email1"].ToString(); ClsConnection obj = new ClsConnection(); SqlConnection con1 = obj.connect1(); ClsConnection obj1 = new ClsConnection(); SqlConnection con2 = obj1.connect2(); ClsConnection obj2 = new ClsConnection(); SqlConnection con3 = obj2.connect3(); using (con1) { con1.Open(); SqlCommand cmd = new SqlCommand("update tbl_Bank set Password='******' where Email='" + email + "'", con1); cmd.ExecuteNonQuery(); con1.Close(); } using (con2) { con2.Open(); SqlCommand cmd = new SqlCommand("update tbl_Bank set Password='******' where Email='" + email + "'", con2); cmd.ExecuteNonQuery(); con2.Close(); } using (con3) { con3.Open(); SqlCommand cmd = new SqlCommand("update tbl_Bank set Password='******' where Email='" + email + "'", con3); cmd.ExecuteNonQuery(); con3.Close(); } Alert.Show("Password Changed"); }
public DataSet GetVehicleDetails() { SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@VechicleId", VehicleId); p[0].SqlDbType = SqlDbType.VarChar; return(SqlHelper.ExecuteDataset(ClsConnection.GetConnection(), CommandType.StoredProcedure, "spDisplayVehicleById", p)); }
private void button1_Click(object sender, EventArgs e) { try { if (comboBox2.Text != "" && textBox1.Text != "" && textBox2.Text != "" && textBox3.Text != "") { DialogResult result = MessageBox.Show("Are your sure to want to save this configuration ?\n Type Of server : " + comboBox1.Text + "\n Server : " + comboBox2.Text + "\n Database Name : " + textBox1.Text + "\n User : "******"\n Password : "******" ", "Please Confirm", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (result == DialogResult.Yes) { File.WriteAllText(ClsConstantes.Table.serveur, comboBox2.Text.ToString()); File.WriteAllText(ClsConstantes.Table.database, textBox1.Text.ToString()); File.WriteAllText(ClsConstantes.Table.user, textBox2.Text.ToString()); File.WriteAllText(ClsConstantes.Table.password, textBox3.Text.ToString()); ClsGetdatas.GetInstance().Testeconne = 1; this.Close(); ClsConnection.GetInstance().connecter(); } } else { MessageBox.Show("Completez tous les champ !!!", "Saisie Obligatoire", MessageBoxButtons.OKCancel, MessageBoxIcon.Error); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
public void InsertUserRegistration() { SqlParameter[] p = new SqlParameter[8]; p[0] = new SqlParameter("@UserName", SqlDbType.VarChar); p[0].Value = _UserName; p[1] = new SqlParameter("@Surname", SqlDbType.VarChar); p[1].Value = _Surname; p[2] = new SqlParameter("@EmailId", SqlDbType.VarChar); p[2].Value = _EmailId; p[3] = new SqlParameter("@MobileNo", SqlDbType.VarChar); p[3].Value = _MobileNo; p[4] = new SqlParameter("@Address", SqlDbType.VarChar); p[4].Value = _Address; p[5] = new SqlParameter("@City", SqlDbType.VarChar); p[5].Value = _City; p[6] = new SqlParameter("@State", SqlDbType.VarChar); p[6].Value = _State; p[7] = new SqlParameter("@ZipCode", SqlDbType.VarChar); p[7].Value = _ZipCode; SqlHelper.ExecuteNonQuery(ClsConnection.GetConnection(), CommandType.StoredProcedure, "Insert_userRegistraion", p); }
private static async Task Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); DebugLoger.DebugLogerInstance.init(ENSource.Advertise, false); // var frm11 = new FrmTest(); //frm11.ShowDialog(); PerformanceEntities.ErrorHandler.AddHandler(false, false, false, Assembly.GetExecutingAssembly().GetName().Version.ToString(), ENSource.Advertise, Application.StartupPath, 123456789, "accountingerrorlog", "accountingerrorlog", 10, 50); MonitorLog.Initialize(true, ENSource.Advertise, Assembly.GetExecutingAssembly().GetName().Version.ToString(), 10, 30, "accountingerrorlog", "accountingerrorlog", 1, 500); await AccSqlServerPersistence.cache.GetCache(ClsConnection.ConnectionString, Path.Combine(Application.StartupPath, "sqlite.db"), ImagePath(), new List <ClientConfig>() { new ClientConfig() { Source = ENSource.Advertise } }, new CancellationTokenSource(), 1, ENSource.Advertise, advertise : true); await Task.Run(() => { ClsConnection.Backup(); }); var frm = new frmTestMain(); try { frm.ShowDialog(); } catch (Exception ex) { WebErrorLog.ErrorLogInstance.StartLog(ex); } CloseAllChromeWindows(); }
public void DeleteVehicle() { SqlParameter p = new SqlParameter("@VehicleId", SqlDbType.VarChar); p.Value = _VehicleId; SqlHelper.ExecuteNonQuery(ClsConnection.GetConnection(), CommandType.StoredProcedure, "delete_vehicle", p); }
public int ShowBookingInfo() { SqlParameter p = new SqlParameter("@VehicleId", SqlDbType.VarChar); p.Value = _VehicleId; DataSet ds = SqlHelper.ExecuteDataset(ClsConnection.GetConnection(), CommandType.StoredProcedure, "DisplayBooking", p); DataRowCollection rec = ds.Tables[0].Rows; if (rec.Count > 0) { _BookingId = Convert.ToInt16(rec[0]["BookingId"]); _DateOfBooked = rec[0]["DateOfBooked"].ToString(); _VehicleId = rec[0]["VehicleId"].ToString(); _UserId = Convert.ToInt16(rec[0]["UserId"]); _TimeOfPeriod = Convert.ToInt16(rec[0]["TimePeriod"]); _BookingAmount = Convert.ToInt32(rec[0]["BookingAmount"]); _AmountPaid = rec[0]["AmountPaid"].ToString(); _BookingStatus = Convert.ToInt16(rec[0]["BookingStatus"]); return(1); } else { return(0); } }
public void DeleteEmployee() { SqlParameter p = new SqlParameter("@EmpId", SqlDbType.Int); p.Value = _EmpId; SqlHelper.ExecuteNonQuery(ClsConnection.GetConnection(), CommandType.StoredProcedure, "Delete_Employee", p); }
public DataSet AvaliableVehicleByDate() { SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@DateOfBooked", SqlDbType.VarChar); p[0].Value = _DateOfBooked; DataSet ds = SqlHelper.ExecuteDataset(ClsConnection.GetConnection(), CommandType.StoredProcedure, "AvaliableVehicleByDate", p); return(ds); }
public DataSet DisplayCancelBooking() { SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@BookingId", SqlDbType.Int); p[0].Value = _BookingId; DataSet ds = SqlHelper.ExecuteDataset(ClsConnection.GetConnection(), CommandType.StoredProcedure, "DisplayCancelBooking", p); return(ds); }
private void get_creditdetails() { ClsConnection obj1 = new ClsConnection(); SqlConnection con1 = obj1.connect1(); ClsConnection obj2 = new ClsConnection(); SqlConnection con2 = obj2.connect2(); ClsConnection obj3 = new ClsConnection(); SqlConnection con3 = obj3.connect3(); using (con1) { con1.Open(); string bank_id = Session["Bank_Id"].ToString(); SqlCommand cmd = new SqlCommand("select * from tbl_Bank where Bank_Id='" + bank_id + "'", con1); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { SqlCommand cmd2 = new SqlCommand("insert into tbl_CreditDeposit values('" + txt_AccountNo.Text + "','" + txt_Name.Text + "','" + txt_AdharNo.Text + "','" + txt_Amount.Text + "','" + txt_MobileNo.Text + "','" + txt_EmailId.Text + "','" + txt_Date.Text + "')", con1); dr.Close(); cmd2.ExecuteNonQuery(); } con1.Close(); } using (con2) { con2.Open(); string bank_id = Session["Bank_Id"].ToString(); SqlCommand cmd = new SqlCommand("select * from tbl_Bank where Bank_Id='" + bank_id + "'", con2); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { SqlCommand cmd2 = new SqlCommand("insert into tbl_CreditDeposit values('" + txt_AccountNo.Text + "','" + txt_Name.Text + "','" + txt_AdharNo.Text + "','" + txt_Amount.Text + "','" + txt_MobileNo.Text + "','" + txt_EmailId.Text + "','" + txt_Date.Text + "')", con2); dr.Close(); cmd2.ExecuteNonQuery(); } con2.Close(); } using (con3) { con3.Open(); string bank_id = Session["Bank_Id"].ToString(); SqlCommand cmd = new SqlCommand("select * from tbl_Bank where Bank_Id='" + bank_id + "'", con3); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { SqlCommand cmd2 = new SqlCommand("insert into tbl_CreditDeposit values('" + txt_AccountNo.Text + "','" + txt_Name.Text + "','" + txt_AdharNo.Text + "','" + txt_Amount.Text + "','" + txt_MobileNo.Text + "','" + txt_EmailId.Text + "','" + txt_Date.Text + "')", con3); dr.Close(); cmd2.ExecuteNonQuery(); } con3.Close(); } send_email(); clear(); Alert.Show("Credit Card Details Saved"); }
private void load_branches() { ClsConnection obj = new ClsConnection(); SqlConnection con1 = obj.connect1(); ClsConnection obj1 = new ClsConnection(); SqlConnection con2 = obj1.connect2(); ClsConnection obj2 = new ClsConnection(); SqlConnection con3 = obj2.connect3(); using (con1) { con1.Open(); SqlDataAdapter adp = new SqlDataAdapter("select Branch,Bank_Id from tbl_Bank where Bank_No='" + drp_usertype.SelectedItem.ToString() + "'", con1); DataTable dt = new DataTable(); adp.Fill(dt); if (dt.Rows.Count > 0) { drp_branch.DataSource = dt; drp_branch.DataTextField = "Branch"; drp_branch.DataValueField = "Bank_Id"; drp_branch.DataBind(); } con1.Close(); } using (con2) { con2.Open(); SqlDataAdapter adp1 = new SqlDataAdapter("select Branch,Bank_Id from tbl_Bank where Bank_No='" + drp_usertype.SelectedItem.ToString() + "'", con2); DataTable dt1 = new DataTable(); adp1.Fill(dt1); if (dt1.Rows.Count > 0) { drp_branch.DataSource = dt1; drp_branch.DataTextField = "Branch"; drp_branch.DataValueField = "Bank_Id"; drp_branch.DataBind(); } con2.Close(); } using (con3) { con3.Open(); SqlDataAdapter adp2 = new SqlDataAdapter("select Branch,Bank_Id from tbl_Bank where Bank_No='" + drp_usertype.SelectedItem.ToString() + "'", con3); DataTable dt2 = new DataTable(); adp2.Fill(dt2); if (dt2.Rows.Count > 0) { drp_branch.DataSource = dt2; drp_branch.DataTextField = "Branch"; drp_branch.DataValueField = "Bank_Id"; drp_branch.DataBind(); } con3.Close(); } }
public static DataSet GetBranchDetail(string branch, string collegecode) { SqlConnection con = ClsConnection.Getconnection(); SqlCommand cmd = new SqlCommand("select distinct degree.degree_code,department.dept_name from degree,department,course where course.course_id=degree.course_id and department.dept_code=degree.dept_code and course.college_code = degree.college_code and department.college_code = degree.college_code and degree.course_id= " + branch.ToString() + " and degree.college_code= " + collegecode.ToString() + " ", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); return(ds); }
public static DataSet GetDegreeDetail(string collegecode) { SqlConnection con = ClsConnection.Getconnection(); SqlCommand cmd = new SqlCommand("select distinct degree.course_id,course.course_name from degree,course where course.course_id=degree.course_id and course.college_code = degree.college_code and degree.college_code=" + collegecode.ToString() + " order by course.course_name ", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); return(ds); }
public static DataSet GetBatchDetail() { SqlConnection con = ClsConnection.Getconnection(); SqlCommand cmd = new SqlCommand("select distinct batch_year from Registration where batch_year<>'-1' and batch_year<>''order by batch_year", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); return(ds); }
private void view_loandetails() { ClsConnection obj1 = new ClsConnection(); SqlConnection con1 = obj1.connect1(); ClsConnection obj2 = new ClsConnection(); SqlConnection con2 = obj2.connect2(); ClsConnection obj3 = new ClsConnection(); SqlConnection con3 = obj3.connect3(); using (con1) { con1.Open(); string Loan_Id = Session["Loan_Id"].ToString(); string bank_id = Session["Bank_Id"].ToString(); SqlDataAdapter adp = new SqlDataAdapter("select * from tbl_Loan where Loan_Id='" + Loan_Id + "' AND Bank_Id='" + bank_id + "'", con1); DataTable dt = new DataTable(); adp.Fill(dt); if (dt.Rows.Count > 0) { grd_EditLoan.DataSource = dt; grd_EditLoan.DataBind(); } con1.Close(); } using (con2) { con2.Open(); string Loan_Id = Session["Loan_Id"].ToString(); string bank_id = Session["Bank_Id"].ToString(); SqlDataAdapter adp = new SqlDataAdapter("select * from tbl_Loan where Bank_Id='" + bank_id + "' AND Bank_Id='" + bank_id + "'", con2); DataTable dt1 = new DataTable(); adp.Fill(dt1); if (dt1.Rows.Count > 0) { grd_EditLoan.DataSource = dt1; grd_EditLoan.DataBind(); } con2.Close(); } using (con3) { con3.Open(); string Loan_Id = Session["Loan_Id"].ToString(); string bank_id = Session["Bank_Id"].ToString(); SqlDataAdapter adp = new SqlDataAdapter("select * from tbl_Loan where Bank_Id='" + bank_id + "' AND Bank_Id='" + bank_id + "'", con3); DataTable dt2 = new DataTable(); adp.Fill(dt2); if (dt2.Rows.Count > 0) { grd_EditLoan.DataSource = dt2; grd_EditLoan.DataBind(); } con3.Close(); } }
public void InserUser() { SqlParameter [] p = new SqlParameter [2]; p[0] = new SqlParameter("@username", SqlDbType.VarChar); p[0].Value = _UserName; p[1] = new SqlParameter("@password", SqlDbType.VarChar); p[1].Value = _PassWord; SqlHelper.ExecuteNonQuery(ClsConnection.GetConnection(), CommandType.StoredProcedure, "Insert_EmpUsers", p); }
private void get_keydetails() { try { ClsConnection obj1 = new ClsConnection(); SqlConnection con1 = obj1.connect1(); ClsConnection obj2 = new ClsConnection(); SqlConnection con2 = obj2.connect2(); ClsConnection obj3 = new ClsConnection(); SqlConnection con3 = obj3.connect3(); ClsConnection obj = new ClsConnection(); SqlConnection con = obj.connect(); using (con1) { con1.Open(); string Bank_id = Session["Bank_Id"].ToString(); SqlCommand cmd = new SqlCommand("select KeyInfo from tbl_Loan where Bank_Id='" + Bank_id + "' AND AdharId='" + txt_AdharId.Text + "'", con1); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { txt_Key.Text = dr["KeyInfo"].ToString(); } con1.Close(); } using (con2) { con2.Open(); string Bank_id = Session["Bank_Id"].ToString(); SqlCommand cmd = new SqlCommand("select KeyInfo from tbl_Loan where Bank_Id='" + Bank_id + "' AND AdharId='" + txt_AdharId.Text + "'", con2); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { txt_Key.Text = dr["KeyInfo"].ToString(); } con2.Close(); } using (con3) { con3.Open(); string Bank_id = Session["Bank_Id"].ToString(); SqlCommand cmd = new SqlCommand("select KeyInfo from tbl_Loan where Bank_Id='" + Bank_id + "' AND AdharId='" + txt_AdharId.Text + "'", con3); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { txt_Key.Text = dr["KeyInfo"].ToString(); } con3.Close(); } } catch (Exception exp) { } }
public DataSet MupleSearchDisplay() { SqlParameter[] p = new SqlParameter[2]; p[0] = new SqlParameter("@VehicleId", SqlDbType.VarChar); p[0].Value = _VehicleId; p[1] = new SqlParameter("@DateOfBooked", SqlDbType.VarChar); p[1].Value = _DateOfBooked; DataSet ds = SqlHelper.ExecuteDataset(ClsConnection.GetConnection(), CommandType.StoredProcedure, "SpMultipleSearch", p); return(ds); }
public void innitialiseConnect() { try { cnx = new ClsConnection(); cnx.connecter(); con = new SqlConnection(cnx.chemin); } catch (Exception) { throw new Exception("l'un de vos fichiers de configuration est incorrect"); } }
protected void btnlogin_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(4000); ClsConnection obj=new ClsConnection(); SqlCommand cmd=new SqlCommand(); DataSet ds=new DataSet(); if (drpdwnrole.SelectedItem.Text == "Student") { cmd = new SqlCommand("SELECT S_ID, Name FROM Student_Table WHERE S_ID='" + txtuserid.Text + "' and Password='******'"); Session["Role"] = "Student"; } else if (drpdwnrole.SelectedItem.Text == "Staff") { cmd = new SqlCommand("SELECT SF_ID, Name FROM Staff_Table WHERE SF_ID='" + txtuserid.Text + "' and Password='******'"); Session["Role"] = "Staff"; } else { cmd = new SqlCommand("SELECT A_ID, Name FROM Admin_Table WHERE A_ID='" + txtuserid.Text + "' and Password='******'"); Session["Role"] = "Admin"; } ds = obj.retdata(cmd); if (ds.Tables[0].Rows.Count > 0) { Session["ID"] = Convert.ToString(ds.Tables[0].Rows[0][0]); Session["Name"] = Convert.ToString(ds.Tables[0].Rows[0][1]); lblmsg.Visible = false; pnlmsg.Visible = false; imgalert.Visible = false; Response.Redirect("default.aspx"); } else { lblmsg.Visible = true; pnlmsg.Visible = true; imgalert.Visible = true; pnlmsg.CssClass = "error"; imgalert.ImageUrl = "~/Images/alert red.png"; lblmsg.ForeColor = System.Drawing.Color.Red; lblmsg.Text = "Invalid Credentials, Try Again"; } }
public bool CheckAvalibility(string stat) { SqlDataReader dr = SqlHelper.ExecuteReader(ClsConnection.GetConnection(), CommandType.Text, stat); dr.Read(); if (dr.HasRows) { return(true); } else { return(false); } }
public void DisplayPackage() { SqlParameter[] p = new SqlParameter[1]; p[0] = new SqlParameter("@PackageId", SqlDbType.Int); p[0].Value = _PackageId; DataSet ds = SqlHelper.ExecuteDataset(ClsConnection.GetConnection(), CommandType.StoredProcedure, "DiplayAvaliabePackage", p); DataRowCollection rec = ds.Tables[0].Rows; if (rec.Count > 0) { _Details = rec[0]["Details"].ToString(); _NoOfDays = Convert.ToInt32(rec[0]["NoOfDays"]); _Price = Convert.ToInt32(rec[0]["Price"]); } }
public int CancelBooking() { SqlParameter[] p = new SqlParameter[3]; p[0] = new SqlParameter("@BookingId", SqlDbType.Int); p[0].Value = _BookingId; p[1] = new SqlParameter("@DateOfBooked", SqlDbType.VarChar); p[1].Value = _DateOfBooked; p[2] = new SqlParameter("@str", SqlDbType.Int); p[2].Direction = ParameterDirection.Output; SqlHelper.ExecuteScalar(ClsConnection.GetConnection(), CommandType.StoredProcedure, "CancelBooking", p); //SqlHelper.ExecuteNonQuery(ClsConnection.GetConnection(), CommandType.StoredProcedure, "CancelBooking", p); return((int)p[2].Value); }
//public static DataSet GetsectionDetail(string b, string c, string d, string e) //{ // SqlConnection con = ClsConnection.Getconnection(); // SqlCommand cmd = new SqlCommand("BatchDetail"); // cmd.Parameters.Add("@type", SqlDbType.Int).Value = Convert.ToInt32(b); // cmd.Parameters.Add("@batch_year", SqlDbType.Int).Value = Convert.ToInt32(c); // cmd.Parameters.Add("@degree_code", SqlDbType.Int).Value = Convert.ToInt32(d); // cmd.Parameters.Add("@college_code", SqlDbType.Int).Value = Convert.ToInt32(e); // cmd.Parameters.Add("@user_code", SqlDbType.Int).Value = Convert.ToInt32(null); // cmd.Parameters.Add("@Courseid", SqlDbType.Int).Value = Convert.ToInt32(null); // cmd.Connection = con; // cmd.CommandType = CommandType.StoredProcedure; // SqlDataAdapter da = new SqlDataAdapter(cmd); // DataSet ds = new DataSet(); // da.Fill(ds); // return ds; //} public static DataSet GetsectionDetail(string batch, string branch) { SqlConnection con = ClsConnection.Getconnection(); //SqlCommand cmd = new SqlCommand("selectsection"); //cmd.Parameters.Add("@degree_code", SqlDbType.Int).Value = Convert.ToInt32(b); //cmd.Parameters.Add("@batch_year", SqlDbType.Int).Value = Convert.ToInt32(c); //cmd.Parameters.Add("@semster", SqlDbType.Int).Value = Convert.ToInt32(d); //cmd.Connection = con; //cmd.CommandType = CommandType.StoredProcedure; SqlCommand cmd = new SqlCommand("select distinct sections from registration where batch_year=" + batch.ToString() + " and degree_code=" + branch.ToString() + " and delflag=0 and exam_flag<>'Debar'", con); SqlDataAdapter da = new SqlDataAdapter(cmd); DataSet ds = new DataSet(); da.Fill(ds); return(ds); }
public static DataSet Getdatadatewise(string a, string b) { SqlConnection con = ClsConnection.Getconnection(); SqlCommand cmd = new SqlCommand("FilteredSemsterResult"); cmd.Parameters.Add("@degree_code", SqlDbType.Int).Value = Convert.ToInt32(a); cmd.Parameters.Add("@semester", SqlDbType.Int).Value = Convert.ToInt32(b); SqlDataAdapter da = new SqlDataAdapter(); cmd.Connection = con; cmd.CommandType = CommandType.StoredProcedure; da.SelectCommand = cmd; DataSet ds = new DataSet(); da.Fill(ds); return(ds); }
protected void Page_Load(object sender, EventArgs e) { ClsConnection obj=new ClsConnection(); if (Convert.ToString(Session["ID"]) != "") { imgloggedin.Visible = true; lblloginname.Text = Convert.ToString(Session["Name"]); lblloggedin.Visible = true; lnkbtnlogout.Visible = true; btnvisit.Visible = true; if (Convert.ToString(Session["Role"]) == "Student") { btnvisit.Text = "Visit Student Section"; btnvisit.PostBackUrl = "~/student.aspx"; } else if (Convert.ToString(Session["Role"]) == "Staff") { btnvisit.Text = "Visit Staff Section"; btnvisit.PostBackUrl = "~/staff.aspx"; } else { btnvisit.Text = "Visit Admin Section"; btnvisit.PostBackUrl = "~/admin.aspx"; } } else { imgloggedin.Visible = false; lblloggedin.Visible = false; lblloginname.Visible = false; lnkbtnlogout.Visible = false; btnvisit.Text = ""; btnvisit.PostBackUrl = ""; btnvisit.Visible = false; } SqlCommand cmd = new SqlCommand("SELECT visitors FROM Visitors_Table WHERE V_ID=100"); DataSet ds = new DataSet(); ds = obj.retdata(cmd); if (ds.Tables[0].Rows.Count > 0) { lblvis.Text = ds.Tables[0].Rows[0]["visitors"].ToString(); } }
protected void btncheckname4_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(4000); if(txtname4.Text=="") { pnlmsg1.CssClass = "error"; imgalert1.ImageUrl = "~/Images/alert red.png"; lblmsg1.ForeColor = System.Drawing.Color.Red; lblmsg1.Text = "Please enter ID first"; txtname4.Text = ""; } else { ClsConnection obj=new ClsConnection(); SqlCommand cmd=new SqlCommand(); DataSet ds=new DataSet(); if (drpdwnlstrole4.SelectedItem.Text == "Student") { cmd = new SqlCommand("SELECT Name FROM Student_Table WHERE S_ID='" + txtid4.Text + "'"); } else if (drpdwnlstrole4.SelectedItem.Text == "Staff") { cmd = new SqlCommand("SELECT Name FROM Staff_Table WHERE SF_ID='" + txtid4.Text + "'"); } else { cmd = new SqlCommand("SELECT Name FROM Admin_Table WHERE A_ID='" + txtid4.Text + "'"); } ds = obj.retdata(cmd); if (ds.Tables[0].Rows.Count > 0) { txtname4.Text = ds.Tables[0].Rows[0][0].ToString(); } else { pnlmsg1.CssClass = "error"; imgalert1.ImageUrl = "~/Images/alert red.png"; lblmsg1.ForeColor = System.Drawing.Color.Red; lblmsg1.Text = "Invalid ID, Try Again"; txtname4.Text = ""; } } }
public void DisplyVehicleInfo() { SqlParameter p = new SqlParameter("@VehicleId", SqlDbType.VarChar); p.Value = _VehicleId; DataSet ds = SqlHelper.ExecuteDataset(ClsConnection.GetConnection(), CommandType.StoredProcedure, "DisplayVehicleAvaliability", p); DataRowCollection rec = ds.Tables[0].Rows; if (rec.Count > 0) { _Description = rec[0]["Description"].ToString(); _Model = rec[0]["Model"].ToString(); _Make = rec[0]["Make"].ToString(); _VehicleType = Convert.ToInt32(rec[0]["VehicleType"]); _RatePerDay = Convert.ToInt32(rec[0]["RatePerDay"]); //_BookingStatus = Convert.ToInt32(rec[0]["BookingStatus"]); } }
protected void btnsubmit_Click(object sender, EventArgs e) { System.Threading.Thread.Sleep(4000); ClsConnection obj=new ClsConnection(); string str = "INSERT INTO FeedBack_Table(Name, Email, Subject, Comment) VALUES('" + txtname.Text + "','" + txtemail.Text + "','" + txtsubject.Text + "','" + txtcomment.Text + "')"; int x; lblmsg.Visible = true; pnlmsg.Visible = true; imgalert.Visible = true; try { x = obj.ExecuteQueries(str); } catch (Exception ex) { pnlmsg.CssClass = "error"; imgalert.ImageUrl = "~/Images/alert red.png"; lblmsg.ForeColor = System.Drawing.Color.Red; lblmsg.Text = ex.Message.ToString(); return; } if (x > 0) { pnlmsg.CssClass = "correct"; imgalert.ImageUrl = "~/Images/alert green.png"; lblmsg.ForeColor = System.Drawing.Color.DarkGreen; lblmsg.Text = "Thank you for your feedback"; } else { pnlmsg.CssClass = "error"; imgalert.ImageUrl = "~/Images/alert red.png"; lblmsg.ForeColor = System.Drawing.Color.Red; lblmsg.Text = "Some Error Occurs"; } }