Ejemplo n.º 1
0
 void DoView()
 {
     if (Utils.Company != "00")
     {
         RibbonSaveEnable = false;
     }
     if (!string.IsNullOrEmpty(_COMID))
     {
         var bl = new BlCommissionSetup();
         var dt = bl.GetCommissionMast(_COMID);
         foreach(Ledgers.COMMISIONMASTRow dr in dt.Rows)
         {
             txtdocno.Text = _COMID;
             Frmdate.EditValue = dr.PRMOFRM;
             Todate.EditValue = dr.PRMOTO;
             Promoname.EditValue = dr.PROMONAME;
             LookuptoStore.EditValue = null;
             if(!dr.IsSTOREIDNull())
                 LookuptoStore.EditValue = dr.STOREID;
             lookupsalesman.EditValue = dr.EMPNO;
             RibbonSaveEnable =true;
             labelControl1.Visible = false;
             if (!dr.IsUPLOADNull())
             {
                 if (dr.UPLOAD)
                 {
                     RibbonSaveEnable = false;
                     labelControl1.Visible = true;
                 }
             }
         }
         if (ledgers1.COMMISIONDETAIL.Rows.Count > 0)
         {
             ledgers1.COMMISIONDETAIL.Clear();
         }
         ledgers1.Merge(bl.GetCommissionDetail(_COMID));
     }
 }
Ejemplo n.º 2
0
        void DoDownLoadPromotions()
        {
            txtstatus.Caption = "Downloading Promotions";
            Application.DoEvents();
            try
            {
                var dm = new BlCommissionSetup();
                var dt = dm.GetCommissonMastNotReceived();
                var syc = new RemoteSync();

                if (Utils.PingServer() )
                {

                    if (dt.Rows.Count == 0)
                    {
                        var drd = _dsdownload.NewRow();
                        drd[0] = "";
                        drd[1] = DateTime.Now.Date;
                        drd[2] = "Commission Invoice";
                        drd[3] = "Nothing to Download";
                        _dsdownload.Rows.Add(drd);
                    }
                }
                else
                {
                    XtraMessageBox.Show("Failed to connect server ", "POS", MessageBoxButtons.OK,MessageBoxIcon.Information);
                }

                foreach (Ledgers.COMMISIONMASTRow dr in dt.Rows)
                {
                    if (Utils.PingServer())
                    {
                        var drd = _dsdownload.NewRow();
                        drd[0] = dr.COMID;
                        drd[1] = DateTime.Now.Date;
                        drd[2] = "Commission Invoice";
                        var ret = syc.DoUpLoadPromotions(dr, dm.GetCommissionDetail(dr.COMID, true), true);
                        if (ret == "1")
                        {
                            drd[3] = "Downloaded";
                        }
                        else
                        {
                            drd[3] = "Error  " + ret;
                        }
                        _dsdownload.Rows.Add(drd);
                    }
                    else
                    {
                        XtraMessageBox.Show("Failed to connect server ", "POS", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
            }
            catch (Exception exp)
            {
                XtraMessageBox.Show(exp.ToString(), "POS", MessageBoxButtons.OK,MessageBoxIcon.Information);
            }

        }