Example #1
0
        private void frmBinPhonesEditor_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;
            DelegateSellers dn = MysqlControl.Sellers;

            IAsyncResult iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }

            string[] Tempstr = dn.EndInvoke(iar);

            for (int i = 0; i < Tempstr.Length; i++)
            {
                if (Tempstr[i] != null && Tempstr[i] != "")
                {
                    cmbSellers.Items.Add(Tempstr[i]);
                }
            }
            cmbSellers.SelectedIndex = 0;

            dtpTime.Value = new DateTime(int.Parse(iRefundPhone.RefundDate.Substring(0, 4)),
                                         int.Parse(iRefundPhone.RefundDate.Substring(4, 2)),
                                         int.Parse(iRefundPhone.RefundDate.Substring(6, 2)));
            txtName.Text             = iRefundPhone.RefundName;
            txtIMEI.Text             = iRefundPhone.RefundIMEI;
            txtCash.Text             = iRefundPhone.RefundPrice.ToString();
            txtRepairPrice.Text      = iRefundPhone.RefundRepairPrice.ToString();
            txtBackup.Text           = iRefundPhone.RefundBackup;
            cmbSellers.Text          = iRefundPhone.RefundSeller;
            cmbBinType.SelectedIndex = iRefundPhone.RefundRefundType;
            isBusy.Visible           = false;
        }
Example #2
0
        /*
         * private void cmdUpdate_Click(object sender, EventArgs e)
         * {
         *  cmdUpdate.Enabled = false;
         *  isBusy.Visible = true;
         *  try
         *  {
         *      int RefundID = int.Parse(lsvPhones.SelectedItems[0].Text);
         *      int RefundFixPrice = 0;
         *      try
         *      {
         *          RefundFixPrice = int.Parse(lsvPhones.SelectedItems[0].SubItems[10].Text);
         *      }
         *      catch (Exception)
         *      {
         *          RefundFixPrice = 0;
         *      }
         *      string FixDate = "";
         *      if (ckbisSold.Checked)
         *      {
         *          FixDate = dtpFixDate.Value.Year +
         *                    dtpFixDate.Value.Month.ToString().PadLeft(2, '0') +
         *                    dtpFixDate.Value.Day.ToString().PadLeft(2, '0');
         *      }
         *      else
         *      {
         *          RefundFixPrice = 0;
         *          FixDate = "";
         *      }
         *
         *      DelegateFixRefundPhone dn = MysqlControl.FixRefundPhone;
         *
         *      IAsyncResult iar = dn.BeginInvoke(ckbisSold.Checked, FixDate, RefundFixPrice,
         *                                        RefundID, null, null);
         *
         *      while (iar.IsCompleted == false)
         *      {
         *          Application.DoEvents();
         *      }
         *
         *      MysqlController.ReturnResult iResult = dn.EndInvoke(iar);
         *
         *      if (iResult.isSuccess)
         *      {
         *          isBusy.Visible = true;
         *
         *          var iLog = new clsLog.LogPart();
         *
         *          iLog.LogDate = DateTime.Now.Year + DateTime.Now.Month.ToString().PadLeft(2, '0') +
         *                         DateTime.Now.Day.ToString().PadLeft(2, '0');
         *          iLog.LogTime = DateTime.Now.Hour + ":" + DateTime.Now.Minute.ToString().PadLeft(2, '0');
         *          iLog.LogUser = iLoginUser;
         *          iLog.LogDetail = @"更新用户手机返收记录 编号为" + RefundID;
         *
         *          DelegateAddLog dnlog = LogControl.AddLog;
         *
         *          IAsyncResult iarlog = dnlog.BeginInvoke(iLog, null, null);
         *
         *          while (iarlog.IsCompleted == false)
         *          {
         *              Application.DoEvents();
         *          }
         *
         *          dnlog.EndInvoke(iarlog);
         *
         *          isBusy.Visible = false;
         *
         *          MessageBox.Show(
         *              Resources.frmBinPhone_cmdUpdate_Click_修改二手机回收完成_已成功更改_ +
         *              lsvPhones.SelectedItems[0].SubItems[2].Text,
         *              Application.ProductName, MessageBoxButtons.OK);
         *          //CleanUI();
         *          RefreshPayout(iSaveType, iSavestrDate, iSaveisSold);
         *      }
         *      else
         *      {
         *          MessageBox.Show(Resources.frmBinPhone_cmdUpdate_Click_修改二手机回收失败_失败原因_ + iResult.ErrDesc,
         *                          Application.ProductName, MessageBoxButtons.OK);
         *      }
         *  }
         *  catch (Exception)
         *  {
         *      isBusy.Visible = false;
         *      cmdUpdate.Enabled = true;
         *      return;
         *  }
         *  isBusy.Visible = false;
         *  cmdUpdate.Enabled = true;
         * }
         *
         * private void txtFixPrice_TextChanged(object sender, EventArgs e)
         * {
         *  try
         *  {
         *      lsvPhones.SelectedItems[0].SubItems[10].Text = txtFixPrice.Text;
         *  }
         *  catch (Exception)
         *  {
         *      return;
         *  }
         * }
         */

        private void frmBinPhone_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;

            DelegateSellers dn = MysqlControl.Sellers;

            IAsyncResult iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }

            string[] Tempstr = dn.EndInvoke(iar);

            isBusy.Visible = false;

            for (int i = 0; i < Tempstr.Length; i++)
            {
                if (Tempstr[i] != null && Tempstr[i] != "")
                {
                    cmbSellers.Items.Add(Tempstr[i]);
                }
            }
            cmbSellers.SelectedIndex = 0;

            RefreshPayout(0, dtpTime.Value.Year + dtpTime.Value.Month.ToString().PadLeft(2, '0') +
                          dtpTime.Value.Day.ToString().PadLeft(2, '0'), false);
        }
Example #3
0
        private void frmDailySell_Load(object sender, EventArgs e)
        {
            isBusy.Visible = true;

            DelegateSellers dn = MysqlControl.Sellers;

            IAsyncResult iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }

            tempSeller = dn.EndInvoke(iar);

            DelegateManufacturer dn1 = MysqlControl.Manufacturer;

            IAsyncResult iar1 = dn1.BeginInvoke(null, null);

            while (iar1.IsCompleted == false)
            {
                Application.DoEvents();
            }

            tempBrand = dn1.EndInvoke(iar1);

            isBusy.Visible = false;
        }
Example #4
0
        private void frmEditSellEditor_Shown(object sender, EventArgs e)
        {
            try
            {
                DelegateManufacturer dn = MysqlControl.Manufacturer;

                IAsyncResult iar = dn.BeginInvoke(null, null);

                while (iar.IsCompleted == false)
                {
                    Application.DoEvents();
                }

                string[] Tempstr = dn.EndInvoke(iar);

                for (int i = 0; i < Tempstr.Length; i++)
                {
                    if (Tempstr[i] != null && Tempstr[i] != "")
                    {
                        cmbPhoneBrand.Items.Add(Tempstr[i]);
                    }
                    Application.DoEvents();
                }
                cmbPhoneBrand.SelectedIndex = 0;

                DelegateSellers dn2 = MysqlControl.Sellers;

                IAsyncResult iar2 = dn2.BeginInvoke(null, null);

                while (iar2.IsCompleted == false)
                {
                    Application.DoEvents();
                }

                Tempstr = dn2.EndInvoke(iar2);

                for (int i = 0; i < Tempstr.Length; i++)
                {
                    if (Tempstr[i] != null && Tempstr[i] != "")
                    {
                        cmbSeller.Items.Add(Tempstr[i]);
                    }
                    Application.DoEvents();
                }
                cmbSeller.SelectedIndex = 0;

                //LOAD DATA....
                LoadData();

                //cmbPhoneBrand.SelectedIndex = 0;
            }
            catch (Exception)
            {
                MessageBox.Show(Resources.frmNewCustom_frmNewCustom_Load_数据库连接失败_, Application.ProductName,
                                MessageBoxButtons.OK);
            }
        }
Example #5
0
        private void frmDailySellPhones_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;
            try
            {
                DelegateManufacturer dn = MysqlControl.Manufacturer;

                IAsyncResult iar = dn.BeginInvoke(null, null);

                while (iar.IsCompleted == false)
                {
                    Application.DoEvents();
                }

                string[] Tempstr = dn.EndInvoke(iar);

                for (int i = 0; i < Tempstr.Length; i++)
                {
                    if (Tempstr[i] != null && Tempstr[i] != "")
                    {
                        ArrBrand[i] = Tempstr[i];
                    }
                    Application.DoEvents();
                }

                DelegateSellers dn2 = MysqlControl.Sellers;

                IAsyncResult iar2 = dn2.BeginInvoke(null, null);

                while (iar2.IsCompleted == false)
                {
                    Application.DoEvents();
                }

                Tempstr = dn2.EndInvoke(iar2);

                for (int i = 0; i < Tempstr.Length; i++)
                {
                    if (Tempstr[i] != null && Tempstr[i] != "")
                    {
                        ArrSeller[i] = Tempstr[i];
                    }
                    Application.DoEvents();
                }
                //cmbPhoneBrand.SelectedIndex = 0;
            }
            catch (Exception)
            {
                MessageBox.Show(Resources.frmNewCustom_frmNewCustom_Load_数据库连接失败_, Application.ProductName,
                                MessageBoxButtons.OK);
            }
            isBusy.Visible = false;
        }
Example #6
0
        private void frmCommision_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;
            cmbSellers.Items.Clear();

            DelegateSellers dn = MysqlControl.Sellers;

            IAsyncResult iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }

            string[] Tempstr = dn.EndInvoke(iar);

            for (int i = 0; i < Tempstr.Length; i++)
            {
                if (Tempstr[i] != null && Tempstr[i] != "")
                {
                    cmbSellers.Items.Add(Tempstr[i]);
                }
                Application.DoEvents();
            }
            DelegateManufacturer dn1 = MysqlControl.Manufacturer;

            IAsyncResult iar1 = dn1.BeginInvoke(null, null);

            while (iar1.IsCompleted == false)
            {
                Application.DoEvents();
            }

            Brands = dn1.EndInvoke(iar1);

            /*
             * DelegateSellersPosition dn2 = MysqlControl.SellersPosition;
             *
             * IAsyncResult iar2 = dn2.BeginInvoke(null, null);
             *
             * while (iar2.IsCompleted == false)
             * {
             *  Application.DoEvents();
             * }
             *
             * SellersPosition = dn2.EndInvoke(iar2);
             */
            isBusy.Visible = false;
        }
Example #7
0
        private void frmDailyEquip_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;

            DelegateSellers dn = MysqlControl.Sellers;

            IAsyncResult iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }

            tempSellers = dn.EndInvoke(iar);

            isBusy.Visible = false;
        }
Example #8
0
        private void frmEditPhone_Load(object sender, EventArgs e)
        {
            isBusy.Visible = true;
            DelegateManufacturer dn  = MysqlControl.Manufacturer;
            IAsyncResult         iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }
            tempBrand = dn.EndInvoke(iar);

            DelegateSellers dn1  = MysqlControl.Sellers;
            IAsyncResult    iar1 = dn1.BeginInvoke(null, null);

            while (iar1.IsCompleted == false)
            {
                Application.DoEvents();
            }
            tempSeller = dn1.EndInvoke(iar1);

            cmbWarrantyDuration.SelectedIndex = 0;
            cmbWarrantyType.SelectedIndex     = 0;
            dtpWarrantyStartDate.Enabled      = false;
            cmbWarrantyType.Enabled           = false;
            cmbWarrantyDuration.Enabled       = false;

            isBusy.Visible = false;

            if (isPhoneSet)
            {
                txtIMEI.Text = PhoneIMEI;
                cmdSearch_Click(sender, e);
            }

            if (isPhoneUserSet)
            {
                txtBXKid.Text = UserBXKid;
                cmdSearch_Click(sender, e);
            }
        }
Example #9
0
        private void frmAskforLeave_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;
            DelegateSellers dn = MysqlControl.Sellers;

            IAsyncResult iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }

            string[] Tempstr = dn.EndInvoke(iar);

            for (int i = 0; i < Tempstr.Length; i++)
            {
                if (Tempstr[i] != null && Tempstr[i] != "")
                {
                    cmbSellers.Items.Add(Tempstr[i]);
                }
            }
            isBusy.Visible = false;
        }
Example #10
0
        private void frmMarketDebtEditor_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;
            DelegateSellers dn = MysqlControl.Sellers;

            IAsyncResult iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }

            string[] Tempstr = dn.EndInvoke(iar);

            for (int i = 0; i < Tempstr.Length; i++)
            {
                if (Tempstr[i] != null && Tempstr[i] != "")
                {
                    cmbSellers.Items.Add(Tempstr[i]);
                }
            }
            cmbSellers.SelectedIndex = 0;

            dtpTime.Value = new DateTime(int.Parse(iMarketDebt.DebtDate.Substring(0, 4)),
                                         int.Parse(iMarketDebt.DebtDate.Substring(4, 2)),
                                         int.Parse(iMarketDebt.DebtDate.Substring(6, 2)));
            txtMaster.Text      = iMarketDebt.DebtMaster;
            txtName.Text        = iMarketDebt.DebtDetail;
            txtCash.Text        = iMarketDebt.DebtPrice.ToString();
            cmbSellers.Text     = iMarketDebt.DebtSeller;
            txtBackup.Text      = iMarketDebt.DebtBackup;
            dtpAddFixDate.Value = new DateTime(int.Parse(iMarketDebt.DebtFixDate.Substring(0, 4)),
                                               int.Parse(iMarketDebt.DebtFixDate.Substring(4, 2)),
                                               int.Parse(iMarketDebt.DebtFixDate.Substring(6, 2)));
            rbisDebt.Checked = !iMarketDebt.DebtisFix;
            isBusy.Visible   = false;
        }
Example #11
0
        private void frmEquipSellEditor_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;
            DelegateSellers dn = MysqlControl.Sellers;

            IAsyncResult iar = dn.BeginInvoke(null, null);

            while (iar.IsCompleted == false)
            {
                Application.DoEvents();
            }

            string[] Tempstr = dn.EndInvoke(iar);
            for (int i = 0; i < Tempstr.Length; i++)
            {
                if (Tempstr[i] != null && Tempstr[i] != "")
                {
                    cmbSeller.Items.Add(Tempstr[i]);
                }
            }
            cmbSeller.SelectedIndex = 0;
            //cmbPayment.SelectedIndex = 0;

            dtpTime.Value = new DateTime(int.Parse(iEquip.EquipDate.Substring(0, 4)),
                                         int.Parse(iEquip.EquipDate.Substring(4, 2)),
                                         int.Parse(iEquip.EquipDate.Substring(6, 2)))
            ;
            txtBackup.Text           = iEquip.EquipBackup;
            txtName.Text             = iEquip.EquipName;
            txtPrice.Text            = iEquip.EquipPrice.ToString();
            txtRealPrice.Text        = iEquip.EquipRealPrice.ToString();
            cmbSeller.Text           = iEquip.EquipSellers;
            txtSupplier.Text         = iEquip.EquipSupplier;
            cmbPayment.SelectedIndex = iEquip.EquipPayment;
            txtEquipBuyer.Text       = iEquip.EquipBuyer;
            isBusy.Visible           = false;
        }
Example #12
0
        private void frmEquipSell_Shown(object sender, EventArgs e)
        {
            isBusy.Visible = true;
            try
            {
                DelegateSellers dn = MysqlControl.Sellers;

                IAsyncResult iar = dn.BeginInvoke(null, null);

                while (iar.IsCompleted == false)
                {
                    Application.DoEvents();
                }

                string[] Tempstr = dn.EndInvoke(iar);

                for (int i = 0; i < Tempstr.Length; i++)
                {
                    if (Tempstr[i] != null && Tempstr[i] != "")
                    {
                        cmbSeller.Items.Add(Tempstr[i]);
                    }
                }
                cmbSeller.SelectedIndex = 0;
            }
            catch (Exception)
            {
                MessageBox.Show(Resources.frmAddPhone_frmAddPhone_Load_数据库连接失败_, Application.ProductName,
                                MessageBoxButtons.OK);
                cmdAdd.Enabled = false;
                isBusy.Visible = false;
                return;
            }
            isBusy.Visible = false;
            RefreshPayout();
        }
Example #13
0
        private void frmLogin_Shown(object sender, EventArgs e)
        {
            cmbUser.Items.Clear();

            try
            {
                DelegateSellers dn = MysqlControl.Sellers;

                IAsyncResult iar = dn.BeginInvoke(null, null);

                while (iar.IsCompleted == false)
                {
                    Application.DoEvents();
                }

                Tempstr = dn.EndInvoke(iar);

                DelegateSellersPosition dn1 = MysqlControl.SellersPosition;

                IAsyncResult iar1 = dn1.BeginInvoke(null, null);

                while (iar1.IsCompleted == false)
                {
                    Application.DoEvents();
                }

                Tempstrx = dn1.EndInvoke(iar1);

                DelegateSellersPassword dn2 = MysqlControl.SellersPassword;

                IAsyncResult iar2 = dn2.BeginInvoke(null, null);

                while (iar2.IsCompleted == false)
                {
                    Application.DoEvents();
                }

                Tempstrp = dn2.EndInvoke(iar2);

                //Tempstr = MysqlControl.Sellers();
                //Tempstrx = MysqlControl.SellersPosition();
                //Tempstrp = MysqlControl.SellersPassword();
                int k = 0;
                for (int i = 0; i < Tempstr.Length; i++)
                {
                    if (Tempstr[i] != null && Tempstr[i] != "")
                    {
                        if (Tempstrx[i] == "销售" || Tempstrx[i] == "店长")
                        {
                            TempIndex[k] = i;
                            cmbUser.Items.Add(Tempstr[i]);
                            k++;
                        }
                    }
                }
                cmbUser.Items.Add("ERP管理员");
                cmbUser.SelectedIndex = 0;
            }
            catch (Exception)
            {
                MessageBox.Show("检测到数据库连接异常,请稍候重试!", Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
                DialogResult = DialogResult.Cancel;
            }
        }