public void StartMe() { if (!IsRunning) { Gini.Start(); IsRunning = true; } }
public GiniService() { if (!IsRunning) { Gini.Start(); IsRunning = true; } }
public static BotUser GetEmp(AprajitaRetailsContext db, int empId) { if (!BotGini.IsGiniRunning()) { Gini.Start(); } BotUser emp = db.TelegramAuthUsers.Where(c => c.EmployeeId == empId).Select(c => new BotUser { MobileNo = c.MobileNo, ChatId = c.TelegramChatId }).FirstOrDefault(); return(emp); }
public static BotUser GetEmp(AprajitaRetailsContext db, int staffId, bool IsStaffId) { if (!BotGini.IsGiniRunning()) { Gini.Start(); } string StaffName = db.Salesmen.Find(staffId).SalesmanName; BotUser emp = db.TelegramAuthUsers.Where(c => c.TelegramUserName == StaffName).Select(c => new BotUser { MobileNo = c.MobileNo, ChatId = c.TelegramChatId, StaffName = c.TelegramUserName }).FirstOrDefault(); if (emp == null) { emp = new BotUser { StaffName = StaffName }; } return(emp); }