Ejemplo n.º 1
0
        void GetData()
        {

            try
            {
                DisplayStatus("Connecting...");
                var constr = new SqlAsyncConnectionString();
                connection = new SqlConnection(constr);
                string commandText = " Select top 1 * from ITEMMAST order by 1 desc  ";

                var command = new SqlCommand(commandText, connection);
                connection.Open();

                DisplayStatus("Executing...");
                
                
                isExecuting = true;
                AsyncCallback callback = HandleCallback;
                command.BeginExecuteReader(callback, command);

               //  "WAITFOR DELAY '00:00:05';" + FOR XML raw ,  ELEMENTS XSINIL
                commandText = " SELECT top 1 * FROM supplier  ";
                connection1 = new SqlConnection(constr);
                connection1.Open();
                var command1 = new SqlCommand(commandText, connection1);
                AsyncCallback callback1 = HandleCallback1;

                command1.BeginExecuteReader(callback1, command1);

            }
            catch (Exception ex)
            {
                isExecuting = false;
                DisplayStatus(string.Format("Ready (last error:{0})", ex.Message));
                if (connection != null)
                {
                    connection.Close();
                }
                if (connection1 != null)
                {
                    connection1.Close();
                }
            }
        }
Ejemplo n.º 2
0
 public Ledgers.COMMISIONMASTDataTable GetCommissonMastNotReceived()
 {
     string storeids = new Masters.StoreManager().GetSalesStore() + ",";
     string _sysnstr = Utils.ConnectionstringSync;
         if (Utils.Company != "01")
         {
             _sysnstr = new SqlAsyncConnectionString(6, true);
         }
         return new LedgersTableAdapters.COMMISIONMASTTableAdapter { Connection = { ConnectionString = _sysnstr } }.GetDataByNotReceived(storeids);
 }
Ejemplo n.º 3
0
 public Ledgers.COMMISIONDETAILDataTable GetCommissionDetail(string commid = null,bool isRemote=false)
 {
     var dt = new Ledgers().COMMISIONDETAIL;
     string _sysnstr = Utils.ConnectionstringSync;
     if (isRemote)
     {
         if (Utils.Company != "01")
         {
             _sysnstr = new SqlAsyncConnectionString(6, true);
         }
     }
     var ta = new LedgersTableAdapters.COMMISIONDETAILTableAdapter
                  {
                      Connection = { ConnectionString = isRemote ? _sysnstr : _constr }
                  };
     if (commid == null)
     {
         ta.Fill(dt);
     }
     else
     {
         ta.FillByCOMID(dt, commid);
     }
     return dt;
 }
Ejemplo n.º 4
0
 public void UpdateSync(string commid,bool isRemote=false)
 {
     string _sysnstr = Utils.ConnectionstringSync;
     if (Utils.Company != "01")
     {
         _sysnstr = new SqlAsyncConnectionString(6, true);
     }
     new LedgersTableAdapters.COMMISIONMASTTableAdapter { Connection = { ConnectionString = isRemote ? _sysnstr : _constr } }.UpdateSync(commid);
 }
Ejemplo n.º 5
0
        private void FetchServerData()
        {
            tranids = string.Empty;
            progressPanel1.Visible = true;
            Application.DoEvents();
           _dsdownload.Clear();
           string cnstr = new SqlAsyncConnectionString(6, true);
       //  string _syncConstr = new SqlAsyncConnectionString(6, true);
           if (Utils.Company == "01" || Utils.Company == "00")
           {
               cnstr = Utils.ConnectionstringSync;//_constr = VIRETAILDAL.COMMON.Utils.Connectionstring;
           }
           var bl = new ItemDownLoadDataManager();
            try
            {
                string maxtran = new Blitemmove().GetMaxTranid();
               _negativestockmaster = bl.GetNegativeStock();

                bl.GetServerData(ref _ds, cnstr, maxtran);
                if (DoStartPusingData(true))
                {
                   ////////new RemoteSync().UpDateRemoteTransferMain(_ds.ITEMTRANSFERMAIN);
                   XtraMessageBox.Show("Down load finish", "POS", MessageBoxButtons.OK,MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.ToString());
            }
        }