Exemplo n.º 1
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            var currentProductCode = GetCurrentProductCode();
            var prodToDel          = uowProduct.Repository.GetAll().Where(p => p.ProductCode == currentProductCode).FirstOrDefault();

            if (prodToDel != null)
            {
                if (DialogResult.Yes == CommonMessageHelper.ConfirmDelete())
                {
                    uowProduct.Repository.Delete(prodToDel);
                    var res = uowProduct.Commit();
                    if (!res.Item1 && res.Item2 == "Expected")
                    {
                        CommonMessageHelper.ReferredDataCannotBeDeleted();
                    }

                    if (!res.Item1 && res.Item2 == "Unexpected")
                    {
                        CommonMessageHelper.ContactAdminError();
                    }
                    btnReload.PerformClick();
                }
            }
            else
            {
                CommonMessageHelper.DataNotFound(GetCurrentProductCode());
            }
        }
Exemplo n.º 2
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            // Role SUPER cannot be deleted!
            if (txtRoleCode.Text.ToUpper().Trim() == "SUPER")
            {
                MessageBox.Show("Role SUPER tidak boleh dihapus."
                                , "Peringatan", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var roleToDel = uowRole.Repository.GetAll().Where(u => u.RoleCode == txtRoleCode.Text.Trim()).FirstOrDefault();

            if (roleToDel != null)
            {
                if (DialogResult.Yes == CommonMessageHelper.ConfirmDelete())
                {
                    uowRole.Repository.Delete(roleToDel);
                    var res = uowRole.Commit();
                    if (!res.Item1 && res.Item2 == "Expected")
                    {
                        CommonMessageHelper.ReferredDataCannotBeDeleted();
                    }

                    if (!res.Item1 && res.Item2 == "Unexpected")
                    {
                        CommonMessageHelper.ContactAdminError();
                    }
                    btnReload.PerformClick();
                }
            }
            else
            {
                CommonMessageHelper.DataNotFound(txtRoleCode.Text.Trim());
            }
        }
Exemplo n.º 3
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            var roleToDel = uowPrincipal.Repository.GetAll().Where(u => u.PrincipalCode == txtPrincipalCode.Text.Trim()).FirstOrDefault();

            if (roleToDel != null)
            {
                if (DialogResult.Yes == CommonMessageHelper.ConfirmDelete())
                {
                    uowPrincipal.Repository.Delete(roleToDel);
                    var res = uowPrincipal.Commit();
                    if (!res.Item1 && res.Item2 == "Expected")
                    {
                        CommonMessageHelper.ReferredDataCannotBeDeleted();
                    }

                    if (!res.Item1 && res.Item2 == "Unexpected")
                    {
                        CommonMessageHelper.ContactAdminError();
                    }
                    btnReload.PerformClick();
                }
            }
            else
            {
                CommonMessageHelper.DataNotFound(txtPrincipalCode.Text.Trim());
            }
        }
Exemplo n.º 4
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            var soToDel = _uow.Repository.GetById(txtSalesOrderId.Text.Trim());

            if (soToDel != null)
            {
                if (DialogResult.Yes == CommonMessageHelper.ConfirmDelete())
                {
                    // delete the sales order
                    soToDel.Status = Constant.RecordStatus.Inactive;
                    _uow.Repository.Update(soToDel);
                    var res = _uow.Commit();

                    if (!res.Item1 && res.Item2 == "Expected")
                    {
                        CommonMessageHelper.ReferredDataCannotBeDeleted();
                    }

                    if (!res.Item1 && res.Item2 == "Unexpected")
                    {
                        CommonMessageHelper.ContactAdminError();
                    }

                    LoadSalesOrderData(soToDel.SalesNo);
                }
            }
            else
            {
                CommonMessageHelper.DataNotFound(lblSalesNo.Text.Trim());
            }
        }
Exemplo n.º 5
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!ValidateMandatoryFields())
            {
                return;
            }

            var repoLastUpdated = uowTop.Repository.GetById(txtTermId.Text.Trim()).ModifiedAt;
            var lastUpdated     = DateTime.Parse(txtModifiedAt.Text.Trim());

            var commonHelper = new CommonFunctionHelper();

            if (commonHelper.StandardizeDateTime(lastUpdated) != commonHelper.StandardizeDateTime(repoLastUpdated))
            {
                CommonMessageHelper.DataHasBeenUpdatedPriorToSave(txtTermCode.Text.Trim());
            }
            else
            {
                var topToUpdate = uowTop.Repository.GetById(txtTermId.Text.Trim());
                topToUpdate.TermCode    = txtTermCode.Text.Trim();
                topToUpdate.Description = txtDescription.Text.Trim();
                topToUpdate.ModifiedBy  = Properties.Settings.Default.CurrentUserId;
                topToUpdate.ModifiedAt  = DateTime.Now;

                uowTop.Repository.Update(topToUpdate);
                uowTop.Commit();
                btnReload.PerformClick();
                CommonMessageHelper.DataSavedSuccessfully();
            }
        }
Exemplo n.º 6
0
        private bool ValidateMandatoryFields()
        {
            if (string.IsNullOrEmpty(txtCustomerCode.Text) || string.IsNullOrEmpty(txtCustomerName.Text) || string.IsNullOrEmpty(txtAddress.Text))
            {
                CommonMessageHelper.DataCannotBeEmpty("Kode, Nama Pelanggan dan Alamat");
                return(false);
            }

            if (cbOutletType.SelectedItem.ToString().Contains("Pilih"))
            {
                CommonMessageHelper.DataCannotBeEmpty("Jenis Outlet");
                return(false);
            }

            if (cbOutletType.Items.Count <= 1 || cbSalesArea.Items.Count <= 1)
            {
                var emptyRefData = cbOutletType.Items.Count <= 1 ? "Jenis Outlet" : "Sales Area";
                CommonMessageHelper.ReferredDataNotSet(emptyRefData);
                return(false);
            }

            var customerCode = txtCustomerCode.Text.Trim();
            var customerName = txtCustomerName.Text.Trim();
            var existingCust = uowCust.Repository.GetAll().FirstOrDefault(c => c.CustomerName == customerName && c.CustomerCode != customerCode);

            if (existingCust != null)
            {
                MessageBox.Show($"Pelanggan dengan nama '{customerName}' sudah ada, silakan gunakan nama pelanggan lain.", "Informasi", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return(false);
            }
            return(true);
        }
Exemplo n.º 7
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!ValidateMandatoryFields())
            {
                return;
            }

            var existingTop = uowTop.Repository.GetAll().Where(t => t.TermCode == txtTermCode.Text.Trim()).FirstOrDefault();

            if (existingTop != null)
            {
                CommonMessageHelper.DataAlreadyExist(txtTermCode.Text.Trim());
            }
            else
            {
                var topToAdd = new TermOfPayment
                {
                    TermCode    = txtTermCode.Text.Trim(),
                    Description = txtDescription.Text.Trim(),

                    // Audit Fields
                    CreatedBy  = Properties.Settings.Default.CurrentUserId,
                    CreatedAt  = DateTime.Now,
                    ModifiedBy = Properties.Settings.Default.CurrentUserId,
                    ModifiedAt = DateTime.Now
                };
                uowTop.Repository.Add(topToAdd);
                uowTop.Commit();
                btnReload.PerformClick();
                CommonMessageHelper.DataSavedSuccessfully();
            }
        }
Exemplo n.º 8
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!ValidateMandatoryFields())
            {
                return;
            }

            var existingProduct = uowBatch.Repository.GetAll().Where(p => p.BatchCode == txtBatchCode.Text.Trim()).FirstOrDefault();

            if (existingProduct != null)
            {
                CommonMessageHelper.DataAlreadyExist(txtBatchCode.Text.Trim());
            }
            else
            {
                var batchToAdd = new Batch
                {
                    BatchCode   = txtBatchCode.Text.Trim(),
                    ProductId   = cbProductCode.SelectedValue.ToString(),
                    Quantity    = Convert.ToInt32(txtQuantity.Text.Trim()),
                    EntryDate   = DateTime.Parse(dtpEntryDate.Value.ToString("yyyy-MM-dd")),
                    ExpiredDate = DateTime.Parse(dtpExpiredDate.Value.ToString("yyyy-MM-dd")),

                    // Audit Fields
                    CreatedBy  = Properties.Settings.Default.CurrentUserId,
                    CreatedAt  = DateTime.Now,
                    ModifiedBy = Properties.Settings.Default.CurrentUserId,
                    ModifiedAt = DateTime.Now
                };
                uowBatch.Repository.Add(batchToAdd);
                uowBatch.Commit();
                btnReload.PerformClick();
                CommonMessageHelper.DataSavedSuccessfully();
            }
        }
Exemplo n.º 9
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!ValidateMandatoryFields())
            {
                return;
            }
            var existingUom = uowUom.Repository.GetAll().Where(u => u.UomCode == txtUomCode.Text.Trim()).FirstOrDefault();

            if (existingUom != null)
            {
                CommonMessageHelper.DataAlreadyExist(txtUomCode.Text.Trim());
            }
            else
            {
                var uomToAdd = new UnitOfMeasurement
                {
                    UomCode     = txtUomCode.Text.Trim(),
                    Description = txtUomDesc.Text.Trim(),

                    // Audit Fields
                    CreatedBy  = Properties.Settings.Default.CurrentUserId,
                    CreatedAt  = DateTime.Now,
                    ModifiedBy = Properties.Settings.Default.CurrentUserId,
                    ModifiedAt = DateTime.Now
                };
                uowUom.Repository.Add(uomToAdd);
                uowUom.Commit();
                btnReload.PerformClick();
                CommonMessageHelper.DataSavedSuccessfully();
            }
        }
Exemplo n.º 10
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!ValidateMandatoryFields())
            {
                return;
            }

            var repoLastUpdated = uowBatch.Repository.GetById(txtBatchId.Text.Trim()).ModifiedAt;
            var lastUpdated     = DateTime.Parse(txtModifiedAt.Text.Trim());

            var commonHelper = new CommonFunctionHelper();

            if (commonHelper.StandardizeDateTime(lastUpdated) != commonHelper.StandardizeDateTime(repoLastUpdated))
            {
                CommonMessageHelper.DataHasBeenUpdatedPriorToSave(txtBatchCode.Text.Trim());
            }
            else
            {
                var batchToUpdate = uowBatch.Repository.GetById(txtBatchId.Text.Trim());
                batchToUpdate.BatchCode   = txtBatchCode.Text.Trim();
                batchToUpdate.ProductId   = cbProductCode.SelectedValue.ToString();
                batchToUpdate.Quantity    = Convert.ToInt32(txtQuantity.Text.Trim());
                batchToUpdate.EntryDate   = DateTime.Parse(dtpEntryDate.Value.ToString("yyyy-MM-dd"));
                batchToUpdate.ExpiredDate = DateTime.Parse(dtpExpiredDate.Value.ToString("yyyy-MM-dd"));
                batchToUpdate.ModifiedBy  = Properties.Settings.Default.CurrentUserId;
                batchToUpdate.ModifiedAt  = DateTime.Now;

                uowBatch.Repository.Update(batchToUpdate);
                uowBatch.Commit();
                btnReload.PerformClick();
                CommonMessageHelper.DataSavedSuccessfully();
            }
        }
Exemplo n.º 11
0
        public int SearchGridViewFirstTwoColumn(string searchValue, ref DataGridView dataGridView, ref List <int> foundIndices)
        {
            bool isEnd = false;
            int  index = 0;

            foreach (DataGridViewRow row in dataGridView.Rows)
            {
                if ((row.Cells[1].Value.ToString().ToUpper().Contains(searchValue.ToUpper()) || row.Cells[2].Value.ToString().ToUpper().Contains(searchValue.ToUpper())) &&
                    !foundIndices.Any(f => f == row.Index))
                {
                    foundIndices.Add(row.Index);
                    index = row.Index;
                    break;
                }
                if (row.Index == dataGridView.Rows.Count - 1)
                {
                    isEnd = true;
                }
            }

            if (isEnd)
            {
                foundIndices.Clear();
                CommonMessageHelper.NoMoreResultFound();
            }

            return(index);
        }
Exemplo n.º 12
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!ValidateMandatoryFields())
            {
                return;
            }
            var existingRole = uowArea.Repository.GetAll().Where(r => r.AreaCode == txtAreaCode.Text.Trim()).FirstOrDefault();

            if (existingRole != null)
            {
                CommonMessageHelper.DataAlreadyExist(txtAreaCode.Text.Trim());
            }
            else
            {
                var areaToAdd = new SalesArea
                {
                    AreaCode         = txtAreaCode.Text.Trim(),
                    Description      = txtDescription.Text.Trim(),
                    RepresentativeId = cbRepresentative.SelectedValue.ToString(),

                    // Audit Fields
                    CreatedBy  = Properties.Settings.Default.CurrentUserId,
                    CreatedAt  = DateTime.Now,
                    ModifiedBy = Properties.Settings.Default.CurrentUserId,
                    ModifiedAt = DateTime.Now
                };
                uowArea.Repository.Add(areaToAdd);
                uowArea.Commit();
                isAdd = true;
                btnReload.PerformClick();
                CommonMessageHelper.DataSavedSuccessfully();
            }
        }
Exemplo n.º 13
0
        private void btnDel_Click(object sender, EventArgs e)
        {
            var checkUser = uowUser.Repository.GetAll().Where(u => u.Username == txtUsername.Text.Trim()).FirstOrDefault();

            if (checkUser != null)
            {
                if (DialogResult.Yes == CommonMessageHelper.ConfirmDelete())
                {
                    using (var dbContextTransaction = dbContext.Database.BeginTransaction())
                    {
                        bool expectedError   = false;
                        bool unexpectedError = false;
                        var  uowUsrRole      = new UnitOfWork <UserRole>(dbContext);
                        var  usrRoleToDel    = uowUsrRole.Repository.GetAll().Where(u => u.Id == txtUserRoleId.Text.Trim()).FirstOrDefault();
                        uowUsrRole.Repository.Delete(usrRoleToDel);
                        var uRoleRes = uowUsrRole.Commit();
                        if (!uRoleRes.Item1 && uRoleRes.Item2 == "Expected")
                        {
                            expectedError = true;
                        }

                        if (!uRoleRes.Item1 && uRoleRes.Item2 == "Unexpected")
                        {
                            unexpectedError = true;
                        }

                        var uowUsr   = new UnitOfWork <User>(dbContext);
                        var usrToDel = uowUsr.Repository.GetAll().Where(u => u.Username == txtUsername.Text.Trim()).FirstOrDefault();
                        uowUsr.Repository.Delete(usrToDel);
                        var userRes = uowUsr.Commit();
                        if (!userRes.Item1 && userRes.Item2 == "Expected")
                        {
                            expectedError = true;
                        }

                        if (!userRes.Item1 && userRes.Item2 == "Unexpected")
                        {
                            unexpectedError = true;
                        }

                        if (expectedError)
                        {
                            CommonMessageHelper.ReferredDataCannotBeDeleted();
                        }
                        if (unexpectedError)
                        {
                            CommonMessageHelper.ContactAdminError();
                        }

                        dbContextTransaction.Commit();
                    }
                    btnReload.PerformClick();
                }
            }
            else
            {
                CommonMessageHelper.DataNotFound(txtUsername.Text.Trim());
            }
        }
Exemplo n.º 14
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (!ValidateMandatoryFields())
            {
                return;
            }

            if (chkChangePassword.Checked && !txtPassword.Text.Trim().Equals(txtRetypePassword.Text.Trim()))
            {
                MessageBox.Show("Pastikan password yang anda masukkan sama."
                                , "Informasi", MessageBoxButtons.OK, MessageBoxIcon.Warning);
                return;
            }

            var repoLastUpdated = uowUser.Repository.GetById(txtUserId.Text.Trim()).ModifiedAt;
            var lastUpdated     = DateTime.Parse(txtUserModifiedAt.Text.Trim());

            var commonHelper = new CommonFunctionHelper();

            if (commonHelper.StandardizeDateTime(lastUpdated) != commonHelper.StandardizeDateTime(repoLastUpdated))
            {
                CommonMessageHelper.DataHasBeenUpdatedPriorToSave(txtUsername.Text.Trim());
            }
            else
            {
                using (var dbContextTransaction = dbContext.Database.BeginTransaction())
                {
                    var uowUsr       = new UnitOfWork <User>(dbContext);
                    var userToUpdate = uowUsr.Repository.GetById(txtUserId.Text.Trim());
                    userToUpdate.Username = txtUsername.Text.Trim();

                    if (chkChangePassword.Checked)
                    {
                        userToUpdate.Password = new UserHelper().HashPassword(txtPassword.Text.Trim());
                    }

                    userToUpdate.FullName   = txtFullName.Text.Trim();
                    userToUpdate.ModifiedBy = Properties.Settings.Default.CurrentUserId;
                    userToUpdate.ModifiedAt = DateTime.Now;
                    uowUsr.Repository.Update(userToUpdate);
                    uowUsr.Commit();

                    var uowUsrRole       = new UnitOfWork <UserRole>(dbContext);
                    var userRoleToUpdate = uowUsrRole.Repository.GetById(txtUserRoleId.Text.ToString().Trim());
                    userRoleToUpdate.UserId     = txtUserId.Text.Trim();
                    userRoleToUpdate.RoleId     = cbRole.SelectedValue.ToString().Trim();
                    userRoleToUpdate.ModifiedBy = Properties.Settings.Default.CurrentUserId;
                    userRoleToUpdate.ModifiedAt = DateTime.Now;
                    uowUsrRole.Repository.Update(userRoleToUpdate);
                    uowUsrRole.Commit();

                    dbContextTransaction.Commit();
                }

                btnReload.PerformClick();
                CommonMessageHelper.DataSavedSuccessfully();
            }
        }
Exemplo n.º 15
0
 private bool ValidateMandatoryFields()
 {
     if (string.IsNullOrEmpty(txtRepresentativeCode.Text) || string.IsNullOrEmpty(txtRepresentative.Text))
     {
         CommonMessageHelper.DataCannotBeEmpty("Kode Representative dan Nama Representative");
         return(false);
     }
     return(true);
 }
Exemplo n.º 16
0
 private bool ValidateMandatoryFields()
 {
     if (string.IsNullOrEmpty(txtOutletCode.Text) || string.IsNullOrEmpty(txtOutlet.Text))
     {
         CommonMessageHelper.DataCannotBeEmpty("Kode Outlet dan Jenis Outlet");
         return(false);
     }
     return(true);
 }
Exemplo n.º 17
0
 private bool ValidateMandatoryFields()
 {
     if (string.IsNullOrEmpty(txtUsageTypeCode.Text) || string.IsNullOrEmpty(txtUsageDesc.Text))
     {
         CommonMessageHelper.DataCannotBeEmpty("Kode Pemakaian dan Jenis Pemakaian");
         return(false);
     }
     return(true);
 }
Exemplo n.º 18
0
 private bool ValidateMandatoryFields()
 {
     if (string.IsNullOrEmpty(txtMedCatCode.Text) || string.IsNullOrEmpty(txtMedCat.Text))
     {
         CommonMessageHelper.DataCannotBeEmpty("Kode Kategori dan Kategori Obat");
         return(false);
     }
     return(true);
 }
Exemplo n.º 19
0
 private bool ValidateMandatoryFields()
 {
     if (string.IsNullOrEmpty(txtSalesmanCode.Text) || string.IsNullOrEmpty(txtFullName.Text))
     {
         CommonMessageHelper.DataCannotBeEmpty("Kode Sales dan Nama Lengkap");
         return(false);
     }
     return(true);
 }
Exemplo n.º 20
0
 private bool ValidateMandatoryFields()
 {
     if (string.IsNullOrEmpty(txtPrincipalCode.Text) || string.IsNullOrEmpty(txtPrincipalName.Text))
     {
         CommonMessageHelper.DataCannotBeEmpty("Kode Principal dan Nama Principal");
         return(false);
     }
     return(true);
 }
Exemplo n.º 21
0
 private bool ValidateMandatoryFields()
 {
     if (string.IsNullOrEmpty(txtTermCode.Text) || string.IsNullOrEmpty(txtDescription.Text))
     {
         CommonMessageHelper.DataCannotBeEmpty("Kode Term dan Keterangan");
         return(false);
     }
     return(true);
 }
Exemplo n.º 22
0
        private void btnOutletTypes_Click(object sender, EventArgs e)
        {
            if (!(new CommonFunctionHelper().ValidateAccess((int)Constant.Permission.MasterData.OutletType)))
            {
                CommonMessageHelper.NoAccess();
                return;
            }

            OpenChildForm(new FrmOutletType(), sender);
        }
Exemplo n.º 23
0
        private void btnExportExcel_Click(object sender, EventArgs e)
        {
            if (!(new CommonFunctionHelper().ValidateAccess((int)Constant.Permission.Reporting.Sales)))
            {
                CommonMessageHelper.NoAccess();
                return;
            }

            FrmInvoiceRecap frmInvoiceRecap = new FrmInvoiceRecap();

            frmInvoiceRecap.ShowDialog();
        }
Exemplo n.º 24
0
        private void btnExportPelanggan_Click(object sender, EventArgs e)
        {
            if (!(new CommonFunctionHelper().ValidateAccess((int)Constant.Permission.MasterData.Customer)))
            {
                CommonMessageHelper.NoAccess();
                return;
            }

            FrmCustomerRecap frmCustomerRecap = new FrmCustomerRecap();

            frmCustomerRecap.ShowDialog();
        }
Exemplo n.º 25
0
        private void LoadSalesOrderData(string salesNo)
        {
            SalesOrder queryResult;

            queryResult = _uow.Repository.GetAll().Where(s => s.SalesNo == salesNo).FirstOrDefault();
            if (queryResult == null)
            {
                CommonMessageHelper.DataNotFound(txtSalesNo.Text.Trim());
                return;
            }
            LoadDataItem(queryResult);
        }
Exemplo n.º 26
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            if (!ValidateMandatoryFields())
            {
                return;
            }
            var existingCust = uowCust.Repository.GetAll()
                               .Where(r => r.CustomerCode == txtCustomerCode.Text.Trim() &&
                                      r.Address == txtAddress.Text.Trim())
                               .FirstOrDefault();

            if (existingCust != null)
            {
                CommonMessageHelper.DataAlreadyExist(txtCustomerCode.Text.Trim() + " dengan alamat " + txtAddress.Text.Trim());
            }
            else
            {
                var custToAdd = new Customer
                {
                    CustomerCode    = txtCustomerCode.Text.Trim(),
                    CustomerName    = txtCustomerName.Text.Trim(),
                    Address         = txtAddress.Text.Trim(),
                    ProvinceId      = cbProvince.SelectedValue.ToString(),
                    DistrictId      = cbDistrict.SelectedValue.ToString(),
                    PostalCode      = txtPostCode.Text.Trim(),
                    Phone           = txtPhone.Text.Trim(),
                    Email           = txtEmail.Text.Trim(),
                    Npwp            = txtNpwp.Text.Trim(),
                    PharmacistName  = txtPharmacistName.Text.Trim(),
                    SipaNo          = txtSipaNo.Text.Trim(),
                    SipaExpiredDate = DateTime.Parse(dtpSipaExpiredDate.Value.ToString("yyyy-MM-dd")),
                    SiaNo           = txtSiaNo.Text.Trim(),
                    OutletTypeId    = cbOutletType.SelectedValue.ToString(),
                    SalesAreaId     = cbSalesArea.SelectedValue.ToString(),


                    // Audit Fields
                    CreatedBy  = Properties.Settings.Default.CurrentUserId,
                    CreatedAt  = DateTime.Now,
                    ModifiedBy = Properties.Settings.Default.CurrentUserId,
                    ModifiedAt = DateTime.Now
                };
                uowCust.Repository.Add(custToAdd);
                uowCust.Commit();
                isAdd = false;
                cbSalesArea.Enabled = isAdd;
                btnReload.PerformClick();
                CommonMessageHelper.DataSavedSuccessfully();
            }
        }
Exemplo n.º 27
0
        private bool ValidateMandatoryFields()
        {
            if (string.IsNullOrEmpty(txtAreaCode.Text) || string.IsNullOrEmpty(txtDescription.Text))
            {
                CommonMessageHelper.DataCannotBeEmpty("Kode Area dan Keterangan");
                return(false);
            }

            if (cbRepresentative.Items.Count <= 1)
            {
                CommonMessageHelper.ReferredDataNotSet("Perwakilan");
                return(false);
            }
            return(true);
        }
Exemplo n.º 28
0
        private bool ValidateMandatoryFields()
        {
            if (string.IsNullOrEmpty(txtBatchCode.Text) || cbProductCode.Items.Count <= 1)
            {
                CommonMessageHelper.DataCannotBeEmpty("Kode Batch dan Nama Produk");
                return(false);
            }

            if (cbProductCode.Items.Count <= 1)
            {
                var emptyRefData = "Produk";
                CommonMessageHelper.ReferredDataNotSet(emptyRefData);
                return(false);
            }

            return(true);
        }
Exemplo n.º 29
0
        private bool ValidateMandatoryFields()
        {
            if (string.IsNullOrEmpty(txtUsername.Text) ||
                string.IsNullOrEmpty(txtPassword.Text) ||
                string.IsNullOrEmpty(txtFullName.Text))
            {
                CommonMessageHelper.DataCannotBeEmpty("Username, Password dan Nama Lengkap");
                return(false);
            }

            if (cbRole.Items.Count <= 1)
            {
                var emptyRefData = "User Role";
                CommonMessageHelper.ReferredDataNotSet(emptyRefData);
                return(false);
            }
            return(true);
        }
Exemplo n.º 30
0
        private void btnReload_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(lblSalesNo.Text))
            {
                btnClear.PerformClick();
                return;
            }

            SalesOrder queryResult;

            queryResult = _uow.Repository.GetById(txtSalesOrderId.Text.Trim());
            if (queryResult == null)
            {
                CommonMessageHelper.DataNotFound(lblSalesNo.Text.Trim());
                return;
            }
            LoadDataItem(queryResult);
        }