Exemplo n.º 1
0
        protected void DdlContinents_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (DdlContinents.SelectedIndex == 0)
            {
                DdlCountry.Enabled       = false;
                DdlCountry.SelectedIndex = 0;

                DdlCity.Enabled       = false;
                DdlCity.SelectedIndex = 0;
            }
            else
            {
                DdlCountry.Enabled = true;

                SqlParameter parameter = new SqlParameter("@ContinentID", DdlContinents.SelectedValue);
                DataSet      ds        = getData("spGetCountriesByContinentId", parameter);

                DdlCountry.DataSource = ds;
                DdlCountry.DataBind();

                ListItem itemCountry = new ListItem("Select Country", "-1");
                DdlCountry.Items.Insert(0, itemCountry);

                DdlCity.SelectedIndex = 0;
                DdlCity.Enabled       = false;
            }
        }
Exemplo n.º 2
0
 public void BindCountry()
 {
     DdlCountry.DataTextField  = "name";
     DdlCountry.DataValueField = "id";
     DdlCountry.DataSource     = ds.Tables["Country"];
     DdlCountry.DataBind();
     BindState(DdlCountry.SelectedValue);
 }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack == false)
     {
         TxtState.Focus();
         this.Form.DefaultButton = BtnAdd.UniqueID;
         DataTable ObjCountryTable = MyJobPortalModel.Country.GetCountryRecords("status='Active'");
         DdlCountry.DataSource = ObjCountryTable;
         DdlCountry.DataBind();
         DdlCountry.Items.Insert(0, new ListItem("--Select--", "--Select--"));
     }
 }
    protected void LnkBtnAddBranchModal_Click(object sender, EventArgs e)
    {
        AddBranchModal.Visible  = true;
        this.Form.DefaultButton = BtnAddBranch.UniqueID;
        DataTable ObjCountryTable = MyJobPortalModel.Country.GetCountryRecords("status='Active'");

        DdlCountry.DataSource = ObjCountryTable;
        DdlCountry.DataBind();
        DdlCountry.Items.Insert(0, new ListItem("--Select Country--", "--Select--"));
        DdlState.Items.Add(new ListItem("--Select State--", "--Select--"));
        DdlCity.Items.Add(new ListItem("--Select Country--", "--Select--"));
    }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack == false)
     {
         TxtStateName.Focus();
         this.Form.DefaultButton = BtnGo.UniqueID;
         LblMessage.Text         = Request.QueryString["Message"];
         DataTable ObjCountryTable = MyJobPortalModel.Country.GetCountryRecords("status='Active'");
         DdlCountry.DataSource = ObjCountryTable;
         DdlCountry.DataBind();
         DdlCountry.Items.Insert(0, new ListItem("--Select--", "--Select--"));
         ShowGridView();
     }
 }
Exemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (this.IsPostBack == false)
     {
         LblDuplicateCompanyName.Visible = false;
         TxtCompanyName.Focus();
         this.Form.DefaultButton = BtnAddCompany.UniqueID;
         DataTable ObjIndustryTable = MyJobPortalModel.Industry.GetIndustryRecords("status='Active'");
         DdlIndustryName.DataSource = ObjIndustryTable;
         DdlIndustryName.DataBind();
         DdlIndustryName.Items.Insert(0, new ListItem("--Select--", "--Select--"));
         DataTable ObjCountryTable = MyJobPortalModel.Country.GetCountryRecords("status='Active'");
         DdlCountry.DataSource = ObjCountryTable;
         DdlCountry.DataBind();
         DdlCountry.Items.Insert(0, new ListItem("--Select Country--", "--Select--"));
         DdlState.Items.Add(new ListItem("--Select State--", "--Select--"));
         DdlCity.Items.Add(new ListItem("--Select City--", "--Select--"));
     }
 }
Exemplo n.º 7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Customer cs = new Customer();

            DdlCountry.DataSource     = cs.LoadCountries();
            DdlCountry.DataTextField  = "CountryName";
            DdlCountry.DataValueField = "ID";
            DdlCountry.DataBind();
            ListItem li = new ListItem("Choose", "0");

            DdlCountry.Items.Add(li);
            DdlCountry.SelectedValue = "0";


            DataSet DT = cs.LoadCustomer();

            GridViewCustomerDetails.DataSource = DT.Tables[0];
            GridViewCustomerDetails.DataBind();


            DisplayHobbies();
            Panel1.DataBind();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            //Collects current method and page for error tracking
            string method = "Page_Load";

            Session["currPage"] = "CustomerAddNew.aspx";
            object[] objPageDetails = { Session["currPage"].ToString(), method };
            try
            {
                //checks if the user has logged in
                if (Session["currentUser"] == null)
                {
                    //Go back to Login to log in
                    Response.Redirect("LoginPage.aspx", false);
                }
                else
                {
                    CU = (CurrentUser)Session["currentUser"];
                    //Checks for a Customer Key
                    if (Convert.ToInt32(Request.QueryString["customer"].ToString()) != -10)
                    {
                        if (!IsPostBack)
                        {
                            //Create customer class and fill page with all info based in the customer number
                            Customer customer = CM.CallReturnCustomerWithInvoiceList(Convert.ToInt32(Request.QueryString["customer"].ToString()), objPageDetails)[0];

                            txtFirstName.Text            = customer.varFirstName.ToString();
                            txtLastName.Text             = customer.varLastName.ToString();
                            txtPrimaryAddress.Text       = customer.varAddress.ToString();
                            txtSecondaryAddress.Text     = customer.secondaryAddress.ToString();
                            txtPrimaryPhoneNumber.Text   = customer.varContactNumber.ToString();
                            txtSecondaryPhoneNumber.Text = customer.secondaryPhoneNumber.ToString();
                            txtEmail.Text = customer.varEmailAddress.ToString();
                            txtCity.Text  = customer.varCityName.ToString();

                            DdlCountry.DataSource = LM.CallReturnCountryDropDown(objPageDetails);
                            DdlCountry.DataBind();
                            DdlCountry.SelectedValue  = customer.intCountryID.ToString();
                            ddlProvince.DataSource    = LM.CallReturnProvinceDropDown(customer.intCountryID, objPageDetails);
                            ddlProvince.SelectedValue = customer.intProvinceID.ToString();
                            ddlProvince.DataBind();

                            txtPostalCode.Text   = customer.varPostalCode.ToString();
                            chkEmailList.Checked = customer.bitSendMarketing;

                            //Binds invoice list to the grid view
                            GrdInvoiceSelection.DataSource = customer.invoices;
                            GrdInvoiceSelection.DataBind();
                        }
                    }
                    else
                    {
                        //no cust number
                        if (!IsPostBack)
                        {
                            DdlCountry.DataSource = LM.CallReturnCountryDropDown(objPageDetails);
                            DdlCountry.DataBind();
                            DdlCountry.SelectedValue = CU.location.intCountryID.ToString();

                            ddlProvince.DataSource = LM.CallReturnProvinceDropDown(0, objPageDetails);
                            ddlProvince.DataBind();
                        }
                        //Displays text boxes instead of label for customer creation info
                        txtFirstName.Enabled            = true;
                        txtLastName.Enabled             = true;
                        txtPrimaryAddress.Enabled       = true;
                        txtSecondaryAddress.Enabled     = true;
                        txtPrimaryPhoneNumber.Enabled   = true;
                        txtSecondaryPhoneNumber.Enabled = true;
                        txtEmail.Enabled      = true;
                        txtCity.Enabled       = true;
                        ddlProvince.Enabled   = true;
                        DdlCountry.Enabled    = true;
                        chkEmailList.Enabled  = true;
                        txtPostalCode.Enabled = true;
                        //hides and displays the proper buttons for access
                        BtnSaveCustomer.Visible        = false;
                        BtnAddCustomer.Visible         = true;
                        pnlDefaultButton.DefaultButton = "btnAddCustomer";
                        BtnEditCustomer.Visible        = false;
                        BtnStartSale.Visible           = false;
                        BtnCancel.Visible       = false;
                        BtnBackToSearch.Visible = true;
                    }
                }
            }
            //Exception catch
            catch (ThreadAbortException tae) { }
            catch (Exception ex)
            {
                //Log all info into error table
                ER.CallLogError(ex, CU.employee.intEmployeeID, Convert.ToString(Session["currPage"]) + "-V3.2", method, this);
                //Display message box
                MessageBoxCustom.ShowMessage("An Error has occurred and been logged. "
                                             + "If you continue to receive this message please contact "
                                             + "your system administrator.", this);
            }
        }
Exemplo n.º 9
0
        //private static Employee employee;

        protected void Page_Load(object sender, EventArgs e)
        {
            //Collects current method and page for error tracking
            string method = "Page_Load";

            Session["currPage"] = "EmployeeAddNew.aspx";
            object[] objPageDetails = { Session["currPage"].ToString(), method };
            try
            {
                //checks if the user has logged in
                if (Session["currentUser"] == null)
                {
                    //Go back to Login to log in
                    Response.Redirect("LoginPage.aspx", false);
                }
                else
                {
                    CU = (CurrentUser)Session["currentUser"];
                    if (CU.employee.intJobID != 0)
                    {
                        //If user is not an admin then disable the edit employee button
                        BtnEditEmployee.Enabled = false;
                    }
                    //Check to see if an employee was selected
                    if (Convert.ToInt32(Request.QueryString["employee"].ToString()) != -10)
                    {
                        if (!IsPostBack)
                        {
                            //Create an employee class
                            Employee employee = EM.CallReturnEmployee(Convert.ToInt32(Request.QueryString["employee"].ToString()), objPageDetails)[0];
                            //Fill asll lables with current selected employee info
                            txtFirstName.Text = employee.varFirstName.ToString();
                            txtLastName.Text  = employee.varLastName.ToString();

                            ddlJob.DataSource = EM.CallReturnJobPosition(objPageDetails);
                            ddlJob.DataBind();
                            ddlJob.SelectedValue = employee.intJobID.ToString();

                            ddlLocation.DataSource = LM.CallReturnLocationDropDown(objPageDetails);
                            ddlLocation.DataBind();
                            ddlLocation.SelectedValue = employee.location.intLocationID.ToString();

                            txtEmail.Text = employee.varEmailAddress.ToString();
                            txtPrimaryPhoneNumber.Text   = employee.varContactNumber.ToString();
                            txtSecondaryPhoneNumber.Text = employee.secondaryContactNumber.ToString();
                            txtPrimaryAddress.Text       = employee.varAddress.ToString();
                            txtSecondaryAddress.Text     = employee.secondaryAddress.ToString();
                            txtCity.Text              = employee.varCityName.ToString();
                            txtPostalCode.Text        = employee.varPostalCode.ToString();
                            ddlProvince.SelectedValue = employee.intProvinceID.ToString();
                            DdlCountry.SelectedValue  = employee.intCountryID.ToString();
                            DdlCountry.DataSource     = LM.CallReturnCountryDropDown(objPageDetails);
                            DdlCountry.DataBind();
                            ddlProvince.DataSource = LM.CallReturnProvinceDropDown(employee.intCountryID, objPageDetails);
                            ddlProvince.DataBind();
                        }
                    }
                    else
                    {
                        if (!IsPostBack)
                        {
                            ddlJob.DataSource = EM.CallReturnJobPosition(objPageDetails);
                            ddlJob.DataBind();
                            ddlJob.SelectedValue = CU.employee.intJobID.ToString();

                            ddlLocation.DataSource = LM.CallReturnLocationDropDown(objPageDetails);
                            ddlLocation.DataBind();
                            ddlLocation.SelectedValue = CU.location.intLocationID.ToString();

                            DdlCountry.DataSource = LM.CallReturnCountryDropDown(objPageDetails);
                            DdlCountry.DataBind();
                            DdlCountry.SelectedValue = CU.location.intCountryID.ToString();

                            ddlProvince.DataSource = LM.CallReturnProvinceDropDown(0, objPageDetails);
                            ddlProvince.DataBind();
                            ddlProvince.SelectedValue = CU.location.intProvinceID.ToString();
                        }
                        //With no employee selected display text boxes and drop downs to add employee
                        txtFirstName.Enabled = true;
                        txtLastName.Enabled  = true;
                        ddlJob.Enabled       = true;
                        ddlLocation.Enabled  = true;

                        txtEmail.Enabled = true;
                        txtPrimaryPhoneNumber.Enabled   = true;
                        txtSecondaryPhoneNumber.Enabled = true;
                        txtPrimaryAddress.Enabled       = true;
                        txtSecondaryAddress.Enabled     = true;
                        txtCity.Enabled       = true;
                        txtPostalCode.Enabled = true;
                        ddlProvince.Enabled   = true;
                        DdlCountry.Enabled    = true;

                        //hides and displays the proper buttons for access
                        BtnSaveEmployee.Visible        = false;
                        BtnAddEmployee.Visible         = true;
                        pnlDefaultButton.DefaultButton = "btnAddEmployee";
                        BtnEditEmployee.Visible        = false;
                        BtnCancel.Visible       = false;
                        BtnBackToSearch.Visible = true;
                    }
                }
            }
            //Exception catch
            catch (ThreadAbortException tae) { }
            catch (Exception ex)
            {
                //Log all info into error table
                ER.CallLogError(ex, CU.employee.intEmployeeID, Convert.ToString(Session["currPage"]) + "-V3.2", method, this);
                //Display message box
                MessageBoxCustom.ShowMessage("An Error has occurred and been logged. "
                                             + "If you continue to receive this message please contact "
                                             + "your system administrator.", this);
            }
        }