Esempio n. 1
0
 private void ExportToExcelButton_Click(object sender, EventArgs e)
 {
     try
     {
         folderBrowserDialog.ShowDialog();
         if (!string.IsNullOrEmpty(folderBrowserDialog.SelectedPath))
         {
             HPS.BLL.CompanyBLL.BLLCompany_TFactory factory = new BLL.CompanyBLL.BLLCompany_TFactory();
             string fileName_nvc = string.Format("{0}.xls", folderBrowserDialog.SelectedPath + "\\" + factory.ServerJalaliDate.Replace("/", "") + factory.ServerTime.Replace(":", ""));
             //xlsExport1.Export(viewer1.Document, fileName_nvc);
             Hepsa.Core.Common.MessageBox.InformationMessage("اطلاعات با موفقیت انتقال داده شد");
         }
     }
     catch (Exception ex)
     {
         Hepsa.Core.Common.MessageBox.ErrorMessage(ex.Message);
     }
 }
Esempio n. 2
0
        protected override void ShowForm()
        {
            this.FillCombo();
            HPS.BLL.UserBLL.BLLUser_TFactory UserFactory  = new HPS.BLL.UserBLL.BLLUser_TFactory();
            HPS.BLL.UserBLL.BLLUser_T        UserEntity   = UserFactory.GetBy((HPS.BLL.UserBLL.BLLUser_TKeys)Key);
            System.IO.MemoryStream           memorystream = new System.IO.MemoryStream();
            if (UserEntity == null)
            {
                throw new HPS.Exceptions.UserNotFound();
            }
            if (UserEntity.Picture_img != null)
            {
                memorystream.Write(UserEntity.Picture_img, 0, UserEntity.Picture_img.Length);
                PictureBox.Image = System.Drawing.Image.FromStream(memorystream);
            }
            else
            {
                PictureBox.Image = HPS.Properties.Resources.user;
            }
            UserName_nvcTextBox.Text    = Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.UserName_nvc, TypeCode.String).ToString();
            FullName_nvcTextBox.Text    = Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.FullName_nvc, TypeCode.String).ToString();
            Password_nvcTextBox.Text    = Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.Password_nvc, TypeCode.String).ToString();
            ConfirmPasswordTextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.Password_nvc, TypeCode.String).ToString();
            StartDate_vcTextBox.Text    = Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.StartDate_vc, TypeCode.String).ToString();
            ExpireDate_vcTextBox.Text   = Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.ExpireDate_vc, TypeCode.String).ToString();
            Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref UserGroupID_intComboBox, UserEntity.UserGroupID_int, TypeCode.Int32);
            Active_bitCheckBox.Checked = (bool)Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.Active_bit, TypeCode.Boolean);
            Hepsa.Core.Common.PersentationController.SetComboBoxValue(ref InfractionGroupID_intComboBox, UserEntity.InfractionGroupID_int, TypeCode.Int32);
            this.Mobile_nvctextBox.Text = Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.Mobile_nvc, TypeCode.String).ToString();

            if (UserEntity.CompanyID_int != null)
            {
                CompanyID_int = UserEntity.CompanyID_int;
                BLL.CompanyBLL.BLLCompany_TKeys key = new BLL.CompanyBLL.BLLCompany_TKeys();
                key.CompanyID_int = Convert.ToInt32(UserEntity.CompanyID_int);
                BLL.CompanyBLL.BLLCompany_TFactory CompanyFactory = new BLL.CompanyBLL.BLLCompany_TFactory();
                var Company = CompanyFactory.GetBy(key);
                Company_nvcTextBox.Text = Company.Company_nvc;
            }
            MultiAccess_bitCheckBox.Checked = (bool)Hepsa.Core.Common.PersentationController.GetEntityValue(UserEntity.MultiAccess_bit, TypeCode.Boolean);
        }