Beispiel #1
0
        private void Save()
        {
            if (Helpers.CheckEmpty(errorProvider1, txtNameInKhmer, txtNameInEnglish, txtEmail,
                                   txtPhone, txtLocation))
            {
                return;
            }
            else
            {
                SaveCompleted = true;
                errorProvider1.Clear();
                string        text          = StringCipher.Encrypt(txtPhone.Text);
                CompanyEntity companyEntity = new CompanyEntity();
                companyEntity.NameInEnglish = txtNameInEnglish.Text;
                companyEntity.NameInKhmer   = txtNameInKhmer.Text;
                companyEntity.Email         = txtEmail.Text;
                companyEntity.Phone         = txtPhone.Text;
                companyEntity.Location      = txtLocation.Text;
                companyEntity.Active        = chkActive.Checked;
                companyEntity.Logo          = myPicture1.GetByteArrayFromBrowse();

                if (companyID != Guid.Empty)
                {
                    companyEntity.Id = companyID;
                    companyEntity.Update(USER.UserName);
                    CompanyDao.Update(companyEntity);
                }
                else
                {
                    companyEntity.Id = Guid.NewGuid();
                    companyEntity.Create(USER.UserName);
                    CompanyDao.Insert(companyEntity);
                }
            }
        }
Beispiel #2
0
        private static void Main()
        {
            CompanyEntity c = new CompanyEntity();

            c.Create("Admin");
            c.Id = Guid.NewGuid();
            Guid id = Guid.Empty;

            c.NameInKhmer   = "Test";
            c.NameInEnglish = "Test";
            c.Email         = "Test";
            c.Phone         = "Test";
            c.Location      = "Test";
            c.Logo          = new byte[0];
            //CompanyDao.Insert(c);
            MANAGE_ROLE.LoadRole();
            bool a = MANAGE_ROLE.ALLOW_ADD_COMPANY;
            bool b = MANAGE_ROLE.ALLOW_EDIT_COMPANY;

            COMPANY.Load_Company();
            USER.Load_User();
            MANAGE_ROLE.LoadRole();
            //MessageBox.Show(new DateTime(2025, 6, 25).DayOfWeek.ToString());
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new FrmMain());
        }