protected void btnschedulesubmit_Click(object sender, EventArgs e) { using (Person_Details.Person_LicenseDataContext pldc = new Person_LicenseDataContext()) { string schedule = ""; tbl_Application app = pldc.tbl_Applications.Where(c => c.App_ID == Convert.ToInt32(ddl_schedulelicensetype.SelectedValue)).FirstOrDefault(); for (int i = 0; i <= chkschedules.Items.Count - 1; i++) { if (chkschedules.Items[i].Selected) { if (schedule == "") { schedule = chkschedules.Items[i].Text; } else { schedule += "," + chkschedules.Items[i].Text; } } } app.Schedule = schedule; pldc.SubmitChanges(); altbox("Record inserted successfully."); } }
protected void btn_submit_Click(object sender, EventArgs e) { string filename = ""; string docpath = ""; string licensename = ""; string licno = ""; using (Person_Details.Person_LicenseDataContext pldc = new Person_LicenseDataContext()) { tbl_PersonDetail obj = new tbl_PersonDetail(); obj = pldc.tbl_PersonDetails.Where(c => c.Person_ID == Convert.ToInt32(hfdperid.Value)).SingleOrDefault(); licensename = obj.First_Name + ' ' + obj.Middle_Name + ' ' + obj.Last_Name; tbl_license lic = pldc.tbl_licenses.Where(c => c.Person_ID == Convert.ToInt32(hfdperid.Value)).FirstOrDefault(); if (lic != null) { tbl_license lic1 = pldc.tbl_licenses.Where(c => c.Person_ID == Convert.ToInt32(hfdperid.Value)).OrderByDescending(c => c.License_ID).First(); licno = lic1.Lic_no; } } JavaScriptSerializer js = new JavaScriptSerializer(); var docdata = js.Deserialize <List <string> >(hfddocument.Value); foreach (string t in docdata) { string[] fdata = t.Split('~'); string url = System.Configuration.ConfigurationManager.AppSettings["lmsdoclink"].ToString() + DateTime.Now.Year.ToString() + "/" + DateTime.Now.Month.ToString() + "/" + fdata[0]; int docid = Person_Details.Licensing_Details.InsertWellnessDocument(Convert.ToInt32(hfddocid.Value), hfdperid.Value, ddl_doctype.SelectedValue, url, fdata[1], txtdoccomments.Text, Session["UID"].ToString(), Convert.ToDateTime(DateTime.Now.ToShortDateString())); } altbox("Record inserted successfully."); Clear(); }
public string Webstats() { using (Person_LicenseDataContext pdc = new Person_LicenseDataContext()) { return(Jsonhelper(pdc.AlbopWebsitestats().ToList())); } }
public static void DeleteFile(int docid) { using (Person_LicenseDataContext plc = new Person_LicenseDataContext()) { Person_Details.TblDisciplinaryFinding obj = plc.TblDisciplinaryFindings.Where(c => c.DisciplinaryFindingsID == docid).SingleOrDefault(); plc.TblDisciplinaryFindings.DeleteOnSubmit(obj); plc.SubmitChanges(); } }
protected void Page_Load(object sender, EventArgs e) { using (Person_LicenseDataContext db = new Person_LicenseDataContext()) { JavaScriptSerializer json = new JavaScriptSerializer(); Response.Clear(); Response.ContentType = "application/json;charset=utf-8"; Response.Write(json.Serialize(db.AlbopWebsitestats().ToList())); Response.End(); } }
protected void btndeleteemp_Click(object sender, EventArgs e) { using (Person_LicenseDataContext pldc = new Person_LicenseDataContext()) { tbl_has_pharmacyemp obj = pldc.tbl_has_pharmacyemps.Where(c => c.has_emp_id == Convert.ToInt32(hfdselid.Value)).SingleOrDefault(); pldc.tbl_has_pharmacyemps.DeleteOnSubmit(obj); pldc.SubmitChanges(); altbox("Record deleted successfully."); hfdselid.Value = "0"; } }
public static void BindPrintpages(DropDownList ddlprintpages) { using (Person_Details.Person_LicenseDataContext pldc = new Person_LicenseDataContext()) { ddlprintpages.DataSource = (from ac in pldc.tbl_lkp_Licenses join pl in pldc.tbl_Auto_Datas on ac.LicenseType_ID equals pl.LicenseType_ID select new { ac.LicenseType_ID, pl.Print_ID }).ToList(); ddlprintpages.DataValueField = "LicenseType_ID"; ddlprintpages.DataTextField = "Print_ID"; ddlprintpages.DataBind(); } }
public static void Update_Haspharmacystatus(int hasid, string uid) { using (Person_LicenseDataContext pd = new Person_LicenseDataContext()) { var query = from ac in pd.tbl_has_pharmacyemps where ac.has_emp_id == hasid select ac; foreach (tbl_has_pharmacyemp ac in query) { ac.Status = "Previous"; ac.Modifiedby = uid; ac.Modifieddt = Convert.ToDateTime(DateTime.Now.ToShortDateString()); } pd.SubmitChanges(); } }
public static List <BusinessName> GetPersonandBusinessLicense(string relationid) { using (Person_LicenseDataContext pdb = new Person_LicenseDataContext()) { var licensestatus = from person in pdb.tbl_PersonDetails join license in pdb.tbl_licenses on person.Person_ID equals license.Person_ID where license.Person_ID == Convert.ToInt32(relationid) select new BusinessName() { licstatus = license.Lic_status }; return(licensestatus.ToList()); } }
public static List <ChecklistPending> Get_checklistitems(int app_id) { using (Person_LicenseDataContext db = new Person_LicenseDataContext()) { var resuts = from ac in db.TBL_Licensing_Application_Checklists join lchk in db.tbl_lkp_LicenseCheckLists on Convert.ToInt32(ac.License_checklist_ID) equals lchk.License_CheckList_ID join chk in db.tbl_lkp_datas on Convert.ToInt32(lchk.CheckList_ID) equals chk.Lkp_data_ID where ac.App_ID == app_id select new ChecklistPending() { app_chk_id = ac.App_checklist_ID, License_checklist_id = Convert.ToInt32(ac.License_checklist_ID), Checklistitem = chk.Values, Isrequired = lchk.Is_Mandatory, Result = ac.Result }; return(resuts.ToList()); } }
public static void Update_ContactStatus(int contactid) { using (Person_LicenseDataContext pd = new Person_LicenseDataContext()) { var query = from ac in pd.tbl_Person_contacts where ac.contact_id == contactid select ac; foreach (tbl_Person_contact ac in query) { ac.Status = "Terminated"; ac.End_dt = DateTime.Now; ac.Modifiedby = HttpContext.Current.Session["UID"].ToString(); ac.Modifieddt = Convert.ToDateTime(DateTime.Now.ToShortDateString()); } pd.SubmitChanges(); } }
public static void update_checkitems(int applicchkid, int appid, string licensechecklistid, string result) { using (Person_LicenseDataContext db = new Person_LicenseDataContext()) { var query = from ac in db.TBL_Licensing_Application_Checklists where ac.App_checklist_ID == applicchkid select ac; foreach (TBL_Licensing_Application_Checklist ac in query) { ac.App_ID = appid; ac.License_checklist_ID = Convert.ToInt32(licensechecklistid); ac.Result = result; ac.Change_Date = Convert.ToDateTime(DateTime.Now.ToShortDateString()); } db.SubmitChanges(); } }
public static List <BusinessName> GetPersonandBusiness(string relationid, int contacttype) { using (Person_LicenseDataContext pdb = new Person_LicenseDataContext()) { var name = from person in pdb.tbl_PersonDetails join license in pdb.tbl_licenses on person.Person_ID equals license.Person_ID join contact in pdb.tbl_Person_contacts on person.Person_ID equals Convert.ToInt32(contact.Person_Id) where contact.Relt_id == relationid && contact.Contact_type == contacttype && contact.Status == "Current" select new BusinessName() { busin = person.Business, licno = license.Lic_no }; return(name.ToList()); } }
public static List <Pending_application> getpendingapplications(int pid) { using (Person_LicenseDataContext db = new Person_LicenseDataContext()) { return((from app in db.tbl_Applications join lc in db.tbl_lkp_Licenses on Convert.ToInt32(app.License_Type_ID) equals lc.LicenseType_ID where app.Person_ID == pid && app.App_Status == "511" select new Pending_application() { License_Type = lc.License_Type, App_ID = app.App_ID }).ToList()); // return db.tbl_Applications.Where(c => c.Person_ID == pid && c.App_Status == "511").ToList(); } }
protected void btnsubmitall_Click(object sender, EventArgs e) { string licensename = ""; string licno = ""; using (Person_Details.Person_LicenseDataContext pldc = new Person_LicenseDataContext()) { tbl_PersonDetail obj = new tbl_PersonDetail(); obj = pldc.tbl_PersonDetails.Where(c => c.Person_ID == Convert.ToInt32(hfdperid.Value)).SingleOrDefault(); licensename = obj.First_Name + ' ' + obj.Middle_Name + ' ' + obj.Last_Name; tbl_license lic = pldc.tbl_licenses.Where(c => c.Person_ID == Convert.ToInt32(hfdperid.Value)).FirstOrDefault(); if (lic != null) { tbl_license lic1 = pldc.tbl_licenses.Where(c => c.Person_ID == Convert.ToInt32(hfdperid.Value)).OrderByDescending(c => c.License_ID).First(); licno = lic1.Lic_no; } var query = pldc.tbl_Person_wellness_Documents.Where(c => c.Person_ID == hfdperid.Value).ToList(); if (query.Count != 0) { foreach (tbl_Person_wellness_Document ac in query) { ac.AllDocumentsReceived = chkalldocumentsreceived.Checked; ac.Modified_By = Session["UID"].ToString(); ac.Modified_Date = Convert.ToDateTime(DateTime.Now.ToShortDateString()); } pldc.SubmitChanges(); if (chkalldocumentsreceived.Checked) { Mail.SendMail("", "[email protected];[email protected];[email protected];[email protected];[email protected]", "", "Wellness Docs Marked Complete", "Name : " + licensename + "</br>License #: : " + licno); } } else { string js = " altbox('No documents found.');"; ScriptManager.RegisterStartupScript(Page, GetType(), "scr", js, true); chkalldocumentsreceived.Checked = false; } } }