private bool cboOwner_Restore()
        {
            oOwner.ClearError();
            oOwner.FilterActual  = true;
            oOwner.FilterIsOwner = true;

            if (nOwnerID > 0)
            {
                oOwner.IDList = nOwnerID.ToString();                 // только полученное значение
            }
            else
            {
                if (nHostID.HasValue && nHostID > 0)
                {
                    oOwner.FilterHostsList = nHostID.ToString();
                }
            }

            if (oOwner.FillData())
            {
                cboOwner.ValueMember   = oOwner.ColumnID;
                cboOwner.DisplayMember = oOwner.ColumnName;
                cboOwner.Restore(oOwner.MainTable);
            }
            return(oOwner.ErrorNumber == 0);
        }
Example #2
0
 private bool cboPartnerRoot_Restore()
 {
     cboPartnerRoot.DataSource = null;
     oPartner.ClearError();
     if (oPartner.FillTablePartnersRoots())
     {
         cboPartnerRoot.Restore(oPartner.TablePartnersRoots,
                                oPartner.TablePartnersRoots.Columns[1].ColumnName,
                                oPartner.TablePartnersRoots.Columns[0].ColumnName);
     }
     return(oPartner.ErrorNumber == 0);
 }
Example #3
0
        private bool grdPartnersRoots_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oPartnerRootCur.ClearOne();

            oPartnerRootList.ClearError();
            oPartnerRootList.ClearFilters();
            oPartnerRootList.ID     = null;
            oPartnerRootList.IDList = null;

            // собираем условия

            // контексты
            if (txtNameContext.Text.Trim().Length > 0)
            {
                oPartnerRootList.FilterNameContext = txtNameContext.Text.Trim().ToUpper();
            }
            if (txtInnContext.Text.Trim().Length > 0)
            {
                oPartnerRootList.FilterInnContext = txtInnContext.Text.Trim().ToUpper();
            }

            // выбор
            oPartnerRootList.FilterPartnersRootsList = ucSelectRecordID_PartnersRoots.GetIdString();

            // checks
            if (optActual.Checked)
            {
                oPartnerRootList.FilterActual = true;
            }
            if (optActualNot.Checked)
            {
                oPartnerRootList.FilterActual = false;
            }
            //

            grdPartnersRoots_Partners.DataSource = null;

            grdPartnersRoots.GetGridState();

            oPartnerRootList.FillTablePartnersRoots();
            grdPartnersRoots.IsLockRowChanged = true;
            grdPartnersRoots.Restore(oPartnerRootList.TablePartnersRoots);
            tmrRestore.Enabled = true;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oPartnerRootList.ErrorNumber == 0);
        }
Example #4
0
 private bool cboPartner_Restore()
 {
     cboPartner.DataSource = null;
     oPartner.ClearError();
     oPartner.FilterActual = true;
     if (oPartner.FillData())
     {
         cboPartner.DataSource    = new DataView(oPartner.MainTable);
         cboPartner.ValueMember   = oPartner.ColumnID;
         cboPartner.DisplayMember = oPartner.ColumnName;
         cboPartner.Restore();
     }
     return(oPartner.ErrorNumber == 0);
 }
 private bool cboOwner_Restore()
 {
     cboOwner.DataSource = null;
     oOwner.ClearError();
     oOwner.FilterActual  = true;
     oOwner.FilterIsOwner = true;
     if (oOutputDocument != null && oOutputDocument.HostID.HasValue)
     {
         oOwner.FilterHostsList = oOutputDocument.HostID.ToString();
     }
     if (oOwner.FillData())
     {
         cboOwner.ValueMember   = oOwner.ColumnID;
         cboOwner.DisplayMember = oOwner.ColumnName;
         cboOwner.Restore(oOwner.MainTable);
     }
     return(oOwner.ErrorNumber == 0);
 }
Example #6
0
 private bool cboOwner_Restore()
 {
     oPartner.ClearError();
     oPartner.FilterActual  = true;
     oPartner.FilterIsOwner = true;
     if (oAct != null && oAct.HostID.HasValue)
     {
         oPartner.FilterHostsList = oAct.HostID.ToString();
     }
     if (oPartner.FillData())
     {
         cboOwner.DataSource    = new DataView(oPartner.MainTable);
         cboOwner.ValueMember   = oPartner.ColumnID;
         cboOwner.DisplayMember = "Name";
         cboOwner.Restore();
     }
     return(oPartner.ErrorNumber == 0);
 }
        private void btnSave_Click(object sender, EventArgs e)
        {
            if (grdData.Rows.Count == 0)
            {
                if (RFMMessage.MessageBoxYesNo("Не введено ни одного товара...\n" +
                                               "Очистить все специальные данные о товарах для клиента?") != DialogResult.Yes)
                {
                    return;
                }
            }

            // собственно сохранение
            oPartner.ClearError();
            oPartner.SavePartnersGoods(nPartnerID, tGoods);
            if (oPartner.ErrorNumber == 0)
            {
                DialogResult = DialogResult.Yes;
                Dispose();
            }
        }
        private bool dgvData_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            Partner oPartnerList = new Partner();

            oPartnerList.ClearError();
            oPartnerList.ClearFilters();
            oPartnerList.ID     = null;
            oPartnerList.IDList = null;

            // собираем условия

            // контексты
            if (txtNameContext.Text.Trim().Length > 0)
            {
                oPartnerList.FilterNameContext = txtNameContext.Text.Trim().ToUpper();
            }
            if (txtInnContext.Text.Trim().Length > 0)
            {
                oPartnerList.FilterInnContext = txtInnContext.Text.Trim().ToUpper();
            }

            // выбор
            oPartnerList.FilterPartnersRootsList = ucSelectRecordID_PartnersRoots.GetIdString();
            oPartnerList.FilterZonesList         = ucSelectRecordID_Zones.GetIdString();

            // checks
            if (chkActual.Checked)
            {
                oPartnerList.FilterActual = true;
            }

            if (chkCustomer.Checked)
            {
                oPartnerList.FilterIsCustomer = true;
            }
            if (chkSupplier.Checked)
            {
                oPartnerList.FilterIsSupplier = true;
            }
            if (chkTransport.Checked)
            {
                oPartnerList.FilterIsTransport = true;
            }
            if (chkOwner.Checked)
            {
                oPartnerList.FilterIsOwner = true;
            }

            if (chkSeparatePicking.Checked)
            {
                oPartnerList.FilterSeparatePicking = true;
            }

            if (chkPerversion.Checked)
            {
                oPartnerList.FilterPartnersGoodsExists = true;
            }

            if (nHostID.HasValue || nUserHostID.HasValue)
            {
                if (nHostID.HasValue)
                {
                    oPartnerList.FilterHostsList = nHostID.ToString();
                }
                if (nUserHostID.HasValue)
                {
                    oPartnerList.FilterHostsList = nUserHostID.ToString();
                }
            }
            else
            {
                if (ucSelectRecordID_Hosts.IsSelectedExist)
                {
                    oPartnerList.FilterHostsList = ucSelectRecordID_Hosts.GetIdString();
                }
            }

            dgvData.GetGridState();

            oPartnerList.FillData();
            dgvData.Restore(oPartnerList.MainTable);
            tmrRestore.Enabled = true;
            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oPartnerList.ErrorNumber == 0);
        }
Example #9
0
        private bool grdData_Restore()
        {
            RFMCursorWait.Set(true);
            RFMCursorWait.LockWindowUpdate(FindForm().Handle);

            oPartnerCur.ClearOne();

            oPartnerList.ClearError();
            oPartnerList.ClearFilters();
            oPartnerList.ID     = null;
            oPartnerList.IDList = null;

            // собираем условия

            // контексты
            if (txtNameContext.Text.Trim().Length > 0)
            {
                oPartnerList.FilterNameContext = txtNameContext.Text.Trim().ToUpper();
            }
            if (txtInnContext.Text.Trim().Length > 0)
            {
                oPartnerList.FilterInnContext = txtInnContext.Text.Trim().ToUpper();
            }

            // выбор
            oPartnerList.FilterPartnersRootsList = ucSelectRecordID_PartnersRoots.GetIdString();
            oPartnerList.FilterZonesList         = ucSelectRecordID_Zones.GetIdString();
            oPartnerList.FilterHostsList         = ucSelectRecordID_Hosts.GetIdString();

            // checks
            if (optActual.Checked)
            {
                oPartnerList.FilterActual = true;
            }
            if (optActualNot.Checked)
            {
                oPartnerList.FilterActual = false;
            }

            if (chkIsCustomer.Checked)
            {
                oPartnerList.FilterIsCustomer = true;
            }
            if (chkIsSupplier.Checked)
            {
                oPartnerList.FilterIsSupplier = true;
            }
            if (chkIsTransport.Checked)
            {
                oPartnerList.FilterIsTransport = true;
            }
            if (chkIsOwner.Checked)
            {
                oPartnerList.FilterIsOwner = true;
            }

            if (optPartnersGoodsExists.Checked)
            {
                oPartnerList.FilterPartnersGoodsExists = true;
            }
            if (optPartnersGoodsExistsNot.Checked)
            {
                oPartnerList.FilterPartnersGoodsExists = false;
            }

            // host

            /*
             *          if (nUserHostID.HasValue)
             *          {
             *                  oPartnerList.FilterHostsList = nUserHostID.ToString();
             *          }
             *          else
             *          {
             *                  if (nUserHostID.HasValue)
             *                  {
             *                          oPartnerList.FilterHostsList = nUserHostID.ToString();
             *                  }
             *          }
             */

            grdPartnersDetails.DataSource = null;
            grdPartnersGoods.DataSource   = null;

            grdData.GetGridState();

            oPartnerList.FillData();
            grdData.IsLockRowChanged = true;
            grdData.Restore(oPartnerList.MainTable);
            tmrRestore.Enabled = true;

            RFMCursorWait.LockWindowUpdate(IntPtr.Zero);
            RFMCursorWait.Set(false);

            return(oPartnerList.ErrorNumber == 0);
        }