protected void loadSLAandAlertDetails()
        {
            MainBusinessEntity mBEObj = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            TextBox_Alert_Email.Text           = mBEObj.getSupportEmail();
            TextBox_New_Defect_Email.Text      = mBEObj.getNewSupportEmailBody();
            TextBox_Resolved_Defect_Email.Text = mBEObj.getResolvedSupportEmailBody();

            ArrayList slaList = DefectSLA.getDefectSLADetailsbyentIdDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString(), DefectSLA.DEFECT_TYPE_DEFECT);

            if (slaList != null && slaList.Count > 0)
            {
                DataTable dt = new DataTable();
                dt.Columns.Add("Hidden_Type");
                dt.Columns.Add("sev");
                dt.Columns.Add("sla");
                dt.Columns.Add("alertBefore");

                for (int i = 0; i < slaList.Count; i++)
                {
                    DefectSLA slaObj = (DefectSLA)slaList[i];
                    dt.Rows.Add();
                    dt.Rows[i]["Hidden_Type"] = slaObj.getContext_Type();
                    dt.Rows[i]["sev"]         = slaObj.getSeverity();
                    dt.Rows[i]["sla"]         = slaObj.getSLA();
                    dt.Rows[i]["alertBefore"] = slaObj.getAlert_Before();
                }

                GridView1.DataSource = dt;
                GridView1.DataBind();
                GridView1.Visible = true;
                ViewState["WorkflowDefectSLA" + Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString()] = dt;
            }
        }
        protected void trySendEmail(String defId, String entId)
        {
            MainBusinessEntity          mBEObj           = MainBusinessEntity.getMainBusinessEntitybyIdwithLessDetailsDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());
            Dictionary <String, String> contactEmailList = (Dictionary <String, String>)ViewState["createDefectContactEmailList"];

            if (mBEObj.getSupportEmail() != null && !mBEObj.getSupportEmail().Equals("") && contactEmailList != null)
            {
                try
                {
                    ActionLibrary.Emails.sendEmail(
                        mBEObj.getSupportEmail(), mBEObj.getSupportEmailPass(),
                        contactEmailList[entId],
                        "Defect Logged with defect id#" + defId,
                        mBEObj.getNewSupportEmailBody());
                }
                catch (Exception ex)
                {
                }
            }
        }