public string UpdateFromStartServicePath(string Pcode, string ServicePath, string ServiceStatus = "") { try { using (GBCCon con = new GBCCon()) { ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode); if (obj != null) { obj.ServicePath = ServicePath; obj.ServiceStatus = Convert.ToBoolean(ServiceStatus); con.SaveChanges(); return("1"); } else { return("0"); } } } catch { return("0"); } }
public string UpdateFromStartService(string Pcode, string ServicePath, string InetAddress, string Port, string MCAddress, string Database, string ServerName, string Auth, string userId, string Pass) { string Val = "0"; try { using (GBCCon con = new GBCCon()) { ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode); obj.ServicePath = ServicePath; obj.InetAddress = InetAddress; obj.Port = Port; obj.MCAddress = MCAddress; obj.ServiceLastActiveDate = DateTime.Now; obj.SqlServerAuth = (Auth == "1") ? true : false; obj.SqlPassword = Pass; obj.SqlUserId = userId; obj.DataBaseName = Database; obj.SqlServerName = ServerName; obj.ServiceStatus = true; obj.IsDBConnected = true; con.SaveChanges(); Val = "1"; } } catch { Val = "0"; } string PingVal = PingGBCService(Pcode); return(Val + "/" + PingVal); }
public string CheckPatient(string PtCode) { try { GBCCon con = new GBCCon(); PatientMaster obj_C = con.db_patient.SingleOrDefault(p => p.PtCode == PtCode); if (obj_C == null) { return("0"); } else { ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == obj_C.PCODE); if (obj == null) { return(obj_C.ServicePath + "|" + "" + "|" + "" + "|" + obj_C.PtName + "|" + obj_C.PtCode + "|" + obj_C.PhNo + "|" + obj_C.Email + "|" + obj_C.Address + "|" + obj_C.DeviceId + "|" + obj_C.StCode + "|" + obj_C.CtCode + "|" + obj_C.Area + "|" + obj_C.FDocName + "|" + obj_C.FDocCode); } else { return(obj_C.ServicePath + "|" + obj.Name + "|" + obj.Pcode + "|" + obj_C.PtName + "|" + obj_C.PtCode + "|" + obj_C.PhNo + "|" + obj_C.Email + "|" + obj_C.Address + "|" + obj_C.DeviceId + "|" + obj_C.StCode + "|" + obj_C.CtCode + "|" + obj_C.Area + "|" + obj_C.FDocName + "|" + obj_C.FDocCode); } } } catch (Exception ex) { return("$" + ex.Message); } }
public string PingGBCService(string PCode) { GBCCon con = new GBCCon(); ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == PCode); string ServicePath = "", Pingurl = ""; if (obj != null) { ServicePath = obj.ServicePath; Pingurl = ExecuteUrl(ServicePath + "/Connection/Ping"); if (Pingurl != "") { obj.ServiceStatus = true; Pingurl = "1"; } else { obj.ServiceStatus = false; Pingurl = "0"; } } else { obj.ServiceStatus = false; Pingurl = "0"; } con.SaveChanges(); return(Pingurl); }
public string UpdatePartyInfo(string Pcode, string ServicePath, string InetAddress, string Port, string MCAddress, DateTime?ServiceLastActiveDate, string Database, string ServerName, string Auth, string userId, string Pass) { try { using (GBCCon con = new GBCCon()) { ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode); obj.ServicePath = ServicePath; obj.InetAddress = InetAddress; obj.Port = Port; obj.MCAddress = MCAddress; obj.ServiceLastActiveDate = DateTime.Now; obj.SqlServerAuth = (Auth == "1") ? true : false; obj.SqlPassword = Pass; obj.SqlUserId = userId; obj.DataBaseName = Database; obj.SqlServerName = ServerName; con.SaveChanges(); return("1"); } } catch { return("0"); } }
public ServiceReg CheckPcode(string pcode) { using (GBCCon con = new GBCCon()) { DateTime date = DateTime.Now.Date; ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == pcode); return(obj); } }
public string getPretailOrdQty(string PCode) { GBCCon gbc_con = new GBCCon(); ServiceReg obj = gbc_con.db_SerReg.SingleOrDefault(p => p.Pcode == PCode); if (obj != null) { return(obj.pretailordQty); } else { return("0"); } }
public string checkparty(string PtCode) { try { GBCDbConn con = new GBCDbConn(); ACPMST obj1 = con.Db_acpmst.SingleOrDefault(p => p.PCODE == PtCode); ACPMST_temp obj_C = con.ACPMST_temp.SingleOrDefault(p => p.PtCode == PtCode); if (obj1 == null) { if (obj_C == null) { return("0"); } else { GBCCon con1 = new GBCCon(); ServiceReg obj = con1.db_SerReg.SingleOrDefault(p => p.Pcode == obj_C.PCODE); if (obj == null) { return(obj_C.ServicePath + "|" + "" + "|" + "" + "|" + obj_C.PtName + "|" + obj_C.PtCode + "|" + obj_C.PhNo + "|" + obj_C.Email + "|" + obj_C.Address + "|" + obj_C.DeviceId + "|" + obj_C.StCode + "|" + obj_C.CtCode + "|" + obj_C.Area + "|" + "|" + obj_C.PREPTCODE + "|"); } else { return(obj_C.ServicePath + "|" + obj.Name + "|" + obj.Pcode + "|" + obj_C.PtName + "|" + obj_C.PtCode + "|" + obj_C.PhNo + "|" + obj_C.Email + "|" + obj_C.Address + "|" + obj_C.DeviceId + "|" + obj_C.StCode + "|" + obj_C.CtCode + "|" + obj_C.Area + "|" + "|" + obj_C.PREPTCODE + "|"); } } } else { GBCCon con1 = new GBCCon(); ServiceReg obj = con1.db_SerReg.SingleOrDefault(p => p.Pcode == obj_C.PCODE); if (obj == null) { return(obj_C.ServicePath + "|" + "" + "|" + "" + "|" + obj_C.PtName + "|" + obj1.PCODE + "|" + obj_C.PhNo + "|" + obj_C.Email + "|" + obj_C.Address + "|" + obj_C.DeviceId + "|" + obj_C.StCode + "|" + obj_C.CtCode + "|" + obj_C.Area + "|" + "|" + "|" + obj_C.PREPTCODE + "|"); } else { return(obj_C.ServicePath + "|" + obj.Name + "|" + obj.Pcode + "|" + obj_C.PtName + "|" + obj1.PCODE + "|" + obj_C.PhNo + "|" + obj_C.Email + "|" + obj_C.Address + "|" + obj_C.DeviceId + "|" + obj_C.StCode + "|" + obj_C.CtCode + "|" + obj_C.Area + "|" + "|" + "|" + obj_C.PREPTCODE + "|"); //return obj_C.ServicePath + "|" + obj.Name + "|" + obj.Pcode + "|" + obj1.ConsumerMob + "|"; } } } catch (Exception ex) { return("$" + ex.Message); } }
public string StartService(string pcode) { GBCCon con = new GBCCon(); ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == pcode); try { obj.ServiceStatus = true; con.SaveChanges(); return("1"); } catch { return("0"); } }
public string UpdateDataBaseConnecton(string Pcode, bool status) { try { using (GBCCon con = new GBCCon()) { ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode); obj.IsDBConnected = status; con.SaveChanges(); return("1"); } } catch { return("0"); } }
public string UpdatePartyInfoFromApp(string Pcode) { try { using (GBCCon con = new GBCCon()) { ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode); obj.PingCount = String.IsNullOrEmpty(obj.PingCount.ToString()) ? 1 : obj.PingCount + 1; obj.AppLastActiveDate = DateTime.Now; con.SaveChanges(); return("1"); } } catch { return("0"); } }
public string UpdateCustomer(string PCode, string ClientCode) { try { GBCCon con = new GBCCon(); ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == PCode); PatientMaster obj_C = con.db_patient.SingleOrDefault(p => p.PtCode == ClientCode); obj_C.ServicePath = obj.ServicePath; obj_C.PCODE = PCode; con.SaveChanges(); string str = obj.ServicePath + "|" + obj.Name + "|" + obj.Pcode + "|" + obj_C.PtName + "|" + obj_C.PtCode + "|" + obj_C.PhNo + "|" + obj_C.Email + "|" + obj_C.Address + "| " + "|" + obj_C.StCode + "|" + obj_C.CtCode + "|" + obj_C.Area; return(str); } catch (Exception ex) { return("$ " + ex.Message + " " + ex.InnerException.Message); } }
public string GetSuppAppUserData(string pcode) { try { using (GBCCon con = new GBCCon()) { ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == pcode); if (obj != null) { return(obj.Name + "<|>" + obj.MobileNo + "<|>" + obj.EmailID + "<|>" + obj.Address + "<|>" + obj.ServiceStatus + "<|>" + obj.InetAddress); } } return(""); } catch { return(""); } }
public string GetDataBaseConnecton(string Pcode) { try { using (GBCCon con = new GBCCon()) { ServiceReg obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode); if (Convert.ToBoolean(obj.IsDBConnected)) { return("1"); } else { return("0"); } } } catch { return("0"); } }