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 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 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 List <OB> OrderVrNOList(string PtCode, string AppType) { GBCCon gbc_con = new GBCCon(); List <OB> list_ord = gbc_con.db_ob.Where(p => p.FromUserId == PtCode && p.AppType == AppType).OrderByDescending(p => p.VrDate).OrderByDescending(p => p.VrNo).ToList(); return(list_ord); }
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 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 PatientMaster GetPtData(string PtCode) { try { GBCCon con = new GBCCon(); PatientMaster obj = con.db_patient.SingleOrDefault(p => p.PtCode == PtCode); return(obj); } catch { return(null); } }
public List <Order1> Order1_history(string PtCode, string AppType, string PCode = "") { string SerPath; GBCCon gbc_con = new GBCCon(); List <OB> list_ord; if (PCode == "") { list_ord = gbc_con.db_ob.Where(p => p.FromUserId == PtCode && p.AppType == AppType).OrderByDescending(p => p.VrDate).ToList(); } else { list_ord = gbc_con.db_ob.Where(p => p.FromUserId == PtCode && p.AppType == AppType && p.ToUserId == PCode).OrderByDescending(p => p.VrDate).ToList(); } List <Order1> ord = new List <Order1>(); foreach (var item in list_ord) { Order1 obj_ord = new Order1(); obj_ord.NameP = gbc_con.db_patient.SingleOrDefault(p => p.PtCode == PtCode).PtName; SerPath = gbc_con.db_SerReg.SingleOrDefault(p => p.Pcode == item.ToUserId).ServicePath; obj_ord.pcode = gbc_con.db_SerReg.SingleOrDefault(p => p.Pcode == item.ToUserId).Name; obj_ord.TotalAmt = item.OrdAmt.ToString(); obj_ord.vrdate = Convert.ToDateTime(item.VrDate).ToString("dd/MM/yyyy"); obj_ord.vrno = item.VrNo; obj_ord.imgName = item.ImgName; List <ItemMaster> li_Oi = new List <ItemMaster>(); List <OI> OI = gbc_con.db_oi.Where(p => p.VrId == item.VrId).ToList(); foreach (var oi_item in OI) { try { ItemMaster obj_oi = new ItemMaster(); obj_oi.INAME = oi_item.IName; obj_oi.Qty = oi_item.OrdQty.ToString(); obj_oi.free = oi_item.FreeQty.ToString(); obj_oi.Rate = oi_item.Rate.ToString(); obj_oi.ICODE = oi_item.Value.ToString(); li_Oi.Add(obj_oi); } catch { } } obj_ord.items = li_Oi; obj_ord.status = GetStatus(obj_ord.vrno, SerPath); ord.Add(obj_ord); } ord = ord.OrderByDescending(p => p.vrdate).OrderByDescending(p => p.vrno).ToList(); return(ord); }
public HttpResponseMessage GetAreaList(string name) { GBCCon con = new GBCCon(); try { List <areamst> list_area = con.Db_area.Where(p => p.AreaName.StartsWith(name)).ToList(); return(Request.CreateResponse(HttpStatusCode.OK, list_area)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.NotFound, ex.Message)); } }
public HttpResponseMessage GetStateList(string name) { GBCCon con = new GBCCon(); try { List <statemaster> list_state = con.Db_state.Where(p => p.StName.StartsWith(name)).ToList(); return(Request.CreateResponse(HttpStatusCode.OK, list_state)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.NotFound, ex.Message)); } }
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 HttpResponseMessage GetCityList(string Stcode, string name) { GBCCon con = new GBCCon(); try { List <citymaster> list_city = con.Db_city.Where(p => p.CtCode.StartsWith(Stcode) && p.CtName.StartsWith(name)).ToList(); return(Request.CreateResponse(HttpStatusCode.OK, list_city)); } catch (Exception ex) { return(Request.CreateResponse(HttpStatusCode.NotFound, ex.Message)); } }
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 getDataFromRegCode(string code) { GBCCon gbc_con = new GBCCon(); List <PatientMaster> obj = gbc_con.db_patient.Where(p => p.PtCode == code).ToList(); if (obj.Count != 0) { PatientMaster o = obj.Take(1).SingleOrDefault(); return(o.PtName + "<|>" + o.Address + "<|>" + o.PtCode + "<|>" + o.PhNo); } else { return(""); } }
public string UpdatePtArea(string PtCode, string area) { try { GBCCon con = new GBCCon(); PatientMaster obj = con.db_patient.SingleOrDefault(p => p.PtCode == PtCode); obj.Area = area; con.SaveChanges(); return(""); } catch { return("$"); } }
public string FireUrl(string url, string mono, string msg, string AppType, string Pcode) { try { string data = "0"; string json = ""; json = ExecuteUrl(url); if (json.ToLower().Contains("successfully")) { data = "1"; } else { data = json; } GBCCon con = new GBCCon(); if (json == "") { try { string servicePath = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode).ServicePath; json = ExecuteUrl(servicePath + "/Values/ExecuteUrlSMS?url=" + url); if (json.ToLower().Contains("successfully")) { data = "1"; } else { data = json; } } catch { } } AppSMSStatus objSms = new AppSMSStatus(); objSms.MobileNo = mono; objSms.Msg = msg; objSms.Status = json; con.db_AppSms.Add(objSms); con.SaveChanges(); return(data); } 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 ServiceReg GetData(string Pcode) { try { ServiceReg obj; using (GBCCon con = new GBCCon()) { obj = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode); } return(obj); } catch { return(null); } }
public string GetSMSUrl(string mono, string msg, string AppType, string Pcode) { GBCCon con = new GBCCon(); string userId, senderName, passW; string servicePath = ""; userId = System.Configuration.ConfigurationManager.AppSettings["SMSUserName"].ToString(); senderName = System.Configuration.ConfigurationManager.AppSettings["SMSSendername"].ToString(); passW = System.Configuration.ConfigurationManager.AppSettings["SMSPass"].ToString(); string PartyUrl = ""; string url = "http://sms.goyalonline.in/SMS_API/sendsms.php?username=<<U>>&password=<<P>>&mobile=<<SNDTO>>&message=<<MSG>>&sendername=<<N>>&routetype=1"; if (AppType == "$") { try { servicePath = con.db_SerReg.SingleOrDefault(p => p.Pcode == Pcode).ServicePath; PartyUrl = ExecuteUrl(servicePath + "/Connection/GetSMSUrl?MSG=" + msg + "&PhNo=" + mono); } catch { PartyUrl = ""; } } if (PartyUrl != "") { if (PartyUrl.ToLower().Contains("successfully")) { AppSMSStatus objSms = new AppSMSStatus(); objSms.MobileNo = mono; objSms.Msg = msg; objSms.Status = "Sent"; con.db_AppSms.Add(objSms); con.SaveChanges(); return("1"); } else { //PartyUrl = PartyUrl.Substring(1, PartyUrl.Length - 1); //PartyUrl = PartyUrl.Remove(PartyUrl.Length - 1, 1); //url = PartyUrl; } } url = url.Replace("<<U>>", userId).Replace("<<P>>", passW).Replace("<<N>>", senderName).Replace("<<SNDTO>>", mono).Replace("<<MSG>>", msg); return(FireUrl(url, mono, msg, AppType, Pcode)); //return url; }
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 UpDateDeviceId(string PtCode, string DeviceId) { try { GBCCon con = new GBCCon(); PatientMaster obj = con.db_patient.SingleOrDefault(p => p.PtCode == PtCode); if (obj != null) { obj.DeviceId = DeviceId; } con.SaveChanges(); return(""); } catch { return("$"); } }
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 HttpResponseMessage Post() { if (!Request.Content.IsMimeMultipartContent()) { throw new HttpResponseException(HttpStatusCode.UnsupportedMediaType); } string fileSaveLocation = HttpContext.Current.Server.MapPath("~/VrImg"); //string fileSaveLocation = System.IO.Path.Combine(Directory.GetParent(Directory.GetParent(HttpContext.Current.Server.MapPath("")).FullName).FullName, "VrImg"); bool exists = System.IO.Directory.Exists(fileSaveLocation); if (!exists) { System.IO.Directory.CreateDirectory(fileSaveLocation); } CustomMultipartFormDataStreamProvider provider = new CustomMultipartFormDataStreamProvider(fileSaveLocation); List <string> files = new List <string>(); try { // Read all contents of multipart message into CustomMultipartFormDataStreamProvider. Request.Content.ReadAsMultipartAsync(provider); string name = ""; foreach (MultipartFileData file in provider.FileData) { files.Add(Path.GetFileName(file.LocalFileName)); name = file.LocalFileName; } if (name != "" && name.Contains(".")) { string vrno = Path.GetFileName(name).Split('.')[0]; GBCCon gbc_con = new GBCCon(); OB obj = gbc_con.db_ob.SingleOrDefault(p => p.VrId == vrno); obj.ImgName = Path.GetFileName(name); gbc_con.SaveChanges(); } return(Request.CreateResponse(HttpStatusCode.OK, files)); } catch (System.Exception e) { return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, e)); } }
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 CheckNo(string Mo) { try { using (GBCCon con = new GBCCon()) { List <PatientMaster> obj = con.db_patient.Where(p => p.PhNo == Mo).ToList(); if (obj.Count == 0) { return("OK"); } return("@"); } } catch (Exception ex) { return("$" + ex.Message + ex.InnerException.Message);; } }
public List <ServiceReg> GetActiveSupplier(string Pcode = "") { try { GBCCon con = new GBCCon(); List <ServiceReg> obj = null; if (Pcode == "") { obj = con.db_SerReg.Where(p => p.PType == "S" && p.IsDBConnected == true && p.IsActive == true && p.ServiceStatus == true).ToList(); } else { obj = con.db_SerReg.Where(p => p.Pcode == Pcode).ToList(); } return(obj); } catch { return(null); } }
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"); } }
public string UpdatePtData(string PtCode, string Ptname, string MoNo, string Email, string Add, string Stcode = "", string CtCode = "", string area = "", string DrName = "", string DrCode = "") { try { GBCCon con = new GBCCon(); PatientMaster obj = con.db_patient.SingleOrDefault(p => p.PtCode == PtCode); obj.PtName = Ptname; obj.PhNo = MoNo; obj.Email = Email; obj.Address = Add; obj.StCode = Stcode; obj.CtCode = CtCode; obj.Area = area; obj.FDocCode = DrCode; obj.FDocName = DrName; con.SaveChanges(); return(""); } catch { return("$"); } }