protected void btnLogin_Click(object sender, EventArgs e) { string userName = val_UserName.Value; string password = val_Password.Value; ObjCon.SetStoreProcedureData("ParmUserName", MySql.Data.MySqlClient.MySqlDbType.VarChar, userName); ObjCon.SetStoreProcedureData("ParmPassword ", MySql.Data.MySqlClient.MySqlDbType.VarChar, password); DataSet ds = ObjCon.ExecuteStoreProcedure_Get("ztech.spr_Validate_Login"); //DataTable dtuser = ObjCon.ExecuteSelectStatement("SELECT 1 FROM tblUserDetails WHERE UserName='******' AND Password='******'"); if (ds != null && ds.Tables.Count > 0) { DataTable dtuser = ds.Tables[0]; if (dtuser != null && dtuser.Rows.Count > 0) { //Session["User"] = userName; Session["User"] = dtuser.Rows[0]["ID"]; Response.Redirect("/Admin_Manager.aspx"); } else { Control control = Page.Master.FindControl("pnlProfile"); control.Visible = false; NavigationURL.Value = "Admin_Login.aspx"; ShowMessageBox("Incorrect User Name or Password.", false); } } else { Control control = Page.Master.FindControl("pnlProfile"); control.Visible = false; NavigationURL.Value = "Admin_Login.aspx"; ShowMessageBox("Incorrect User Name or Password.", false); } }
private void SaveDataIntoDB(string strName, string path, int flag) { clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp(); ObjDAL.SetStoreProcedureData("ParmPID", MySql.Data.MySqlClient.MySqlDbType.Int32, ProductID); ObjDAL.SetStoreProcedureData("ParmPath ", MySql.Data.MySqlClient.MySqlDbType.VarChar, path); ObjDAL.SetStoreProcedureData("ParmFileName ", MySql.Data.MySqlClient.MySqlDbType.VarChar, strName); ObjDAL.SetStoreProcedureData("ParmFlag", MySql.Data.MySqlClient.MySqlDbType.Int32, flag); ObjDAL.ExecuteStoreProcedure_DML("spr_InsertProductImages"); }
private void UpdateProductData() { ProductName = Request["txtProductName"].ToString(); string strProdDesc = Request["txtProdDesc"].ToString(); string strConsFeature = Request["txtConsFeature"].ToString(); string strSizeDetails = Request["txtSizeDetails"].ToString(); string strProductName = ""; int ProductID = 0; if (Session["ProductName"] != null) { strProductName = Session["ProductName"].ToString(); } else { strProductName = "NA"; } if (Session["ProductID"] != null) { ProductID = Convert.ToInt32(Session["ProductID"]); } clsMySQLCoreApp ObjDAL = new clsMySQLCoreApp(); ObjDAL.SetStoreProcedureData("ProductName", MySql.Data.MySqlClient.MySqlDbType.VarChar, ProductName); ObjDAL.SetStoreProcedureData("PID", MySql.Data.MySqlClient.MySqlDbType.Int32, ProductID); ObjDAL.SetStoreProcedureData("Description", MySql.Data.MySqlClient.MySqlDbType.LongText, strProdDesc); ObjDAL.SetStoreProcedureData("ConstFeatures", MySql.Data.MySqlClient.MySqlDbType.LongText, strConsFeature); ObjDAL.SetStoreProcedureData("SizeDetails", MySql.Data.MySqlClient.MySqlDbType.LongText, strSizeDetails); bool result = ObjDAL.ExecuteStoreProcedure_DML("spr_InsUpdateProductDetails"); if (!result) { Response.Write(ObjDAL.strErrorText); } else { Session["UpdateStatus"] = "1"; Response.Redirect("Admin_Manager.aspx"); } }