public static void BindSubobjvalues(DropDownList ddlfee, string pid) { int revobjid = 1; using (Person_Details.Person_LicenseDataContext ldb = new Person_Details.Person_LicenseDataContext()) { tbl_PersonDetail per = ldb.tbl_PersonDetails.Where(c => c.Person_ID == Convert.ToInt32(pid)).SingleOrDefault(); if (per.object_type != 1) { revobjid = 2; } } if (revobjid == 1) { ddlfee.DataSource = Person_Details.Licensing_Details.Get_subobjValues().Where(c => c.Rev_obj_Id == 1); } else { ddlfee.DataSource = Person_Details.Licensing_Details.Get_subobjValues().Where(c => c.Rev_obj_Id == 2); } ddlfee.DataValueField = "Subobj_Id"; ddlfee.DataTextField = "Description"; ddlfee.DataBind(); ddlfee.Items.Insert(0, new ListItem("Select Fee Type", "-1")); }
protected void GetComplaintNumber() { using (ComplaintsTabLinq.ComplaintsTabDataContext cdc = new ComplaintsTabLinq.ComplaintsTabDataContext()) { string cmpnumber = ""; string respondent = ""; ComplaintsTabLinq.TbL_Complaint cmp = cdc.TbL_Complaints.OrderByDescending(c => c.Complaint_ID).First(); cmpnumber = cmp.Complaint_Number; using (Person_Details.Person_LicenseDataContext plc = new Person_Details.Person_LicenseDataContext()) { Person_Details.tbl_PersonDetail obj = new Person_Details.tbl_PersonDetail(); obj = plc.tbl_PersonDetails.Where(c => c.Person_ID == cmp.Respondent_ID).SingleOrDefault(); if (obj.object_type != 1) { respondent = obj.Business; } else { respondent = obj.First_Name + ' ' + obj.Middle_Name + ' ' + obj.Last_Name; } } if (ddl_source.SelectedValue == "1257" || ddl_source.SelectedValue == "1038" || ddl_source.SelectedValue == "1039" || ddl_source.SelectedValue == "1040" || ddl_source.SelectedValue == "1041" || ddl_source.SelectedValue == "1259" || ddl_source.SelectedValue == "1417" || ddl_source.SelectedValue == "1419") { Mail.SendMail("", System.Configuration.ConfigurationManager.AppSettings["cmpcreated"].ToString(), "", "Case Created ", "A case has been created with the number : " + cmpnumber + "<br/><br/>Respondent : " + respondent); } else { Mail.SendMail("", System.Configuration.ConfigurationManager.AppSettings["cmpcreated1"].ToString(), "", "Case Created ", "A case has been created with the number : " + cmpnumber + "<br/><br/>Respondent : " + respondent); } } }
protected void btnsubmit_Click(object sender, EventArgs e) { try { hfdpid.Value = Request.QueryString[0].ToString(); int contacttype = Convert.ToInt32(ddlcontacttype.SelectedValue); var query = Utilities_Licensing.GetPersonandBusiness(hfdrelid.Value, contacttype); var queryforstatus = Utilities_Licensing.GetPersonandBusinessLicense(hfdrelid.Value); string Name = ""; string address = ""; string email = ""; string licensestatus = "-1"; if (queryforstatus.Count > 0) { if (queryforstatus[0].licstatus != null) { licensestatus = queryforstatus[0].licstatus; } } if (query.Count > 0 && (contacttype == 3 || contacttype == 5)) { string business = query[0].busin; string licno = query[0].licno; string contact = ddlcontacttype.SelectedValue; string comments = txtcomment.Text; string js = "Confirmation('" + business.Replace("'", "`") + "','" + licno + "','" + contact + "','" + comments + "');"; ScriptManager.RegisterStartupScript(Page, GetType(), "scr", js, true); } else { if (contacttype == 3 && licensestatus == "808") { string contact = ddlcontacttype.SelectedValue; string comments = txtcomment.Text; string js = "Warning('" + contact + "','" + comments + "');"; ScriptManager.RegisterStartupScript(Page, GetType(), "scr", js, true); } else { Person_Details.Licensing_Details.Insert_ContactDetails(Convert.ToInt32(hfdcontactid.Value), hfdpid.Value, Convert.ToInt32(ddlcontacttype.SelectedValue), hfdrelid.Value, txtcomment.Text.ToString(), "Current", DateTime.Now.ToShortDateString(), "", Session["UID"].ToString(), Session["UID"].ToString(), txt_percentage.Text); altbox("Record inserted successfully."); Clear(); } } if (contacttype == 3) { using (Person_Details.Person_LicenseDataContext plc = new Person_Details.Person_LicenseDataContext()) { Person_Details.tbl_PersonDetail obj = new Person_Details.tbl_PersonDetail(); obj = plc.tbl_PersonDetails.Where(c => c.Person_ID == Convert.ToInt32(hfdrelid.Value)).SingleOrDefault(); //if (obj.object_type != 1) // Name = obj.Business; //else // Name = obj.First_Name + ' ' + obj.Middle_Name + ' ' + obj.Last_Name; //address = obj.Address1; email = obj.Email; Person_Details.tbl_PersonDetail objq = new Person_Details.tbl_PersonDetail(); objq = plc.tbl_PersonDetails.Where(c => c.Person_ID == Convert.ToInt32(hfdpid.Value)).SingleOrDefault(); if (objq.object_type != 1) { Name = objq.Business; } else { Name = objq.First_Name + ' ' + objq.Middle_Name + ' ' + objq.Last_Name; } address = objq.Address1; } DataTable dt = new DataTable(); dt = Utilities_Licensing.GetNameandLicNumber(Convert.ToInt32(hfdpid.Value)); string st = @"<table cellspacing='0' > <tr> <td style='text-align:left;' colspan='3'><b>This email is to alert you that you have been identified as the supervising pharmacist of this pharmacy:</b><br/><br/></td> </tr> <tr> <td style='text-align: left;width:130px'><b>Pharmacy Name:</b></td><td style='text-align:middle;'>" + Name + "</td></tr><tr><td style='text-align:left;width:130px'><b>Pharmacy Address:</b></td><td style='text-align:middle;'>" + address + "</td>"; //if (dt.Rows[0]["object_type"].ToString() == "1") // st = st + @"</tr><tr><td style='text-align:left;width:130px'><b>Respondent :</b></td><td style='text-align:middle;'>" + Convert.ToInt32(hfdpid.Value) + "' target='_blank' >" + Name + "</a></td></tr>"; //else // st = st + @"</tr><tr><td style='text-align:left;width:130px'><b>Respondent :</b></td><td style='text-align:middle;'>" + Convert.ToInt32(hfdpid.Value) + "' target='_blank' >" + Name + "</a></td></tr>"; foreach (DataRow dr in dt.Rows) { st = st + @"<tr> <td style='text-align: left;width:130px'><b>License Type :</b></td> <td style='text-align:middle;'>" + dr["License_Type"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align:left;width:130px'><b>License Status :</b></td> <td style='text-align:middle;'>" + dr["LicenseStatus"].ToString() + "</td></tr>"; st = st + @"<tr> <td style='text-align:left;width:130px'><b>License # :</b></td> <td style='text-align:middle;'>" + dr["Lic_no"].ToString() + "</td></tr>"; } st = st + @"<tr style='margin-top:10px;'> <td style='text-align:left;' colspan='3'></b><br/><br/><b>If you believe this is in error, please email [email protected] </td> </tr>"; st = st + "</table>"; if (email != null && email != "") { Mail.SendMail("", email, "", "Supervising Pharmacist", st); } } } catch (Exception ex) { Response.Write(ex.ToString()); } }