public void FillUserForm(string initial, string middleName, string firstName)
 {
     TxtInitial.SendKeys(initial);
     TxtFirstName.SendKeys(firstName);
     TxtMiddleName.SendKeys(middleName);
     BtnSave.Click();
 }
 public void FillUserForm(string initial, string firstName, string middleName)
 {
     TxtInitial.EnterText(initial);
     TxtFirstName.EnterText(firstName);
     TxtMiddleName.EnterText(middleName);
     BtnSave.Clicks();
 }
Beispiel #3
0
        //private void lbl_CompanyLogo_DoubleClick(object sender, EventArgs e)
        //{
        //    pb_CompanyLogo_DoubleClick(sender, e);
        //}
        //private void pb_CompanyLogo_DoubleClick(object sender, EventArgs e)
        //{

        //}
        #endregion

        #region ----------------- Method ------------------
        public void ControlEnableDisable(bool trb, bool fld)
        {
            BtnNew.Enabled    = trb;
            BtnEdit.Enabled   = trb;
            BtnDelete.Enabled = trb;
            BtnExit.Enabled   = trb;
            if (BtnNew.Enabled == true)
            {
                BtnNew.Focus();
            }

            TxtInitial.Enabled = fld;
            Utility.EnableDesibleColor(TxtInitial, fld);
            TxtName.Enabled = fld;
            Utility.EnableDesibleColor(TxtName, fld);
            TxtFiscalYear.Enabled = fld;
            Utility.EnableDesibleColor(TxtFiscalYear, fld);
            TxtAddress.Enabled = fld;
            Utility.EnableDesibleColor(TxtAddress, fld);
            TxtDistrict.Enabled = fld;
            Utility.EnableDesibleColor(TxtDistrict, fld);
            TxtCity.Enabled = fld;
            Utility.EnableDesibleColor(TxtCity, fld);
            TxtState.Enabled = fld;
            Utility.EnableDesibleColor(TxtState, fld);
            TxtCountry.Enabled = fld;
            Utility.EnableDesibleColor(TxtCountry, fld);
            TxtPhoneNo.Enabled = fld;
            Utility.EnableDesibleColor(TxtPhoneNo, fld);
            TxtFax.Enabled = fld;
            Utility.EnableDesibleColor(TxtFax, fld);
            TxtEmail.Enabled = fld;
            Utility.EnableDesibleColor(TxtEmail, fld);
            TxtWebSite.Enabled = fld;
            Utility.EnableDesibleColor(TxtWebSite, fld);
            TxtPanNo.Enabled = fld;
            Utility.EnableDesibleColor(TxtPanNo, fld);

            TxtStartDate.Enabled = fld;
            Utility.EnableDesibleDateColor(TxtStartDate, fld);
            TxtEndDate.Enabled = fld;
            Utility.EnableDesibleDateColor(TxtEndDate, fld);

            CmbDataDrive.Enabled = fld;
            Utility.EnableDesibleComboBoxColor(CmbDataDrive, fld);
            CmbBackupDrive.Enabled = fld;
            Utility.EnableDesibleComboBoxColor(CmbBackupDrive, fld);
            //CbActive.Enabled = fld;
            BtnSave.Enabled   = fld;
            BtnCancel.Enabled = fld;

            if (BtnNew.Enabled == true)
            {
                BtnNew.Focus();
            }
            else if (TxtInitial.Enabled == true)
            {
                TxtInitial.Focus();
            }
        }
Beispiel #4
0
 private void BtnDelete_Click(object sender, EventArgs e)
 {
     _Tag = "DELETE";
     ControlEnableDisable(false, false);
     Text = "Company Setup [DELETE]";
     TxtInitial.Enabled = true;
     TxtInitial.Focus();
     BtnSave.Enabled   = true;
     BtnCancel.Enabled = true;
 }
Beispiel #5
0
        public void SaveInfo(string initial, string firstName, string midleName)
        {
            TxtInitial.EnterText(initial);
            TxtFirstName.EnterText(firstName);
            TxtMiddleName.EnterText(midleName);
            BtnSave.Click();

            //this.TxtInitial.SendKeys(initial);
            //this.TxtFirstName.SendKeys(firstName);
            //this.TxtMiddleName.SendKeys(midleName);
            //this.BtnSave.Click();
        }
        public void FillUserForm(string initial, string middleName, string firstName)
        {
            TxtInitial.EnterText(initial);
            TxtFirstName.EnterText(firstName);
            TxtMiddleName.EnterText(middleName);
            BtnSave.Click();

            SeleniumSetMethods.EnterText(TxtInitial, initial);
            SeleniumSetMethods.EnterText(TxtFirstName, firstName);
            SeleniumSetMethods.EnterText(TxtMiddleName, middleName);
            SeleniumSetMethods.Click(BtnSave);

            //TxtInitial.SendKeys(initial);
            //TxtFirstName.SendKeys(firstName);
            //TxtMiddleName.SendKeys(middleName);
            //BtnSave.Click();
        }
Beispiel #7
0
        private void ClearFld()
        {
            _CompanyId = 0;
            _Initial   = "";
            foreach (Control control in PanelContainer.Controls)
            {
                if (control is TextBox)
                {
                    control.Text = "";
                }
            }

            CmbDataDrive.SelectedIndex   = 0;
            CmbBackupDrive.SelectedIndex = 0;
            TxtStartDate.Text            = DateTime.Now.ToString();
            TxtEndDate.Text        = DateTime.Now.AddDays(365).ToString();
            chkDefaultData.Checked = true;
            TxtInitial.Focus();
        }
Beispiel #8
0
        private void TxtInitial_Validating(object sender, CancelEventArgs e)
        {
            if (_Tag == "" || ActiveControl == TxtInitial)
            {
                return;
            }

            TxtInitial.Text = TxtInitial.Text.ToUpper();
            if (string.IsNullOrEmpty(TxtInitial.Text.Trim()))
            {
                MessageBox.Show("Company initial cannot be left blank.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtInitial.Focus();
                return;
            }
            if (TxtInitial.Text.Length < 4)
            {
                MessageBox.Show("Company initial must be four character.", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtInitial.Focus();
                return;
            }
        }
Beispiel #9
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            //    try
            //    {
            if (TxtInitial.Text == "")
            {
                MessageBox.Show("Company Initial is not Blank..!!", "Mr. Solution");
                TxtInitial.Focus();
                return;
            }
            if (TxtName.Text == "")
            {
                MessageBox.Show("Company Name is not Blank..!!", "Mr. Solution");
                TxtName.Focus();
                return;
            }

            //_objCompany.Model.DatabaseName = "ERP" + Convert.ToString((Regex.Replace(TxtInitial.Text.Trim(), @"[^0-9a-zA-Z]+", "").Length >= 4) ? ((Regex.Replace(TxtInitial.Text.Trim(), @"[^0-9a-zA-Z]+", "")).Substring(0, 4)).ToUpper() : Regex.Replace(TxtInitial.Text.Trim().ToUpper(), @"[^0-9a-zA-Z]+", "").PadLeft(4, '0'));
            //_objCompany.Model.DatabaseName = _objCompany.Model.DatabaseName.Trim().PadRight(7, '0') + "01";
            //Query = "SELECT * FROM CompanyMaster Where Initial ='" + _objCompany.Model.DatabaseName.Substring(0, 7) + "' ";
            //DataTable dt = DataAccessLayer.Database.FetchingMasterData(Query);
            //if (dt.Rows.Count > 0)
            //{
            //    _objCompany.Model.DatabaseName = _objCompany.Model.DatabaseName.Substring(0, 7) + (dt.Rows.Count + 1).ToString().PadLeft(2, '0');
            //}

            _objCompany.Model.DatabaseName = "ERP" + TxtInitial.Text.Trim() + "01";
            string DrivePath = CmbDataDrive.SelectedItem.ToString() + "ERP\\";

            if (!Directory.Exists(DrivePath))
            {
                DirectoryInfo di = Directory.CreateDirectory(DrivePath);
            }
            _objCompany.Model.DatabasePath = DrivePath;
            string BackupPath = CmbBackupDrive.SelectedItem.ToString() + "ERP\\";

            if (!Directory.Exists(BackupPath))
            {
                DirectoryInfo di = Directory.CreateDirectory(BackupPath);
            }
            _objCompany.Model.DataBackupPath = BackupPath;

            _objCompany.Model.Tag       = _Tag;
            _objCompany.Model.CompanyId = _CompanyId;
            _objCompany.Model.Initial   = _Initial;
            if ((_Tag == "EDIT" || _Tag == "DELETE") && _Initial == "")
            {
                ClearFld();
                TxtInitial.Focus();
                return;
            }
            _objCompany.Model.CompanyLogo = null; //ClsGlobal.ReadFile(pb_CompanyLogo.ImageLocation);
            _objCompany.Model.Initial     = TxtInitial.Text.Trim();
            _objCompany.Model.CompanyName = TxtName.Text.Trim();
            _objCompany.Model.StartDate   = Convert.ToDateTime(TxtStartDate.Text);
            _objCompany.Model.EndDate     = Convert.ToDateTime(TxtEndDate.Text);
            _objCompany.Model.FiscalYear  = TxtFiscalYear.Text.Trim();
            _objCompany.Model.Address     = TxtAddress.Text.Trim();
            _objCompany.Model.District    = TxtDistrict.Text.Trim();
            _objCompany.Model.City        = TxtCity.Text.Trim();
            _objCompany.Model.State       = TxtState.Text.Trim();
            _objCompany.Model.Country     = TxtCountry.Text.Trim();
            _objCompany.Model.PhoneNo     = TxtPhoneNo.Text.Trim();
            _objCompany.Model.Fax         = TxtFax.Text.Trim();
            _objCompany.Model.Email       = TxtEmail.Text.Trim();
            _objCompany.Model.Website     = TxtWebSite.Text.Trim();
            _objCompany.Model.PanNo       = TxtPanNo.Text.Trim();
            _objCompany.Model.VersionNo   = 0;
            _objCompany.Model.AltPhoneNo  = "";
            _objCompany.Model.DefaultData = chkDefaultData.Checked == true ? true : false;
            _objCompany.Model.EnterBy     = ClsGlobal.LoginUserCode;
            _objCompany.Model.Status      = true; //CbActive.Checked == true ? true : false;
            string result = _objCompany.SaveCompany();

            //_objCompany.RestoreDatabase();
            if (!string.IsNullOrEmpty(result))
            {
                MessageBox.Show("Data Submit Successfully", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                ClearFld();
                TxtInitial.Focus();
            }
            else
            {
                MessageBox.Show("Error occured during data submit", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            //}
            //catch (Exception ex)
            //{
            //    MessageBox.Show(ex.ToString(), "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            //}
        }