public IHttpActionResult MOV01(BAL ud) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { DataSet ds = repo.MOVLISTCONFIRM(Convert.ToInt32(ud.userID), ud.DocNo, ud.BinNo, ud.Barcode, ud.SRNO, ud.ItemNo, ud.TokenID, ud.WHNO, Convert.ToInt32(ud.Status)); if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "1") { return(Ok(new { message = "Success", result = ds.Tables[0], status = true })); } else if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "-1") { return(Content(HttpStatusCode.NotFound, new { message = "Invalid data", result = "", status = false })); } else if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "7") { return(Content(HttpStatusCode.NotFound, new { message = "Invalid Token", result = "", status = false })); } else { return(Content(HttpStatusCode.NotFound, new { message = "Not valid :- ItemNo/ Barcode or already scaned", result = "", status = false })); } } catch (Exception) { throw; } }
public ActionResult Edit(int id) { BAL bAL = new BAL(); categories categories = bAL.CategoryList.Single(c => c.categoryID == id); return(View(categories)); }
public ActionResult Delete(int id) { BAL bAL = new BAL(); bAL.DeleteManufacturer(id); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { BAL bAL = new BAL(); Manufacturers manufacturer = bAL.ManufacturerList.Single(m => m.ManufacturerID == id); return(View(manufacturer)); }
// GET: Home public ActionResult Index() { BAL db = new BAL(); var contacts = db.GetContacts(); return(View(contacts)); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { txtFromDate.Text = ""; txtFromDate.Text = ""; BAL objBAL = new BAL(helpDeskDBConnStr); int loginID = 0; try { int.TryParse(Session["Login_LoginID"].ToString(), out loginID); } catch { Response.Redirect("Index.aspx"); } int result = objBAL.SaveUserActionLogs(loginID, "rs.aspx", "PageLoad", "HomePage"); Log.Write("User " + Session["Login_LoginName"] + " entered into Home page"); string dtF = Request.Form[txtFromDate.UniqueID]; string dtT = Request.Form[txtToDate.UniqueID]; if (!string.IsNullOrEmpty(dtF) && !string.IsNullOrEmpty(dtT)) { Request.Form[txtFromDate.UniqueID] = DateTime.Now.ToShortDateString(); Request.Form[txtToDate.UniqueID] = DateTime.Now.ToShortDateString(); } LoadValues(); } }
public IHttpActionResult CC01(BAL ud) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { DataSet ds = repo.CCLISTCONFIRM(Convert.ToInt32(ud.userID), ud.CCNO, ud.BinNo, ud.ZoneID, ud.Barcode, ud.ItemNo, ud.TokenID, Convert.ToInt32(ud.Status)); if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "1") { return(Ok(new { message = "Success", result = ds.Tables[0], status = true })); } else if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "-1") { return(Content(HttpStatusCode.NotFound, new { message = "Not Valid Please Check:- ItemNo/Barcode/CCNO/BIN", result = "", status = false })); } else if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "7") { return(Content(HttpStatusCode.NotFound, new { message = "Invalid Token", result = "", status = false })); } else { return(Content(HttpStatusCode.NotFound, new { message = "Not Valid Please Check:- ItemNo/Barcode/CCNO/BIN", result = "", status = false })); } } catch (Exception) { throw; } }
public IHttpActionResult USERLOGOUT(BAL ud) { //if (!ModelState.IsValid) //{ // return BadRequest(ModelState); //} try { string u = ""; string p = ""; DataSet ds = repo.GetLogin(4, u, p, Convert.ToInt32(ud.userID)); if (ds.Tables[0].Rows.Count == 0) { return(Content(HttpStatusCode.NotFound, new { message = "Invalid User ID ", result = "", status = false })); } else { return(Ok(new { message = "Success", result = ds, status = true })); } } catch (Exception) { return(Content(HttpStatusCode.NotFound, new { message = "Invalid user or password", result = "", status = false })); } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { BAL obj = new BAL(); List <Institute> institueList = obj.getInstitute(); List <Course> courseList = obj.getCourse(); drpcity.Items.Clear(); drpcity.Items.Add(new ListItem("Select campus city", "0")); drpcity.AppendDataBoundItems = true; drpcity.DataSource = institueList; drpcity.DataTextField = "instituteCity"; drpcity.DataValueField = "instituteID"; dropcname.Items.Clear(); dropcname.Items.Add(new ListItem("Select course name", "0")); dropcname.AppendDataBoundItems = true; dropcname.DataSource = courseList; dropcname.DataTextField = "courseName"; dropcname.DataValueField = "courseID"; drpcity.DataBind(); dropcname.DataBind(); } }
public int getsubngradesinsubupd(BAL b) { SqlCommand cmd = new SqlCommand("SELECT dbo.tblsubject.subjectname, dbo.tblsubject.subjectacr, dbo.tblsubject.sub_category, dbo.tblsubjectgrade.mid_term_marks, dbo.tblsubjectgrade.fin_term_marks, dbo.tblsubjectgrade.total_marks, dbo.tblteacher.tea_f_name, dbo.tblteacher.teaid FROM dbo.tblsubject INNER JOIN dbo.tblsubjectgrade ON dbo.tblsubject.subjectid = dbo.tblsubjectgrade.subjectid INNER JOIN dbo.tblteacher ON dbo.tblsubject.teaid = dbo.tblteacher.teaid WHERE(dbo.tblsubject.subjectid = @subid)", d.con); cmd.Parameters.AddWithValue("@subid", b.subjectid); d.getall(cmd); d.con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (dr.Read()) { b.subjectname = dr[0].ToString(); b.subjectacr = dr[1].ToString(); b.sub_category = dr[2].ToString(); b.mid_term_marks = int.Parse(dr[3].ToString()); b.fin_term_marks = int.Parse(dr[4].ToString()); b.total_marks = int.Parse(dr[5].ToString()); b.tea_f_name = dr[6].ToString(); b.teaid = int.Parse(dr[7].ToString()); dr.Close(); return(1); } else { d.con.Close(); return(2); } }
private void LoadData() { divError.Visible = false; errorMessage.Visible = false; txtFromDate.Text = ""; txtFromDate.Text = ""; int telcoid = Convert.ToInt32(ConfigurationManager.AppSettings["MI_OperatorID"]); int cpid = Convert.ToInt32(Session["Login_LoginID"]); BAL objBL = new BAL(helpDeskDBConnStr); string dtF = Request.Form[txtFromDate.UniqueID]; string dtT = Request.Form[txtToDate.UniqueID]; if (!string.IsNullOrEmpty(dtF) && !string.IsNullOrEmpty(dtT)) { txtFromDate.Text = dtF; txtToDate.Text = dtT; Log.Write("fromDate: " + dtF + " ToDate: " + dtT + " RptType: " + ddlRptType.SelectedItem.Text); gvData.DataSource = objBL.GetSummary(dtF, dtT, ddlRptType.SelectedValue); gvData.DataBind(); } else { divError.Visible = true; errorMessage.Text = "Please select FROM and TO date"; errorMessage.ForeColor = Color.Red; errorMessage.Visible = true; } if (gvData.Rows.Count > 0) { lnkExport.Visible = true; } }
public WebService() { //Uncomment the following line if using designed components //InitializeComponent(); BAL.InitLogFilePath(Server.MapPath("~")); }
public ActionResult Delete(int id) { BAL bAL = new BAL(); bAL.DeleteCategory(id); return(RedirectToAction("Index")); }
private void btn_remove_Click(object sender, EventArgs e) { adminDefault admin = new adminDefault(lbl_text.Text); BusinessLayer.BAL bl = new BAL(); int result = 0; result = bl.RemoveBook(rem_cmb.SelectedValue.ToString(), Convert.ToInt32(rem_qntrem.Text)); if (result > 0) { MessageBox.Show("Selected Quantity Removed"); this.Hide(); admin.ShowDialog(); } else if (result == 0) { MessageBox.Show("Books Removed"); this.Hide(); admin.ShowDialog(); } else { MessageBox.Show("Quantity is more than available"); } }
public void getclassdetails(BAL c) { SqlCommand cmd = new SqlCommand("SELECT COUNT(DISTINCT dbo.tblsubject.subjectid) AS SubTaught, dbo.tblclas.no_of_sub, dbo.tblclas.strength, COUNT(dbo.tbladmission.stuid) AS TotStudts, dbo.tblclas.clas_level, dbo.tblclas.clasid FROM dbo.tblclas FULL OUTER JOIN dbo.tbladmission ON dbo.tblclas.clasid = dbo.tbladmission.clasid FULL OUTER JOIN dbo.tblsubject ON dbo.tblclas.clasid = dbo.tblsubject.clasid WHERE dbo.tblclas.clasid = @clid GROUP BY dbo.tblclas.no_of_sub, dbo.tblclas.strength, dbo.tblclas.clas_level, dbo.tblclas.clasid", d.con); cmd.Parameters.AddWithValue("@clid", c.clasid); d.getall(cmd); //DataTable dt = d.getfilterdata(cmd); d.con.Open(); SqlDataReader dr = cmd.ExecuteReader(); if (!dr.IsClosed) { while (dr.Read()) { c.subjectid = int.Parse(dr[0].ToString()); c.no_of_sub = int.Parse(dr[1].ToString()); c.strength = int.Parse(dr[2].ToString()); c.stuid = int.Parse(dr[3].ToString()); } } else { dr.Close(); //d.con.Close(); } //dr.Close(); d.con.Close(); //return dt; }
public IHttpActionResult PTA01(BAL ud) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { DataSet ds = repo.GETPTALISTCONFIRM(Convert.ToInt32(ud.userID), ud.PutNo, ud.BinNo, ud.Barcode, ud.ItemNo, ud.TokenID, Convert.ToInt32(ud.Status)); if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "1") { return(Ok(new { message = "Success", result = ds.Tables[0], status = true })); } else if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "-1") { return(Content(HttpStatusCode.NotFound, new { message = "Invalid put data found", result = ds, status = false })); } else if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "7") { return(Content(HttpStatusCode.NotFound, new { message = "Invalid Token", result = "", status = false })); } else { return(Content(HttpStatusCode.NotFound, new { message = "Incorrect Data : ItemNo or Barcode", result = "", status = false })); } } catch (Exception) { throw; } }
private void btn_add_Click(object sender, EventArgs e) { if (txt_amount.Text == null || txt_amount.Text == "") { MessageBox.Show("Please Enter Amount to Add"); } else { if (dataGridView1.RowCount == 0) { MessageBox.Show("Please Select User to Add"); txt_amount.Text = string.Empty; } else { int row = dataGridView1.CurrentRow.Index; string user = Convert.ToString(dataGridView1[1, row].Value); int amount = Convert.ToInt32(txt_amount.Text); BusinessLayer.BAL bl = new BAL(); int result = 0; result = bl.AddUserAmount(user, amount); if (result > 0) { MessageBox.Show("Amount Added Successfully"); txt_amount.Text = string.Empty; } else { MessageBox.Show("Error Occured! Try After Sometime"); txt_amount.Text = string.Empty; } } } }
public object getfeechallan(BAL b) { SqlCommand cmd = new SqlCommand("select * from tblfee where fee_challan_No like @abc", d.con); cmd.Parameters.AddWithValue("@abc", "%" + b.fee_challan_No + "%"); DataTable dt = d.getfilterdata(cmd); List <int> lstftid = new List <int>(); foreach (DataRow dr in dt.Rows) { lstftid.Add(int.Parse(dr["ftid"].ToString())); } b.abc = lstftid; // return dt; //foreach (DataColumn dd in dt.Columns) //{ // if (dd.ColumnName == "ftid") // { // //DataTable dt1 = new DataTable(); // //dt1.Columns.Add(dd); // //b.abc = dt1; // //dd.Container.Components // List<DataColumn> dc = new List<DataColumn>(); // // List<DataTable> db=new List<DataTable>() // dc.Add(dd); // b.abc = dc; //this method only gets column name do something here or create loop while binding list box. // } //} return(dt); }
private void LoadShortcodes() { ddlShortCode.Items.Clear(); ddlShortCode.Enabled = true; BAL objBAL = new BAL(helpDeskDBConnStr); lstShortCodes = new List <ChangeSubscriberServicesBO>(); lstShortCodes = objBAL.GetLookupShortcodesByTelcoID(7, "VAULT_SUB"); if (lstShortCodes.Count > 0) { ddlShortCode.Items.Clear(); ddlShortCode.DataSource = lstShortCodes; ddlShortCode.DataTextField = "Shortcode"; ddlShortCode.DataValueField = "Shortcode"; ddlShortCode.DataBind(); //ddlShortCode.Items.Insert(0, "--Select--"); //ddlShortCode.SelectedIndex = 0; } else { ddlShortCode.Text = "Shortcode doesnot exists"; } }
public JsonResult NewEditOwner(OwnerViewModel model) { BAL objBal = new BAL(); string status = objBal.EditOwner(model); return(Json(status, JsonRequestBehavior.AllowGet)); }
private void btn_reset_Click(object sender, EventArgs e) { if (txt_newpwd.Text == "" || txt_cfmpwd.Text == "") { MessageBox.Show("Please Enter Password"); } else if (txt_newpwd.Text.Length < 6 || txt_cfmpwd.Text.Length < 6) { MessageBox.Show("Please Enter Minimum 6 Length Password"); txt_newpwd.Text = string.Empty; txt_cfmpwd.Text = string.Empty; } else if (txt_newpwd.Text != txt_cfmpwd.Text) { MessageBox.Show("Password Does not match"); txt_newpwd.Text = string.Empty; txt_cfmpwd.Text = string.Empty; } else { BusinessLayer.BAL bl = new BAL(); int result = 0; result = bl.UpdateRecord(label6.Text, txt_newpwd.Text); if (result > 0) { MessageBox.Show("User Password Changed"); txt_newpwd.Text = string.Empty; txt_cfmpwd.Text = string.Empty; } else { MessageBox.Show("Password Cannot Change"); } } }
public JsonResult NewAdmin(AdminViewModel model) { BAL objBal = new BAL(); bool status = objBal.AddAdmin(model); return(Json(status, JsonRequestBehavior.AllowGet)); }
public IHttpActionResult PTADOCLIST(BAL ud) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } try { DataSet ds = repo.GETPTADOCLIST(Convert.ToInt32(ud.userID), ud.TokenID); if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "1") { return(Ok(new { message = "Success", result = ds.Tables[0], status = true })); } else if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "-7") { return(Content(HttpStatusCode.NotFound, new { message = "Not found", result = "", status = false })); } else if (Convert.ToString(ds.Tables[1].Rows[0][0]) == "7") { return(Content(HttpStatusCode.NotFound, new { message = "Invalid Token", result = "", status = false })); } else { return(Content(HttpStatusCode.NotFound, new { message = "No Data found", result = "", status = false })); } } catch (Exception) { throw; } }
private void btn_register_Click(object sender, EventArgs e) { if (txt_uname.Text == "" || txt_pwd.Text == "" || txt_cpwd.Text == "") { MessageBox.Show("Please fill all details"); } else if (txt_pwd.Text != txt_cpwd.Text) { MessageBox.Show("Password Does not Match"); txt_pwd.Text = string.Empty; txt_cpwd.Text = string.Empty; } else { BusinessLayer.BAL bl = new BAL(); int result = bl.User_Register(txt_uname.Text, txt_pwd.Text); if (result == 0 || txt_uname.Text == "Administrator" || txt_uname.Text == "admin" || txt_uname.Text == "administrator") { MessageBox.Show("Cannot create Administrator Account"); } else if (result == 1) { MessageBox.Show("You have Successfully Registered and get an Rs.1000 Security Amount for issuing book"); this.Close(); //txt_uname.Text = string.Empty; //txt_pwd.Text = string.Empty; //txt_cpwd.Text = string.Empty; } else { MessageBox.Show("User Already Registered! Try another username"); } } }
private void btn_add_Click(object sender, EventArgs e) { if (add_book.Text == "" || add_author.Text == "" || add_price.Text == "" || add_qnt.Text == "") { MessageBox.Show("Please Enter all Details Properly"); } else { Login log = new Login(); BusinessLayer.BAL bl = new BAL(); int result = 0; result = bl.AddBook(add_book.Text, Convert.ToInt32(add_cmb.SelectedValue), Convert.ToDecimal(add_price.Text), add_qnt.Text, add_author.Text); if (result > 0) { MessageBox.Show("Book Added Successfully"); adminDefault admin = new adminDefault(lbl_text.Text); this.Hide(); admin.ShowDialog(); } else { MessageBox.Show("Book Already Present"); } } }
protected void btnadd_Click(object sender, EventArgs e) { BAL bal = new BAL(); bal.accountname = txtaccountname.Text; bal.Address = txtaddress.Text; bal.city = txtcity.Text; bal.mobile = txtmobile.Text; bal.openingbalance = txtopbal.Text; //drpdebitorcredit.Text = bal.debit; //drpdebitorcredit.Text = bal.credit; if (drpdebitorcredit.Text == "Cr.") { bal.credit = Convert.ToDecimal(txtopbal.Text); bal.debit = 0; } else if (drpdebitorcredit.Text == "Dr.") { bal.debit = Convert.ToDecimal(txtopbal.Text); bal.credit = 0; } bal.groupname = drpgroup.Text; bal.debitcredit = drpdebitorcredit.Text; dal.accountinsert(bal); ScriptManager.RegisterStartupScript(this, this.GetType(), "alert", "alert('Data Inserted')", true); clear(); }
public ActionResult Details(int id) { BAL db = new BAL(); var currentContact = db.RetrieveContact(id); return(View(currentContact)); }
public void insstu(BAL b) { SqlCommand cmd = new SqlCommand("insert into tbladmission (stuname, stufatname, stumotname, religion, nationality, dob, pob, gender, deformity, address, mobile, father_occu, Monthlyincome, Pre_sch, rfl_pre_sch, adm_ref, oth_cont_name, oth_cont_num, app_for_class, id_copy, bir_cert_copy, photos_path, sch_lea_cert, clasid, status) values (@stn,@stfn,@stmn,@rel,@nat,@db,@pb,@gn,@df,@add,@mb,@fo,@fmi,@prsh,@rflps,@adre,@ocn,@ocnn,@afc,@idc,@bcc,@pp,@slc,@cid,@sta)", d.con); cmd.Parameters.AddWithValue("@stn", b.stuname); cmd.Parameters.AddWithValue("@stfn", b.stufatname); cmd.Parameters.AddWithValue("@stmn", b.stumotname); cmd.Parameters.AddWithValue("@rel", b.religion); cmd.Parameters.AddWithValue("@nat", b.nationality); cmd.Parameters.AddWithValue("@db", b.dob); cmd.Parameters.AddWithValue("@pb", b.pob); cmd.Parameters.AddWithValue("@gn", b.gender); cmd.Parameters.AddWithValue("@df", b.deformity); cmd.Parameters.AddWithValue("@add", b.address); cmd.Parameters.AddWithValue("@mb", b.mobile); cmd.Parameters.AddWithValue("@fo", b.father_occu); cmd.Parameters.AddWithValue("@fmi", b.Monthlyincome); cmd.Parameters.AddWithValue("@prsh", b.Pre_sch); cmd.Parameters.AddWithValue("@rflps", b.rfl_pre_sch); cmd.Parameters.AddWithValue("@adre", b.adm_ref); cmd.Parameters.AddWithValue("@ocn", b.oth_cont_name); cmd.Parameters.AddWithValue("@ocnn", b.oth_cont_num); cmd.Parameters.AddWithValue("@afc", b.app_for_class); cmd.Parameters.AddWithValue("@idc", b.id_copy); cmd.Parameters.AddWithValue("@bcc", b.bir_cert_copy); cmd.Parameters.AddWithValue("@pp", b.photos_path); cmd.Parameters.AddWithValue("@slc", b.sch_lea_cert); cmd.Parameters.AddWithValue("@cid", b.clasid); cmd.Parameters.AddWithValue("@sta", b.status); d.getall(cmd); }
public ActionResult Delete(int id) { BAL bAL = new BAL(); bAL.deleteProduct(id); return(RedirectToAction("Index")); }
public ActionResult Edit(int id) { BAL db = new BAL(); var contact = db.RetrieveContact(id); return(View(contact)); }
public bool insertremembrance(BAL.remembrance objreg) { if (con.State.ToString() == "Open") { con.Close(); } con.Open(); SqlCommand cmd = new SqlCommand("add_remembrancetdl", con); cmd.CommandType = CommandType.StoredProcedure; try { cmd.Parameters.AddWithValue("@type ", objreg.type); cmd.Parameters.AddWithValue("@cattype ", objreg.cattype); cmd.Parameters.AddWithValue("@country", objreg.country); cmd.Parameters.AddWithValue("@regionCounty", objreg.regionCounty); cmd.Parameters.AddWithValue("@townCity ", objreg.townCity); cmd.Parameters.AddWithValue("@address", objreg.address); cmd.Parameters.AddWithValue("@Surname1", objreg.Surname1); cmd.Parameters.AddWithValue("@name1", objreg.name1); cmd.Parameters.AddWithValue("@img1", objreg.img1); cmd.Parameters.AddWithValue("@deathdate1", objreg.deathdate1); cmd.Parameters.AddWithValue("@middlename", objreg.middlename); cmd.Parameters.AddWithValue("@name2", objreg.name2); cmd.Parameters.AddWithValue("@img2", objreg.img2); cmd.Parameters.AddWithValue("@deathdate2", objreg.deathdate2); cmd.Parameters.AddWithValue("@message", objreg.message); cmd.Parameters.AddWithValue("@img3", objreg.img3); cmd.Parameters.AddWithValue("@name", objreg.name); cmd.Parameters.AddWithValue("@number", objreg.number); cmd.Parameters.AddWithValue("@email", objreg.email); cmd.Parameters.AddWithValue("@active", objreg.active); cmd.Parameters.AddWithValue("@capm", objreg.capm); cmd.Parameters.AddWithValue("@capf", objreg.capf); cmd.Parameters.AddWithValue("@capa", objreg.capa); cmd.ExecuteNonQuery(); con.Close(); return true; } catch (Exception ex) { return false; } finally { cmd.Dispose(); con.Close(); //con.Dispose(); } }
public DataTable getUNPass(BAL b) { string cmdtext = "Select * from tblLogin where UserName=@un and Password=@pass"; cmd = new SqlCommand(cmdtext, con); cmd.Parameters.AddWithValue("@un", b.UN); cmd.Parameters.AddWithValue("@pass", b.Pass); da = new SqlDataAdapter(cmd); dt = new DataTable(); da.Fill(dt); return dt; }
public ActionResult Index(BAL.ForgotPwd model) { if (this.IsCaptchaValid("Captcha is not valid")) { if (ModelState.IsValid) { MembershipUser _user; _user = System.Web.Security.Membership.GetUser(model.UserID, false); if (_user != null) { try { String IpAddress = ControllerContext.HttpContext.Request.UserHostAddress; // Request.ServerVariables["REMOTE_ADDR"];// System.Web.HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"]; if (IpAddress != null) { model.ResetIpAddress = IpAddress; } LoginSession loginSession = new LoginSession(); loginSession = BAL.BALLoginSessionModels.LoginDetails(model.UserID); if (loginSession.UserID != null) { model.CreateBy = loginSession.UserID.ToString(); } if (RegistrationModels.PasswordReset(model)) { ResetPassword(model.UserID); ViewBag.ErrMessage = "Thank you for Submitting your Email address. Your password rest link is send to your Email.Please login to your Email account and follow the step to reset your password."; } else { ViewBag.ErrMessage = "Try Again.."; } } catch (Exception ex) { ViewBag.ErrMessage = "Error:" + ex.Message; } } else { ViewBag.ErrMessage = "Email address is not registered with mysycous.com"; } } else { ViewBag.ErrMessage = "Error: Eamil Address is not valid."; } } else { ViewBag.ErrMessage = "Error: captcha is not valid."; } return View(); }
protected void btnShow_Click(object sender, EventArgs e) { try { BAL Cust = new BAL(); DataSet dstObj = Cust.View(); if(dstObj.Tables.Count > 0) { gvCustomer.DataSource = dstObj; gvCustomer.DataBind(); } else { ShowAlert("No Records Found"); } } catch(Exception ex) { ShowAlert(ex.Message.ToString()); } }
public void GetChartData() { // BAL Cust = new BAL() ; // DataSet dstObj = Cust.ToArray<Enum>(); //Series series = Chart1.Series["Series1"]; BAL Cust = new BAL(); DataSet dstObj = Cust.View(); Chart1.DataSource = dstObj; dstObj.CreateDataReader(); //Chart1.Series["Series1"]. Chart1.Series["Series1"].ChartType = SeriesChartType.Line; Chart1.Series["Series1"].XValueMember = "Year_Ref"; Chart1.Series["Series1"].YValueMembers = "Rain_Full_Year"; Chart1.DataBind(); //chartPlaceHolder.Controls.Add(chart1); }
public bool updateremembrancemess(BAL.remembrance objreg) { if (con.State.ToString() == "Open") { con.Close(); } con.Open(); SqlCommand cmd = new SqlCommand("update_remembrancetdlmess", con); cmd.CommandType = CommandType.StoredProcedure; try { cmd.Parameters.AddWithValue("@img1 ", objreg.img1); cmd.Parameters.AddWithValue("@img2 ", objreg.img2); cmd.Parameters.AddWithValue("@img3", objreg.img3); cmd.Parameters.AddWithValue("@message", objreg.message); cmd.Parameters.AddWithValue("@capm ", objreg.capm); cmd.Parameters.AddWithValue("@capf ", objreg.capf); cmd.Parameters.AddWithValue("@capa", objreg.capa); cmd.Parameters.AddWithValue("@rid", objreg.rid); cmd.ExecuteNonQuery(); con.Close(); return true; } catch (Exception ex) { return false; } finally { cmd.Dispose(); con.Close(); //con.Dispose(); } }
public DataTable reg_getUNPass(BAL b) { return d.getUNPass(b); }
public bool insertremembrancemessage(BAL.remmessage objreg) { if (con.State.ToString() == "Open") { con.Close(); } con.Open(); SqlCommand cmd = new SqlCommand("add_remembrancemessage", con); cmd.CommandType = CommandType.StoredProcedure; try { cmd.Parameters.AddWithValue("@remembranceid", objreg.remembranceid); cmd.Parameters.AddWithValue("@firstname", objreg.firstname); cmd.Parameters.AddWithValue("@surname", objreg.surname); cmd.Parameters.AddWithValue("@email", objreg.email); cmd.Parameters.AddWithValue("@rem_message", objreg.rem_message); // cmd.Parameters.AddWithValue("@messageDate", objreg.address); cmd.Parameters.AddWithValue("@flowername", objreg.flowername); cmd.Parameters.AddWithValue("@onlineStatus", objreg.onlineStatus); cmd.ExecuteNonQuery(); con.Close(); return true; } catch (Exception ex) { return false; } finally { cmd.Dispose(); con.Close(); //con.Dispose(); } }
public bool updateinmemorial(BAL.inmemorial objin) { if (con.State.ToString() == "Open") { con.Close(); } con.Open(); SqlCommand cmd = new SqlCommand("update_inmemorialcardtdl", con); cmd.CommandType = CommandType.StoredProcedure; try { cmd.Parameters.AddWithValue("@country", objin.country); cmd.Parameters.AddWithValue("@regionCounty", objin.regionCounty); cmd.Parameters.AddWithValue("@townCity", objin.townCity); cmd.Parameters.AddWithValue("@pmess", objin.pmess); cmd.Parameters.AddWithValue("@mess", objin.mess); cmd.Parameters.AddWithValue("@name", objin.name); // cmd.Parameters.AddWithValue("@messageDate", objreg.address); cmd.Parameters.AddWithValue("@email", objin.email); cmd.Parameters.AddWithValue("@img", objin.img); cmd.Parameters.AddWithValue("@dessurname", objin.dessurname); cmd.Parameters.AddWithValue("@desname", objin.desname); cmd.Parameters.AddWithValue("@desemail", objin.desemail); cmd.Parameters.AddWithValue("@cid", objin.cid); cmd.ExecuteNonQuery(); con.Close(); return true; } catch (Exception ex) { return false; } finally { cmd.Dispose(); con.Close(); //con.Dispose(); } }
// public bool deleteinmomoriyamstatus(BAL.inmemorial objreg) { if (con.State.ToString() == "Open") { con.Close(); } con.Open(); SqlCommand cmd = new SqlCommand("delete inmemorialcardtdl WHERE cid=@cid", con); cmd.CommandType = CommandType.Text; try { cmd.Parameters.AddWithValue("@cid", objreg.cid); cmd.ExecuteNonQuery(); con.Close(); return true; } catch (Exception ex) { return false; } finally { cmd.Dispose(); con.Close(); //con.Dispose(); } }
public bool deletetributeappov(BAL.remmessage objreg) { if (con.State.ToString() == "Open") { con.Close(); } con.Open(); SqlCommand cmd = new SqlCommand("delete remembrancemessage WHERE idrm=@idrm", con); cmd.CommandType = CommandType.Text; try { cmd.Parameters.AddWithValue("@idrm", objreg.idrm); cmd.ExecuteNonQuery(); con.Close(); return true; } catch (Exception ex) { return false; } finally { cmd.Dispose(); con.Close(); //con.Dispose(); } }
public bool updateremembrancestatus(BAL.remembrance objreg) { if (con.State.ToString() == "Open") { con.Close(); } con.Open(); SqlCommand cmd = new SqlCommand("UPDATE remembrancetdl SET active=@active WHERE rid=@rid", con); cmd.CommandType = CommandType.Text; try { cmd.Parameters.AddWithValue("@active", objreg.active); cmd.Parameters.AddWithValue("@rid", objreg.rid); cmd.ExecuteNonQuery(); con.Close(); return true; } catch (Exception ex) { return false; } finally { cmd.Dispose(); con.Close(); //con.Dispose(); } }