Exemple #1
0
 private void GetRecords(int Id)
 {
     DataTable table = BAL_Zones.SelectZones("selectbyid", Id);
     {
         txtZone.Text = Convert.ToString(table.Rows[0]["ZoneName"]);
     }
 }
Exemple #2
0
    protected void btnCarGo_Click(object sender, EventArgs e)
    {
        if (Page.IsValid)
        {
            Session["CapId"]        = null;
            Session["userdata"]     = null;
            Session["CarRegNumber"] = null;

            string strUserIp = HttpContext.Current.Request.ServerVariables["REMOTE_ADDR"];

            if (!string.IsNullOrEmpty(strUserIp))
            {
                /*if development mode*/
                if (Convert.ToBoolean(ConfigurationManager.AppSettings["DevelopmentMode"]))
                {
                    log.Debug("Go -> Development mode");
                    Session["CarRegNumber"] = txtSellCarRegNumber.Text;
                    Response.Redirect("car.aspx?carnumber=" + txtSellCarRegNumber.Text);
                }

                //check the ipaddress in db
                if (BAL_Zones.VisitorTracking(strUserIp))
                {
                    log.Debug("Go -> Live mode");
                    Session["CarRegNumber"] = txtSellCarRegNumber.Text;
                    Response.Redirect("car.aspx?carnumber=" + txtSellCarRegNumber.Text);
                }
                else
                {
                    ShowMessage("You have used our service too many times in the last 24 hours or your IP address has been blacklisted. Please call us or retry tomorrow");
                }
            }
        }
    }
Exemple #3
0
    private void Fillddl()
    {
        DataTable dt = BAL_Zones.SelectZones("selectall", 0);

        ddlZoneName.DataSource     = dt;
        ddlZoneName.DataValueField = "ZoneID";
        ddlZoneName.DataTextField  = "ZoneName";
        ddlZoneName.DataBind();
        ddlZoneName.Items.Insert(0, new ListItem("-- Select --", "-1"));
    }
Exemple #4
0
 protected void btnInActive_Click(object sender, EventArgs e)
 {
     if (BAL_Zones.DeleteZones("inactive", ReturnIds()) == true)
     {
         ShowMessage("Record Deactivated succefully");
         FillGrid();
     }
     else
     {
         ShowMessage("Error in record deactivation.");
     }
 }
Exemple #5
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     if (BAL_Zones.DeleteZones("delete", ReturnIds()) == true)
     {
         ShowMessage("Record Deleted Successfully.");
         FillGrid();
     }
     else
     {
         ShowMessage("Error in record deletion.");
     }
 }
Exemple #6
0
    private void FillGrid()
    {
        DataTable table = BAL_Zones.SelectZones("selectall", 0);

        gvAdminList.DataSource = table;
        gvAdminList.DataBind();
        if (gvAdminList.Rows.Count > 0)
        {
            lblsearch2.Visible = true;
        }
        else
        {
            lblsearch2.Visible = false;
        }
    }
Exemple #7
0
    protected void imgbtn_Insert_Click(object sender, EventArgs e)
    {
        if (ValidateInput() == false)
        {
            Page.Validate("AddCategory");
            if (Page.IsValid == true)
            {
                txtZone.Text = Server.HtmlEncode(txtZone.Text);

                if (string.IsNullOrEmpty(lblMode.Text))
                {
                    lblMode.Text = "0";
                    if (BAL_Zones.InsertUpdateZones("insert", lblMode.Text, txtZone.Text, "0") == true)
                    {
                        ShowMessage("Record Insert Susseccfully.");
                        FillGrid();
                        ClearInput();
                    }
                    else
                    {
                        ShowMessage("Error in record updation.");
                    }
                    lblMode.Text = string.Empty;
                }
                else
                {
                    if (BAL_Zones.InsertUpdateZones("update", lblMode.Text, txtZone.Text, "0") == true)
                    {
                        ShowMessage("Record Updated Susseccfully.");
                        FillGrid();
                        ClearInput();
                    }
                    else
                    {
                        ShowMessage("Error in record insertion.");
                    }
                }
            }
            else
            {
                ShowMessage("Some Required Field Missing");
            }
        }
    }