Пример #1
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            SetDefaultTime();

            ParmIni = new IniFile(System.AppDomain.CurrentDomain.BaseDirectory + @"/Parm.ini");
            string stemp = ParmIni.IniReadValue("Init", "store_id");
            int    iPos  = 0;

            // 门店
            cmb_store_id.Items.Add("所有门店");
            for (int i = 0; i < Var.Get_StoreListCount; i++)
            {
                cmb_store_id.Items.Add(Var.g_StoreList_Info[i].name);
                if (stemp.Trim() == Var.g_StoreList_Info[i].id)
                {
                    iPos = i;
                }
            }
            cmb_store_id.SelectedIndex = iPos + 1;
            store_id_key = Var.g_StoreList_Info[cmb_store_id.SelectedIndex - 1].id;

            store_flag = false;
            iPos       = 0;


            ////modify 20181104 在选择相应门店的时候,才列出相应店员
            //// 店员
            cmb_operator_id.Items.Clear();
            cmb_operator_id.Items.Add("所有店员");
            stemp = ParmIni.IniReadValue("Init", "operator_id");
            for (int i = 0; i < Var.Get_UserListCount; i++)
            {
                cmb_operator_id.Items.Add(Var.g_UserList_Info[i].username);
                if (stemp.Trim() == Var.g_UserList_Info[i].id)
                {
                    iPos = i;
                }
            }
            cmb_operator_id.SelectedIndex = iPos + 1;
            operator_id_key = Var.g_UserList_Info[cmb_operator_id.SelectedIndex - 1].id;

            user_flag = false;
            iPos      = 0;


            //modify 20181104 在选择相应门店时,列出所有设备ID
            //// 设备
            cmb_device_id.Items.Clear();
            cmb_device_id.Items.Add("所有设备");
            stemp = ParmIni.IniReadValue("Init", "device_id");
            for (int i = 0; i < Var.Get_DeviceListCount; i++)
            {
                cmb_device_id.Items.Add(Var.g_DeviceList_Info[i].name);
                if (stemp.Trim() == Var.g_DeviceList_Info[i].id)
                {
                    iPos = i;
                }
            }
            cmb_device_id.SelectedIndex = iPos + 1;
            device_id_key = Var.g_DeviceList_Info[cmb_device_id.SelectedIndex - 1].id;

            device_flag = false;
            iPos        = 0;
            //交易类型列表
            //for (int i = 0; i < Var.all_payment_list_count; i++)
            //{
            //    cmb_Payment_Type.Items.Add(Var.g_all_payment_list[i].payment_name);
            //}
            //cmb_Payment_Type.SelectedIndex = 0;

            cmb_Payment_Type.Items.Add("所有交易类型");
            foreach (KeyValuePair <string, string> pair in Var.g_all_payment_list)
            {
                cmb_Payment_Type.Items.Add(pair.Value);
            }

            //支付方式列表
            cmbPaymentMode.Items.Add("所有支付方式");
            foreach (KeyValuePair <string, string> pair in Var.g_all_payment_channel)
            {
                cmbPaymentMode.Items.Add(pair.Value);
            }
            //cmbPaymentMode.SelectedIndex = 0;

            //订单状态列表
            cmb_Order_Status.Items.Add("所有订单状态");
            foreach (KeyValuePair <string, string> pair in Var.g_all_payment_Order_Status)
            {
                cmb_Order_Status.Items.Add(pair.Value);
            }
            //cmb_Order_Status.SelectedIndex = 0;

            _excelHelper = new ExportToExcel();
        }
Пример #2
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            ParmIni = new IniFile(System.AppDomain.CurrentDomain.BaseDirectory + @"/Parm.ini");

            //tKeyBoxInputID.Text = ParmIni.IniReadValue("UserKey", "key");

            string stemp = ParmIni.IniReadValue("Init", "store_id");
            int    iPos  = 0;

            // 门店
            for (int i = 0; i < Var.Get_StoreListCount; i++)
            {
                cmbStore.Items.Add(Var.g_StoreList_Info[i].name);
                if (stemp.Trim() == Var.g_StoreList_Info[i].id)
                {
                    iPos = i;
                }
            }
            cmbStore.SelectedIndex = iPos;

            store_flag = false;
            iPos       = 0;

            ////modify 20181104 在选择相应门店的时候,才列出相应店员
            //// 店员
            cmbUser.Items.Clear();
            stemp = ParmIni.IniReadValue("Init", "operator_id");
            for (int i = 0; i < Var.Get_UserListCount; i++)
            {
                cmbUser.Items.Add(Var.g_UserList_Info[i].username);
                if (stemp.Trim() == Var.g_UserList_Info[i].id)
                {
                    iPos = i;
                }
            }
            cmbUser.SelectedIndex = iPos;
            user_flag             = false;
            iPos = 0;


            //modify 20181104 在选择相应门店时,列出所有设备ID
            //// 设备
            cmbDevice.Items.Clear();
            if (Var.Get_DeviceListCount != 0)
            {
                stemp = ParmIni.IniReadValue("Init", "device_id");
                for (int i = 0; i < Var.Get_DeviceListCount; i++)
                {
                    cmbDevice.Items.Add(Var.g_DeviceList_Info[i].name);
                    if (stemp.Trim() == Var.g_DeviceList_Info[i].id)
                    {
                        iPos = i;
                    }
                }
                cmbDevice.SelectedIndex = iPos;
                device_flag             = false;
                iPos = 0;
            }
            else
            {
                Var.device_id   = ParmIni.IniReadValue("Init", "device_id");
                Var.device_name = ParmIni.IniReadValue("Init", "device_name");
                cmbDevice.Items.Add(Var.device_name);
                cmbDevice.SelectedIndex = 0;
                device_flag             = false;
                iPos = 0;
            }


            grid2.Visibility  = System.Windows.Visibility.Visible;
            grid8.Visibility  = System.Windows.Visibility.Hidden;
            grid11.Visibility = System.Windows.Visibility.Hidden;

            if (Var.windowsType == 1)
            {
                btYes.IsChecked = true;
                btNo.IsChecked  = false;
            }
            else
            {
                btYes.IsChecked = false;
                btNo.IsChecked  = true;
            }

            if (Var.sound == 1)
            {
                rBSoundStart.IsChecked = true;
                rBSoundClose.IsChecked = false;
            }
            else
            {
                rBSoundStart.IsChecked = false;
                rBSoundClose.IsChecked = true;
            }

            if (Var.dispnotes == 1)
            {
                rBDispNotesStart.IsChecked = true;
                rBDispNotesClose.IsChecked = false;
            }
            else
            {
                rBDispNotesStart.IsChecked = false;
                rBDispNotesClose.IsChecked = true;
            }

            if (Var.PayChannel == 1)
            {
                radioButton1.IsChecked = true;
                radioButton2.IsChecked = false;
            }
            else
            {
                radioButton1.IsChecked = false;
                radioButton2.IsChecked = true;
            }

            if (Var.PayChannel == 1)
            {
                radioButton3.IsChecked = true;
                radioButton4.IsChecked = false;
                radioButton5.IsChecked = false;
            }
            else if (Var.PayChannel == 2)
            {
                radioButton3.IsChecked = false;
                radioButton4.IsChecked = true;
                radioButton5.IsChecked = false;
            }
            else
            {
                radioButton3.IsChecked = false;
                radioButton4.IsChecked = false;
                radioButton5.IsChecked = true;
            }
        }