예제 #1
0
        private void ShowDeitalSettingDialog()
        {
            using (var form = ApplicationContext.Create(nameof(PC1602)))
            {
                var staffId = SettingHeader.StaffId;
                if (staffId == 0)
                {
                    staffId = CustomerSelected.StaffId;
                }
                var staff        = Staffs.First(x => x.Id == staffId);
                var departmentId = SettingHeader.DepartmentId;
                if (departmentId == 0)
                {
                    departmentId = staff.DepartmentId;
                }
                var department = Departments.First(x => x.Id == departmentId);

                var screen = form.GetAll <PC1602>().First();
                #region initialize PC1602 header/setting values
                screen.datBilledAt.Value       = datBilledAt.Value;
                screen.datSalesAt.Value        = datSalesAt.Value;
                screen.datClosingAt.Value      = datClosingAt.Value;
                screen.datDueAt.Value          = datDueAt.Value;
                screen.txtCustomerCode.Text    = txtCustomerCode.Text;
                screen.lblCustomerName.Text    = lblCustomerName.Text;
                screen.CustomerSelected        = CustomerSelected;
                screen.txtDestinationCode.Text = txtDestinationCode.Text;
                screen.lblDestinationName.Text = lblDestinationName.Text;
                screen.txtInvoiceCode.Text     = txtInvoiceCode.Text;

                screen.txtStaffCode.Text      = staff.Code;
                screen.lblStaffName.Text      = staff.Name;
                screen.txtDepartmentCode.Text = department.Code;
                screen.lblDepartmentName.Text = department.Name;
                screen.Note1Enabled           = rdoSetFixedValueToNote1.Checked;
                screen.Note2Enabled           = rdoSetFixedValueToNote2.Checked;

                screen.SettingHeader = SettingHeader;
                #endregion

                if (ApplicationContext.ShowDialog(ParentForm, form) != DialogResult.OK)
                {
                    return;
                }

                SettingHeader.DepartmentId      = Departments.First(x => x.Code == screen.txtDepartmentCode.Text).Id;
                SettingHeader.StaffId           = Staffs.First(x => x.Code == screen.txtStaffCode.Text).Id;
                SettingHeader.CollectCategoryId = (int)screen.cmbCollectCategory.SelectedItem.SubItems[1].Value;
                SettingHeader.CurrencyId        = Currencies.First(x => x.Code == screen.txtCurrencyCode.Text).Id;
                SettingHeader.Details           = screen.GetBillingsFromGrid()
                                                  .Select((x, index) => {
                    x.DisplayOrder = index + 1;
                    return(x);
                }).ToList();
                SetDetailInputStatus();
            }
        }
예제 #2
0
        /// <summary>
        /// Load departments by selected store
        /// </summary>
        private void OnDepartmentReload()
        {
            var queryCriteria = new QueryDepartmentByStoreId {
                StoreId = QueryCriteria.StoreId
            };

            Departments = _departmentService.QueryAll(queryCriteria);
            QueryCriteria.DepartmentId = Departments.First().Id;
        }
예제 #3
0
        private Department InitDefaultDepartment()
        {
            var config = _sysConfigRepository.Query(new Hashtable()).FirstOrDefault(x => x.Name == ConstStrings.DataSyncDefaultDepartment);

            if (config != null && !string.IsNullOrWhiteSpace(config.Value))
            {
                return(Departments.FirstOrDefault(x => x.DepartmentID == config.Value.ToInt32()));
            }
            else
            {
                return(Departments.First());
            }
        }
예제 #4
0
        /// <summary>
        /// Получение словаря с необходимыми полями для работы с БД
        /// </summary>
        /// <param name="command">Объект для преобразования</param>
        /// <returns>словарь</returns>
        private Dictionary <string, string> GetParam(DepartmentCommand command)
        {
            Dictionary <string, string> result = new Dictionary <string, string>()
            {
                { "Code", command.Code },
                { "Name", command.Name },
            };

            if (command.ParentDepartmentName != null)
            {
                Department dep = Departments.First(item => item.Name.Equals(command.ParentDepartmentName));
                result.Add("ParentDepartmentID", dep.Id);
            }
            return(result);
        }
예제 #5
0
 private void InitializeDepartmentSelection()
 {
     if (Departments.Count == DepartmentIds.Count)
     {
         lblDepartmentName.Text = "すべて";
     }
     else if (DepartmentIds.Count == 1)
     {
         lblDepartmentName.Text = Departments.First(x => DepartmentIds.Contains(x.Id)).Name;
     }
     else
     {
         lblDepartmentName.Text = "請求部門絞込有";
     }
     DepartmentIdsInner = DepartmentIds;
 }
예제 #6
0
        /// <summary>
        /// Получение словаря с необходимыми полями для работы с БД
        /// </summary>
        /// <param name="command">Объект для преобразования</param>
        /// <returns>словарь</returns>
        private Dictionary <string, string> GetParam(EmployeeCommand command)
        {
            Department dep = Departments.First(item => item.Name.Equals(command.DepartmentName));

            return(new Dictionary <string, string>()
            {
                { "DepartmentID", dep.Id },

                { "SurName", command.SurName },
                { "FirstName", command.FirstName },
                { "Patronymic", command.Patronymic },

                { "DateOfBirth", command.DateOfBirth.ToString() },

                { "DocSeries", command.DocSeries },
                { "DocNumber", command.DocNumber },
                { "Position", command.Position },
            });
        }
예제 #7
0
        public void ToogleRootDepartment()
        {
            var rootDepartment = Departments.First();

            rootDepartment.IsExpanded = !rootDepartment.IsExpanded;
        }