protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
            _user = (Users)Session["user"];
            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=default.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=default.aspx?" + str);
            }
            if (!IsPostBack)
            {

                if (Request.QueryString["id"] != null)
                {
                    string costCenterId = Request.QueryString["id"].ToString();

                    CostCenter costCenter = new CostCenter().GetCostCenterByCostCenterId(int.Parse(costCenterId), _company.CompanyId);
                    if (costCenter != null || costCenter.CostCenterId != 0)
                    {
                        lblId.Text = costCenter.CostCenterId.ToString();
                        txtCostCenterType.Value = costCenter.CostCenterType;
                        txtCostCentreName.Value = costCenter.CostCenterName;
                    }
                }
            }
            this.GetAllCostCentre();
        }
        protected void RadGrid1_OnItemCommand(object sender, GridCommandEventArgs e)
        {
            try
            {
                GridDataItem item = (GridDataItem)e.Item;
                string id = item["colId"].Text;
                switch (e.CommandName)
                {
                    case "btnSelect":
                        Response.Redirect("CompanyInfo.aspx?id=" + id, true);
                        break;
                    case "btnDelete":
                        int delete = new Company().DeleteCompanyByCompanyId(int.Parse(id));
                        long addressid = GetAddressID(int.Parse(id));
                        int deleteAddress = new Addresses().DeleteAddressesByAddressId(addressid);
                        if (delete == 0)
                            Alert.Show("Data was not deleted");
                        else
                        {
                            this.LoadCompanyListTable();
                        }
                        break;

                }
            }
            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
            _user = (Users)Session["User"];

            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=index.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=index.aspx?" + str);
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    string bankId = Request.QueryString["id"].ToString();

                    Bank bank = new Bank().GetBankByBankId(int.Parse(bankId), _company.CompanyId);
                    if (bank != null || bank.BankId != 0)
                    {
                        lblId.Text = bank.BankId.ToString();
                        txtBankCode.Value = bank.BankCode;
                        txtBankName.Value = bank.BankName;
                        txtContactPerson.Value = bank.ContactPerson;
                        txtDesignation.Value = bank.ContactDesignation;
                        txtContactNo.Value = bank.ContactNo;
                        txtEmail.Value = bank.ContactEmail;
                        chkIsActive.Checked = bank.IsActive;
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
            if (Session["saveBankAccountInfo"] != null)
            {
                string msg = Session["saveBankAccountInfo"].ToString();
                Session["saveBankAccountInfo"] = null;
                Alert.Show(msg);
            }
            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=default.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=default.aspx?" + str);
            }
            if (!IsPostBack)
            {
                userId = 1;
            }

            this.LoadAccountTypeDropDown();

            this.LoadBankNames();
               this.LoadAccountsTable();
        }
        protected void btnLogIn_Click(object sender, EventArgs e)
        {
            try
            {

                Users user = new Users().GetUserByUserName(txtUserName.Value);
                if (user.UserId != 0)
                {
                    if (user.UserPassword != txtPassword.Value)
                    {
                        Alert.Show("User and password didn't match. Please re-enter the correct password.");
                        txtPassword.Focus();
                        return;
                    }

                    int companyId = int.Parse(ddlCompany.SelectedValue);

                    Session["user"] = user;
                    UserRoleMapping userRole = new UserRoleMapping().GetUserRoleMappingByUserId(user.UserId);
                    UserRole role = new UserRole().GetUserRoleById(userRole.RoleId, companyId);
                    Session["Role"] = role;

                    //Get host and port from the url;
                    string host = HttpContext.Current.Request.Url.Host;
                    string port = HttpContext.Current.Request.Url.Port.ToString();

                    string path = "http://" + host + ":" + port + "/";
                    this.GenerateMenu(user, path, Int32.Parse("0"));

                    Company company= new Company().GetCompanyByCompanyId(companyId);
                    Session["company"] = company;

                    if (user.EmployeeId != 0)
                    {
                        Employee employee = new Employee().GetEmployeeByEmployeeId(user.EmployeeId,
                            user.CompanyId);
                        Session["Employee"] = employee;

                        //Department objDepartment = new Department().GetEmployeeDepartment(user.EmployeeId);
                        //Session["Department"] = objDepartment.DepartmentName;
                    }
                    else
                        Session["Department"] = "All";

                    string refPage = (Request.QueryString["refPage"] == null) ? string.Empty : Request.QueryString["refPage"].ToString();
                    Response.Redirect(((refPage == string.Empty || refPage.ToLower() == "logout") ? "index.aspx" : refPage), false);
                }
                else
                {
                    Alert.Show("The user is not exist in the database. Please check the username.");
                    txtUserName.Focus();
                    return;
                }
            }
            catch (Exception ex)
            {
                Alert.Show("Error during process user authentication. Error: " + ex.Message);
            }
        }
 public void LoadCompanyDropDownList()
 {
     List<Company> companyList=new List<Company>();
     Company aCompany=new Company();
     companyList = aCompany.GetAllCompany(0);
     companyIdRadDropDownList1.DataSource = companyList;
     companyIdRadDropDownList1.DataTextField = "CompanyName";
     companyIdRadDropDownList1.DataValueField = "CompanyId";
     companyIdRadDropDownList1.DataBind();
 }
Exemplo n.º 7
0
 public void LoadAllCompany()
 {
     try
     {
         Company aCompany = new Company();
         companyList = aCompany.GetAllCompany(0);
     }
     catch (Exception exc)
     {
         Alert.Show(exc.Message);
     }
 }
Exemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
              user =(Users) Session["user"];
              if (Session["savedListMessage"] !=null)
              {
                  string msg = Session["savedListMessage"].ToString();
                  Alert.Show(msg);
                  Session["savedListMessage"] = null;
              }

            this.GetAllListTable();
            this.LoadListTable();
        }
Exemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
            user = (Users)Session["user"];
            if (!IsPostBack)
            {
                if (Session["savedMessage"]!=null)
                {
                    Alert.Show("Successfully saved information");
                    Session["savedMessage"] = null;

                }
                this.LoadCompanyIdDropDown();
                this.LoadUserInfoTable();
            }
        }
 protected void Page_Load(object sender, EventArgs e)
 {
     _company = (Company) Session["Company"];
     if (!isValidSession())
     {
         string str = Request.QueryString.ToString();
         if(str==string.Empty)
             Response.Redirect("LogIn.aspx?refPage=index.aspx");
         else
         {
             Response.Redirect("LogIn.aspx?refPage=index.aspx?"+str);
         }
     }
     if (!IsPostBack)
         this.LoadDesignationTable();
 }
Exemplo n.º 11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _company = (Company)Session["Company"];
     if (!isValidSession())
     {
         string str = Request.QueryString.ToString();
         if (str == string.Empty)
             Response.Redirect("LogIn.aspx?refPage=default.aspx");
         else
             Response.Redirect("LogIn.aspx?refPage=default.aspx?" + str);
     }
     if (!IsPostBack)
     {
         _user = (Users)Session["user"];
     }
     this.GetAllCostCentre();
     this.LoadCostCentreTable();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["Menu"] != null)
                {
                    string menu = Session["Menu"].ToString();
                    ltrlMenu.Text = menu;
                }

                if (Session["company"] != null)
                {
                    company = (Company) Session["company"];
                    ltrlCompany.Text = company.CompanyName;
                    name1.InnerText += company.CompanyName;
                    name2.InnerText += company.CompanyName;
                }
            }
        }
Exemplo n.º 13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];

            AccountInfoPageDiv.Disabled = true;
            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=default.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=default.aspx?" + str);
            }
            this.LoadAccountTypeDropDown();
            this.LoadBankTable();

            this.LoadBankNames();
            this.LoadAccountsTable();
        }
Exemplo n.º 14
0
        protected void btnLogIn_Click(object sender, EventArgs e)
        {
            try
            {
                Users user = new Users().GetUserByUserName(txtUserName.Value);
                if (user.UserId != 0)
                {
                    if (user.UserPassword != txtPassword.Value)
                    {
                        Alert.Show("User and password didn't match. Please re-enter the correct password.");
                        txtPassword.Focus();
                        return;
                    }

                    //string IP = Request.UserHostName;
                    //string compName = DetermineCompName(IP);

                    //UserLoginLog log = new UserLoginLog().GetUserLastLogin(user.UserId);
                    //if (log.Id != 0)
                    //{
                    //    if (log.IpAddress != IP && log.Status == "Logged In")
                    //    {
                    //        Alert.Show("Sorry! This is user is already logged in from another PC.");
                    //        return;
                    //    }
                    //}

                    Session["user"] = user;
                    UserRoleMapping userRole = new UserRoleMapping().GetUserRoleMappingByUserId(user.UserId);
                    UserRole role = new UserRole().GetUserRoleById(userRole.RoleId, user.CompanyId);
                    Session["Role"] = role;

                    //Get host and port from the url;
                    string host = HttpContext.Current.Request.Url.Host;
                    string port = HttpContext.Current.Request.Url.Port.ToString();

                    string path = "http://" + host + ":" + port + "/";
                    this.GenerateMenu(user, path);

                    //log = new UserLoginLog();
                    //log.UserId = user.UserId;
                    //log.SessionId = Session.SessionID;

                    //log.IpAddress = IP;
                    //log.LoginPCName = compName;
                    //log.LoginTime = DateTime.Now;
                    //log.Status = "Logged In";
                    //log.LogOutTime = PublicVariables.minDate;

                    //log.InsertUserLoginLog();
                    Company company;
                    UserRoleMapping userRoles = new UserRoleMapping().GetUserRoleMappingByUserId(user.UserId);
                    if (userRoles.RoleId != 0 && user.UserId == 1)
                    {
                        user.IsSuperUser = true;
                        company = new Company().GetCompanyByCompanyId(1);
                    }
                    else
                    {
                        user.IsSuperUser = false;
                        company = new Company().GetCompanyByCompanyId(user.CompanyId);
                    }

                    Session["company"] = company;

                    if (user.CompanyId == 0 && !user.IsSuperUser)
                    {
                        Alert.Show("Sorry this user is not associated with any company. Contact your system administrator to fix this issue.");
                        return;
                    }

                    if (user.EmployeeId != 0)
                    {
                        Employee employee = new Employee().GetEmployeeByEmployeeId(user.EmployeeId,
                            user.CompanyId);
                        Session["Employee"] = employee;

                        //Department objDepartment = new Department().GetEmployeeDepartment(user.EmployeeId);
                        //Session["Department"] = objDepartment.DepartmentName;
                    }
                    else
                        Session["Department"] = "All";

                    string refPage = (Request.QueryString["refPage"] == null) ? string.Empty : Request.QueryString["refPage"].ToString();
                    Response.Redirect(((refPage == string.Empty || refPage.ToLower() == "logout") ? "index.aspx" : refPage), false);
                }
                else
                {
                    Alert.Show("The user is not exist in the database. Please check the username.");
                    txtUserName.Focus();
                    return;
                }
            }
            catch (Exception ex)
            {
                Alert.Show("Error during process user authentication. Error: " + ex.Message);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];

            if (Session["savedCutomerMessage"] != null)
            {
                string msg = Session["savedCutomerMessage"].ToString();
                Alert.Show(msg);
                Session["savedCutomerMessage"] = null;
            }
            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=index.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=index.aspx?" + str);
            }

            this.LoadCountryDropdown();
            this.LoadSalesPersonDropDown();

            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    string customerID = Request.QueryString["id"].ToString();
                    Customer objCustomer = new Customer().GetCustomerByCustomerId(int.Parse(customerID), _company.CompanyId);
                    if (objCustomer != null || objCustomer.CustomerId != 0)
                    {
                        Addresses tempAddress = new Addresses();
                        List<Addresses> listAdddress = tempAddress.GetAllAddresses(_company.CompanyId);
                        foreach (Addresses addressese in listAdddress.Where(addressese => addressese.SourceId == objCustomer.CustomerId && addressese.SourceType == "Customer"))
                        {
                            tempAddress = addressese;
                            break;
                        }
                        addlblId.Text = tempAddress.AddressId.ToString();
                        lblId.Text = objCustomer.CustomerId.ToString();
                        txtCustomerName.Value = objCustomer.CustomerName;
                        txtCustomerCategory.Value = objCustomer.CustomerCategoryId.ToString();
                        SetIndex(salesPersonDropDownList, objCustomer.SalesPersonId.ToString());
                        countryDropDownList.SelectedIndex = tempAddress.CountryId;
                        chkIsActive.Checked = objCustomer.IsActive;
                        txtCreditLimit.Value = objCustomer.CreditLimit.ToString();
                        txtAddressLine1.Value = tempAddress.AddressLine1;
                        txtAddressLine2.Value = tempAddress.AddressLine2;
                        txtCity.Value = tempAddress.City;
                        txtZipCode.Value = tempAddress.ZipCode;
                        txtPhoneNo.Value = tempAddress.Phone;
                        txtMobile.Value = tempAddress.Mobile;
                        txtEmail.Value = tempAddress.Email;
                        txtWeb.Value = tempAddress.Web;
                    }
                }
            }
        }
Exemplo n.º 16
0
 private void LoadAllCompany()
 {
     Company company = new Company();
     allCompanyList = company.GetAllCompany(_company.CompanyId);
     List<string> nameList = new List<string>();
     foreach (Company com in allCompanyList)
     {
         nameList.Add(com.CompanyName);
     }
 }
Exemplo n.º 17
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];

            if (Session["savedCutomerMessage"] != null)
            {
                string msg = Session["savedCutomerMessage"].ToString();
                Alert.Show(msg);
                Session["savedCutomerMessage"] = null;
            }
            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=default.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=default.aspx?" + str);
            }

            this.LoadCountryDropdown();
            this.LoadSalesPersonDropDown();
            this.LoadCustomerTable();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            user = (Users)Session["user"];
            _company = (Company)Session["Company"];
            if (Session["JournalInformationMessage"]!=null)
            {
                string message = (string) Session["JournalInformationMessage"];
                Session["JournalInformationMessage"] = null;
                Alert.Show(message);
            }

            _company = (Company)Session["Company"];
            if (!IsPostBack)
            {
                LoadFirstTime();

            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];

            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=index.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=index.aspx?" + str);
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    string deptId = Request.QueryString["id"].ToString();

                    Department dept = new Department().GetDepartmentByDepartmentId(int.Parse(deptId), _company.CompanyId);
                    if (dept != null || dept.DepartmentId != 0)
                    {
                        lblId.Text = dept.DepartmentId.ToString();
                        txtDepartmentName.Value = dept.DepartmentName;

                    }
                }
            }
            LoadParentDepartmentIdDropDown();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
            user = (Users)Session["user"];

            this.LoadCountryDropDownList();
            this.LoadDepartmentDropDownList();

            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                {
                    Response.Redirect("LogIn.aspx?refPage=index.aspx");
                }
                else
                {
                    Response.Redirect("LogIn.aspx?regPage=index.aspx"+str);
                }
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    string id = Request.QueryString["id"].ToString();
                    Employee tempEmployee= new Employee().GetEmployeeByEmployeeId(int.Parse(id),_company.CompanyId);
                    if (tempEmployee != null || tempEmployee.EmployeeId != 0)
                    {
                        List<string> countryList = Country.CountryList();
                        List<Addresses> addressList = new Addresses().GetAllAddresses(_company.CompanyId);
                        Designation designation =
                            new Designation().GetDesignationByDesignationId(tempEmployee.DesignationId,
                                _company.CompanyId);
                        Department department;
                        if (tempEmployee.DepartmentId != 0)
                        {
                            department = new Department().GetDepartmentByDepartmentId(tempEmployee.DepartmentId,
                                _company.CompanyId);
                            SetIndex(departmentDropDownList, department.DepartmentId.ToString());
                            LoadDesignationDropDownList(tempEmployee.DepartmentId);

                        }
                        else
                        {
                            department = new Department();
                            departmentDropDownList.SelectedIndex = -1;
                            LoadDesignationDropDownList(0);
                        }
                        SetIndex(designationDropDownList,tempEmployee.DesignationId.ToString());
                        lblId.Text = tempEmployee.EmployeeId.ToString();
                        txtEmployeeCode.Value = tempEmployee.EmployeeCode;
                        txtEmployeeName.Value = tempEmployee.EmployeeName;
                        JoinRadDatePicker.SelectedDate = DateTime.Parse(tempEmployee.JoinDate);
                        RadDatePicker1.SelectedDate = DateTime.Parse(tempEmployee.DOB);
                        chkIsActive.Checked = tempEmployee.IsActive;

                       //SetIndex(designationDropDownList,designation.DesignationId.ToString());
                        foreach (Addresses tAddress in addressList)
                        {
                            if (tAddress.SourceType == "Employee" && tAddress.SourceId == tempEmployee.EmployeeId)
                            {
                                addlblId.Text = tAddress.AddressId.ToString();
                                txtAddressLine1.Value = tAddress.AddressLine1;
                                txtAddressLine2.Value = tAddress.AddressLine2;
                                txtCity.Value = tAddress.City;
                                txtEmail.Value = tAddress.Email;
                                txtZipCode.Value = tAddress.ZipCode;
                                txtPhoneNo.Value = tAddress.Phone;
                                countryDropDownList.SelectedIndex = tAddress.CountryId;
                                break;

                            }

                        }
                    }

                }
            }
            if (Session["empMessage"] != null)
            {
                string message = Session["empMessage"].ToString();
                Session["empMessage"] = null;
                Alert.Show(message);
            }
        }
Exemplo n.º 21
0
 protected void Page_Load(object sender, EventArgs e)
 {
     _company = (Company)Session["Company"];
     user = (Users)Session["user"];
     if (Session["savedSupplicerMessage"] != null)
     {
         string msg = Session["savedSupplicerMessage"].ToString();
         Alert.Show(msg);
         Session["savedSupplicerMessage"] = null;
     }
     this.LoadCountryDropDownList();
     this.Show();
 }
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
            _user = (Users)Session["User"];

            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=index.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=index.aspx?" + str);
            }
            if (!IsPostBack)
            {
                if (Request.QueryString["id"] != null)
                {
                    string bankAccountId = Request.QueryString["id"].ToString();

                    BankAccounts objBankAccounts = new BankAccounts().GetBankAccountsByBankAccountId(int.Parse(bankAccountId), _company.CompanyId);

                    if (objBankAccounts != null || objBankAccounts.BankAccountId != 0)
                    {

                        List<Bank> bankList = new List<Bank>();
                        Bank bank = new Bank();

                        lblId.Text = objBankAccounts.BankAccountId.ToString();

                        bankIdRadDropDownList1.Items.Clear();
                        bankList = bank.GetAllBank(_company.CompanyId);

                        List<string> bankName = new List<string>();
                        foreach (Bank bankNew in bankList)
                        {
                            if (bankNew.BankId == objBankAccounts.BankId)
                                bankName.Add(bankNew.BankName);
                        }
                        bankIdRadDropDownList1.DataSource = bankName;
                        bankIdRadDropDownList1.DataBind();

                        txtBranchName.Value = objBankAccounts.BranchName;
                        txtAccountNo.Value = objBankAccounts.AccountNo;
                        txtTitle.Value = objBankAccounts.AccountTitle;

                        accountTypeRadDropDownList1.Items.Clear();
                        List<string> list = new List<string>();
                        list.Add(objBankAccounts.AccountType);
                        accountTypeRadDropDownList1.DataSource = list;
                        accountTypeRadDropDownList1.DataBind();

                        RadDatePicker2.SelectedDate = DateTime.Parse(objBankAccounts.OpeningDate);
                        chkIsActive.Checked = objBankAccounts.IsActive;

                    }
                }
            }
            this.LoadBankNames();
            this.LoadAccountTypeDropDown();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
            _user = (Users)Session["user"];

            if (!isValidSession())
            {
                string str = Request.QueryString.ToString();
                if (str == string.Empty)
                    Response.Redirect("LogIn.aspx?refPage=default.aspx");
                else
                    Response.Redirect("LogIn.aspx?refPage=default.aspx?" + str);
            }
            if (!IsPostBack)
            {

                if (Request.QueryString["id"] != null)
                {
                    string CoaGroupId = Request.QueryString["id"].ToString();

                    ChartOfAccountGroup coa = new ChartOfAccountGroup().GetChartOfAccountGroupByCoaGroupId(int.Parse(CoaGroupId), _company.CompanyId);
                    if (coa != null || coa.CoaGroupId != 0)
                    {

                        lblId.Text = coa.CoaGroupId.ToString();
                        txtGroupName.Value = coa.CoaGroupName;
                        chkIsActive.Checked = true;
                    }
                }
            }
        }
        private void LoadCompanyListTable()
        {
            try
            {
                Company objCompany = new Company();
                List<string> countryList = Country.CountryList();
                List<Company> objCompanyList= new Company().GetAllCompany();
                if (objCompanyList.Count == 0)
                {
                    objCompanyList.Add(new Company());
                }
                foreach (Company objCst in objCompanyList)
                {

                    Addresses address= new Addresses().GetAddressesBySourceTypeAndId("Company",objCst.CompanyId);

                            objCst.AddressId = address.AddressId;
                            objCst.AddressLine1 = address.AddressLine1;
                            objCst.AddressLine2 = address.AddressLine2;
                            objCst.AddressType = address.AddressType;
                            objCst.City = address.City;
                            objCst.ZipCode = address.ZipCode;
                            objCst.Phone = address.Phone;
                            objCst.Mobile = address.Mobile;
                            objCst.Email = address.Email;
                            objCst.Web = address.Web;
                            objCst.CountryName = countryList[address.CountryId];

                }
                RadGrid1.DataSource = objCompanyList;
                RadGrid1.Rebind();
            }
            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
        }
Exemplo n.º 25
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];

            if (Session["savedDepartmentMessage"] != null)
            {
                string msg = Session["savedDepartmentMessage"].ToString();
                Session["savedDepartmentMessage"] = null;
                Alert.Show(msg);
            }
            user = (Users)Session["user"];

              this.LoadCompanyList();

            this.LoadDepartmentDropDownList();
        }
Exemplo n.º 26
0
        protected void btnSave_Click(object sender, EventArgs e)
        {
            //try
            //{
            if (txtCompanyName.Value == string.Empty)
            {
                Alert.Show("Please enter the company name.");
                txtCompanyName.Focus();
                return;
            }

            Company newCompany = new Company();

            newCompany.CompanyName = txtCompanyName.Value;

            newCompany.Address = txtAddress.Value;
            newCompany.Phone = txtPhoneNo.Value;
            newCompany.Email = txtEmail.Value;
            newCompany.Web = txtWeb.Value;
            newCompany.LogoPath = txtLogoPath.Value;

            // newCompany.UpdateBy = user.UserId;
            newCompany.UpdateBy = _user.UserId;
            newCompany.UpdateDate = DateTime.Now;
            newCompany.IsActive = chkIsActive.Checked;

            Addresses address = new Addresses();
            address.SourceType = "Company";
            address.SourceId = _user.CompanyId;
            address.AddressType = "Main Address";
            address.AddressLine1 = txtAddressLine1.Value;
            address.AddressLine2 = txtAddressLine2.Value;
            address.CountryId = countryDropDownList.SelectedIndex;
            address.City = txtCity.Value;
            address.ZipCode = txtZipCode.Value;
            address.Phone = txtPhoneNo.Value;
            address.Mobile = txtPhoneNo.Value;
            address.Email = txtEmail.Value;
            address.Web = txtWeb.Value;
            address.CompanyId = _user.CompanyId;

            int success = newCompany.InsertCompany();
            //address.InsertAddresses();
            if (success > 0)
            {
                Alert.Show("Saved Company Information Successfully!");
                this.LoadAllCompany();
                this.Clear();
                this.LoadCompanyTable();
            }
            else
            {
                Alert.Show("Error occured !");
            }
            //}
            //catch (Exception ex)
            //{
            //    Alert.Show(ex.Message);
            //}
        }
Exemplo n.º 27
0
        public void LoadCompanyList()
        {
            Company aCompany = new Company();

            companyList = aCompany.GetAllCompany(_company.CompanyId);
        }
        private void LoadAllCompany()
        {
            try
            {
                List<Company> companyList = new Company().GetAllCompany();
                if (companyList.Count > 1) companyList.Insert(0, new Company());

                ddlCompany.DataValueField = "CompanyId";
                ddlCompany.DataTextField = "CompanyName";

                ddlCompany.DataSource = companyList;
                ddlCompany.DataBind();

                ddlCompany.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                Alert.Show(ex.Message);
            }
        }
Exemplo n.º 29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
            if (Session["savedAddressMessage"] != null)
            {
                string msg = Session["savedAddressMessage"].ToString();
                Alert.Show(msg);
                Session["savedAddressMessage"] = null;
            }
            if (Session["savedContactMessage"]!=null)
            {
                string msg = Session["savedContactMessage"].ToString();
                Alert.Show(msg);
                Session["savedContactMessage"] = null;
            }

            user = (Users) Session["user"];

            this.LoadBillingCountryDropDownList();
            this.LoadShippingCountryDropDownList();
            this.LoadContactInformationList();
            this.LoadDesignationDropDownList();
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            _company = (Company)Session["Company"];
              _user =(Users) Session["user"];
              if (Session["savedListMessage"] !=null)
              {
                  string msg = Session["savedListMessage"].ToString();
                  Alert.Show(msg);
                  Session["savedListMessage"] = null;
              }
              if (!isValidSession())
              {
                  string str = Request.QueryString.ToString();
                  if (str == string.Empty)
                      Response.Redirect("LogIn.aspx?refPage=index.aspx");
                  else
                      Response.Redirect("LogIn.aspx?refPage=index.aspx?" + str);
              }
              if (!IsPostBack)
              {
                  if (Request.QueryString["id"] != null)
                  {
                      string listId = Request.QueryString["id"].ToString();

                      ListTable objTable = new ListTable().GetListTableById(int.Parse(listId), _company.CompanyId);
                      if (objTable != null || objTable.Id != 0)
                      {
                          lblId.Text = objTable.Id.ToString();
                          txtListType.Value = objTable.ListType;
                          txtListValue.Value = objTable.ListValue;
                      }
                  }
              }
        }