01-03-18, 08:38 PM
السلام عليكم عندي هذا الكود لفتح صندوق الكاشير ولكن لا لا أعرف كيفية تنفيذه من خلال زر الرجاء المساعدة
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.PointOfService;
using System.Windows.Forms;
namespace SAHIT.GSMS.WinUI
{
class CashDrawerClass
{
CashDrawer myCashDrawer;
PosExplorer explorer;
public CashDrawerClass(Form form)
{
try
{
explorer = new PosExplorer();
DeviceInfo ObjDevicesInfo = explorer.GetDevice("C4141");
bool check = ObjDevicesInfo.IsDefault;
myCashDrawer = (CashDrawer)explorer.CreateInstance(ObjDevicesInfo);
}
catch (Exception ex)
{
//throw ex;
}
}
public void OpenCashDrawer()
{
myCashDrawer.Open();
myCashDrawer.Claim(10000);
myCashDrawer.DeviceEnabled = true;
myCashDrawer.OpenDrawer();
myCashDrawer.DeviceEnabled = false;
myCashDrawer.Release();
myCashDrawer.Close();
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.PointOfService;
using System.Windows.Forms;
namespace SAHIT.GSMS.WinUI
{
class CashDrawerClass
{
CashDrawer myCashDrawer;
PosExplorer explorer;
public CashDrawerClass(Form form)
{
try
{
explorer = new PosExplorer();
DeviceInfo ObjDevicesInfo = explorer.GetDevice("C4141");
bool check = ObjDevicesInfo.IsDefault;
myCashDrawer = (CashDrawer)explorer.CreateInstance(ObjDevicesInfo);
}
catch (Exception ex)
{
//throw ex;
}
}
public void OpenCashDrawer()
{
myCashDrawer.Open();
myCashDrawer.Claim(10000);
myCashDrawer.DeviceEnabled = true;
myCashDrawer.OpenDrawer();
myCashDrawer.DeviceEnabled = false;
myCashDrawer.Release();
myCashDrawer.Close();
}
}
}