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);
                }
            }
        }
Exemplo n.º 2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                hfdpid.Value = Request.QueryString[0].ToString();
                Person_Details.tbl_PersonDetail objtype = Person_Details.Licensing_Details.get_PersonsData(Convert.ToInt32(hfdpid.Value));
                hfdobjtype.Value = objtype.object_type.ToString();
                if (hfdobjtype.Value == "1")
                {
                    haspharmacy.Attributes.Add("style", "display:none");
                }
                else
                {
                    employee.Attributes.Add("style", "display:none");
                    supervisor.Attributes.Add("style", "display:none");
                    //exam.Attributes.Add("style", "display:none");
                    outofstate.Attributes.Add("style", "display:none");
                    otherstate.Attributes.Add("style", "display:none");
                }
                Utilities_Licensing.BindDropdown(ddlstate, 9);
                Utilities_Licensing.BindDropdown(ddlcounty, 10);

                btnadd.Attributes.Add("onClick", "return open_edit(" + hfdpid.Value + ");");
                btnaddemployer.Attributes.Add("onClick", "return Open_employer(" + hfdpid.Value + ");");
                //Utilities_Licensing.BindGridEmployer(grdemployee, Convert.ToInt32(hfdpid.Value));
            }
        }
Exemplo n.º 3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         hfdperid.Value = Request.QueryString[0].ToString();
         Utilities_Licensing.BindDropdown(ddl_status1, 53);
         Utilities_Licensing.BindDropdown(ddlnewappstatus, 24);
         Utilities_Licensing.BindDropdown(ddlappreason, 28);
         Utilities_Licensing.BindDropdown(ddlmailorderstatus, 53);
         Utilities_Licensing.BindCheckboxlist1(chkschedules, 68);
         Utilities_Licensing.Bind_LicenseTypes_Business(ddl_buslictypes);
         Utilities_Licensing.BindLicType(ddllictype, Convert.ToInt32(hfdperid.Value));
         Utilities_Licensing.BindLicType(ddl_licensetype, Convert.ToInt32(hfdperid.Value));
         Utilities_Licensing.BindLicType(ddl_schedulelicensetype, Convert.ToInt32(hfdperid.Value));
         Person_Details.tbl_PersonDetail objtype = Person_Details.Licensing_Details.get_PersonsData(Convert.ToInt32(hfdperid.Value));
         hfdobjtype.Value = objtype.object_type.ToString();
         //if(hfdobjtype.Value=="1")
         //mailorder.Attributes.Add("style","display:none");
         Utilities_Licensing.BindDropdown(ddlnewstatus, 14);
         txtDateOfChange.Text = DateTime.Now.ToShortDateString();
         txtappdt.Text        = DateTime.Now.ToShortDateString();
         Utilities_Licensing.BindStatusChange(ddlReason);
         ddlcmp.DataSource     = ComplaintsTabLinq.ClsComplaints.GetComplaints("0", Convert.ToInt32(hfdperid.Value));
         ddlcmp.DataTextField  = "Complaint_Number";
         ddlcmp.DataValueField = "Complaint_Number";
         ddlcmp.DataBind();
         ddlcmp.Items.Insert(0, new ListItem("", ""));
         //BindLicenseData();
         Utilities_Licensing.BindLicenseTypeByPersonID(chklictypes, Convert.ToInt32(hfdperid.Value));
         foreach (ListItem li in chklictypes.Items)
         {
             li.Attributes.Add("App_ID", li.Value);
         }
     }
 }
        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());
            }
        }