public static void Update(int GrpId, string GrpName, string Address1, string Address2,
                                    string City, int StateId,/*int Zipcode,*/ int CountryId)
        {
            AccreditationDataContext objDB = new AccreditationDataContext();
            objDB.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            //string report = null;
            try
            {
                LINQ.TblGroupCreation grp = objDB.TblGroupCreations.First(D => D.GrpId == GrpId);
                grp.GrpName = GrpName;
                grp.Address1 = Address1;
                grp.Address2 = Address2;
                grp.City = City;
                grp.StateId = StateId;
                // grp.Zipcode = Zipcode;
                grp.CountryId = CountryId;

                objDB.SubmitChanges();
                // report = BLL.Constants.Update;
            }
            catch (Exception ex)
            {
                //  report = BLL.Constants.NotUpdated;
            }

            //  return report;
        }
        protected void btn_Submit_Click(object sender, EventArgs e)
        {
            AccreditationDataContext objDb = new AccreditationDataContext();
            objDb.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            //LINQ.User client = objDb.Users.Where(D => D.UserName == txtUserName.Text).Single();
            var user = objDb.TblUserRegistrations.Where(D => D.UserEmail == Querystring.Trim()).FirstOrDefault();
            if (txtnewPassword.Text == txtconfirmmpass.Text)
            {
                if (user.TempPass == txttempass.Text)
                {
                    user.TempPass = "";
                    user.HashPass = DbConnection.GetHash(txtnewPassword.Text);
                    user.Active = true;
                    objDb.SubmitChanges();
                    Response.Redirect("Login.aspx");
                    return;
                }
                else
                {
                    lbFailureText.Text = "Wrong temporary password";

                }

            }
            else
            {

                lbFailureText.Text = "Please confirm password does not match";
            }
        }
Пример #3
0
 /// <summary>
 /// Populating all faculty in DropDownList
 /// </summary>
 /// <param name="facultyDropDownListId"></param>
 /// <returns></returns>
 public static IEnumerable<LINQ.Faculty> PopulateFacultyInDropDown()
 {
     AccreditationDataContext objDB = new AccreditationDataContext();
     IEnumerable<LINQ.Faculty> objFaculty = (from faculty in objDB.Faculties
                                             select faculty);
     return objFaculty;
 }
Пример #4
0
        public void Delete(int intDelSubPonena)
        {
            bool boolMess = false;
            try
            {
                AccreditationDataContext objDb = new AccreditationDataContext();
                objDb.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];

                LINQ.TblSubpoenaFrm gc = objDb.TblSubpoenaFrms.Where(D => D.SubpoenaFrmId == intDelSubPonena).Single();
                gc.Active = false;

                objDb.SubmitChanges();

                boolMess = true;
                // Console.WriteLine("ok");
                // Response.Redirect("GroupList.aspx");
            }
            catch (Exception ex)
            {
                boolMess = false;
            }

            return;
            // return boolMess;
        }
 public static bool IsExistEmail(string Email, int editid)
 {
     AccreditationDataContext db = new AccreditationDataContext();
     db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
     if (editid > 0 && db.TblUserRegistrations.Where(d => d.UserEmail == Email).Count() == 1)
     {
         return true;
     }
     return db.TblUserRegistrations.Where(d => d.UserEmail == Email).Any();
 }
        public static bool IsExistGroup(string GroupName, int editid)
        {
            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            if (editid > 0 && db.TblGroupCreations.Where(d => d.GrpName == GroupName).Count() == 1)
            {
                return true;
            }

            return db.TblGroupCreations.Where(d => d.GrpName == GroupName).Any();
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            if (hdneditId.Value != null && hdneditId.Value != "" && int.Parse(hdneditId.Value.ToString()) > 0)
                {
                    AccreditationDataContext objDB = new AccreditationDataContext();
                    objDB.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
                    using (AccreditationDataContext group = new AccreditationDataContext())
                    {
                        LINQ.TblPasswordChange grp = objDB.TblPasswordChanges.First(D => D.PasswordChangeId == int.Parse(hdneditId.Value.ToString()));

                        grp.EmailAddress = txtEmail.Text.Trim();
                        grp.TempPassword = txtTempPassword.Text.Trim();
                        grp.NewPassword = txtNewPassword.Text.Trim();
                        grp.RetypePassword = txtRetypPassword.Text.Trim();

                        grp.Active = true;
                        objDB.SubmitChanges();

                    }
                }else{

                    if (!IsExistEmail(txtEmail.Text.Trim()))
                    {
                        if (string.Compare(txtNewPassword.Text.Trim(), txtRetypPassword.Text.Trim()).Equals(0))
                        {
                            using (AccreditationDataContext passwordchange = new AccreditationDataContext())
                            {
                                TblPasswordChange passwordchange1 = new TblPasswordChange
                                {
                                    EmailAddress = txtEmail.Text.Trim(),
                                    TempPassword = txtTempPassword.Text.Trim(),
                                    NewPassword = txtNewPassword.Text.Trim(),
                                    RetypePassword = txtRetypPassword.Text.Trim(),
                                };
                                passwordchange.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
                                passwordchange.TblPasswordChanges.InsertOnSubmit(passwordchange1);
                                passwordchange.SubmitChanges();

                                // Utilities.CreateMessageLabel(this, BLL.Constants.Insert, true);
                            }
                        }

                    }
                }

                Response.Redirect("PasswordList.aspx");
                return;
        }
Пример #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["GroupId"] == null || Session["UserEmail"] == null)
            {
                Response.Redirect("../Login.aspx");
            }

            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var stsubpoeanrs =
                from c in db.TblSubpoenaFrms
                where c.DetectiveId == CurrentUser.UserId
                select new { title = c.CaseId +'#' +(c.SubpoenaName != null ? c.SubpoenaName : "") + '#' + c.OfficialName +'#', start = (c.Date), end = (c.Date), allDay = false, url = "", className = ("fc-event-skin-green") };

             eventlist = JsonConvert.SerializeObject(stsubpoeanrs.Distinct(), Formatting.Indented);
        }
Пример #9
0
 public static void AddExternalGroupMap(List<LINQ.ExternalGroupMap> externalGroupMapcollection)
 {
     AccreditationDataContext objdb = new AccreditationDataContext();
     IEnumerable<LINQ.ExternalGroupMap> externalGroups = (from e in objdb.ExternalGroupMaps where e.ExternalGroupName.Equals(externalGroupMapcollection[0].ExternalGroupName) select e);
     bool flag = true;
     if (externalGroups.Any())
     {
         foreach (LINQ.ExternalGroupMap ws in externalGroupMapcollection)
         {
             flag = true;
             foreach (LINQ.ExternalGroupMap g in externalGroups)
             {
                 if (g.AMSGroupName.Equals(ws.AMSGroupName))
                 {
                     flag = false;
                 }
             }
             if (flag)
             {
                 objdb.ExternalGroupMaps.InsertOnSubmit(ws);
             }
         }
         flag = true;
         foreach (LINQ.ExternalGroupMap g in externalGroups)
         {
             flag = true;
             foreach (LINQ.ExternalGroupMap ws in externalGroupMapcollection)
             {
                 if (g.AMSGroupName.Equals(ws.AMSGroupName))
                 {
                     flag = false;
                 }
             }
             if (flag)
             {
                 objdb.ExternalGroupMaps.DeleteOnSubmit(g);
             }
         }
     }
     else
     {
         objdb.ExternalGroupMaps.InsertAllOnSubmit(externalGroupMapcollection);
     }
     objdb.SubmitChanges();
 }
Пример #10
0
        public void ViewData(int editid)
        {
            //ClearForm();
            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var group =
                (from c in db.TblPasswordChanges
                 where c.PasswordChangeId == editid
                 select c).FirstOrDefault();

            txtEmail.Text = group.EmailAddress;

            txtTempPassword.Text = group.TempPassword;
            txtNewPassword.Text = group.NewPassword;
            txtRetypPassword.Text = group.RetypePassword;
            //DropDownState.Text = group.Address1;
            //txtZipcode.Text = group.Zipcode;
            // DropDownCountry.Text = group.Address1;
            hdneditId.Value = editid.ToString();
        }
Пример #11
0
        /// <summary>
        /// Edit the Faculty
        /// </summary>
        /// <param name="FacultyId"></param>
        /// <param name="FacultyName"></param>
        /// <param name="Description"></param>
        /// <param name="Message"></param>
        /// <returns></returns>
        public static bool Update(int FacultyId, string FacultyName, string Description, out string Message)
        {
            AccreditationDataContext objDB = new AccreditationDataContext();
            try
            {
                LINQ.Faculty faculty = objDB.Faculties.First(F => F.FacultyId == FacultyId);

                faculty.FacultyName = FacultyName;
                faculty.Description = Description;

                objDB.SubmitChanges();
                Message = "Updated successfully";
                return true;
            }
            catch (Exception ex)
            {
                Message = "Cannot Update";
                return false;
            }
        }
Пример #12
0
        public static bool Delete(int intDelGrp)
        {
            bool boolMess = false;
            try
            {
                AccreditationDataContext objDb = new AccreditationDataContext();
                objDb.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];

                LINQ.TblGroupCreation gc = objDb.TblGroupCreations.Where(D => D.GrpId == intDelGrp).Single();
                gc.Active = false;

                objDb.SubmitChanges();

                boolMess = true;
            }
            catch (Exception ex)
            {
                boolMess = false;
            }
            return boolMess;
        }
Пример #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string subpoeanaId = Request.QueryString["subpoeanaId"];
            string status = Request.QueryString["Status"];
            string message = string.Empty;

             AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var stsubpoeanrs =
                (from c in db.TblSubpoenaFrms
                 where c.SubpoenaFrmId == int.Parse(subpoeanaId)
                 select c).FirstOrDefault();
            if (status.ToLower() == "yes")
            {
                stsubpoeanrs.Status = ((int)BLL.Constants.Status.YES).ToString(); //"Close";
                stsubpoeanrs.UpdatedOn = DateTime.Now;
                db.SubmitChanges();
                lblMessage.Text = "Accepted subpoena";
                message = "Subpoena hass been accepted by detective";
            }
            else if (status.ToLower() == "maybe")
            {
                stsubpoeanrs.Status = ((int)BLL.Constants.Status.MAYBE).ToString(); //"Close";
                stsubpoeanrs.UpdatedOn = DateTime.Now;
                db.SubmitChanges();
                lblMessage.Text = "Subpoena accepted";
                message = "Subpoena hass been accepted by detective with may be late comment.";
            }
            else
            {
                stsubpoeanrs.Status = ((int)BLL.Constants.Status.NO).ToString();// "Rejected";
                stsubpoeanrs.SaveType = "Save"; //Rejected subpoena change to save status.
                stsubpoeanrs.UpdatedOn = DateTime.Now;
                db.SubmitChanges();
                lblMessage.Text = "Rejected subpoena";
                message = "Subpoena hass been rejected by detective. <br/>Subpoena changed to Save state";
            }
            //stsubpoeanrs.CreatedBy
            SendMail(stsubpoeanrs.CreatedBy, stsubpoeanrs.SubpoenaName, message);
        }
        public static void Update(int UserId, string UserFirstName, string UserLastName, string UserEmail, int Group)
        {
            AccreditationDataContext objDB = new AccreditationDataContext();
            objDB.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            //string report = null;
            try
            {
                LINQ.TblUserRegistration urr = objDB.TblUserRegistrations.First(D => D.UserId == UserId);
                urr.UserFirstName = UserFirstName;
                urr.UserLastName = UserLastName;
                urr.UserEmail = UserEmail;
                urr.Group = Group;

                objDB.SubmitChanges();
                //  report = BLL.Constants.Update;
            }
            catch (Exception ex)
            {
                //  report = BLL.Constants.NotUpdated;
            }

            //  return report;
        }
Пример #15
0
        private void ViewData()
        {
            //<th>Case ID</th>
            //                   <th>State</th>
            //                   <th>Heading</th>
            //                   <th>Official Name</th>
            //                   <th>Detactive Name</th>
            //                   <th>Date</th>
            //                   <th>Status</th>
            //                   <th>Heading</th>

            //ClearForm();
            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var subpoena =
                from c in db.TblSubpoenaFrms
                where (c.Status != "Submit" && c.DetectiveId == CurrentUser.UserId)
                select new
                {
                    c.CaseId,
                    state = db.TblStates.Where(x => x.StateId == c.StateId).FirstOrDefault().StateName,
                    c.SubpoenaName,
                    c.OfficialName,
                    c.Date,
                    c.Status,
                    c.PDFPath,
                    c.DetativeName
                };
            foreach (var xval in subpoena)
            {
                htmlTable.Append("<tr >");
                htmlTable.Append("<td>" + xval.CaseId + "</td>");
                htmlTable.Append("<td>" + xval.SubpoenaName + "</td>");
                htmlTable.Append("<td>" + xval.OfficialName + "</td>");
                htmlTable.Append("<td>" + xval.DetativeName + "</td>");
                htmlTable.Append("<td>" + xval.Date + "</td>");
                //htmlTable.Append("<td>" + xval.Status + "</td>");
                htmlTable.Append("<td>" + xval.PDFPath + "</td>");

                htmlTable.Append("</tr>");

            }
              //  DBDataPlaceHolder.Controls.Add(new Literal { Text = htmlTable.ToString() });

            // GridView1.DataSource = subpoena;
            // GridView1.DataBind();
        }
Пример #16
0
        protected void GetAllCaseId()
        {
            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var subpoena1 =
                from c in db.TblSubpoenaFrms

                select c.CaseId;
            string AllCaseId = "";
            foreach (string CaseId in subpoena1)
            {
                if(AllCaseId !="")
                AllCaseId += ",";
                AllCaseId += CaseId.ToString();
            }
            //
            if (txtCaseIdAll == null)
            {
                txtCaseIdAll = new TextBox();
                txtCaseIdAll.ID="txtCaseIdAll";
            }
            txtCaseIdAll.Text = AllCaseId;
        }
Пример #17
0
 protected void Calendar2_DayRender(object sender, DayRenderEventArgs e)
 {
     AccreditationDataContext db = new AccreditationDataContext();
     db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
     var subpoena =
         from c in db.TblSubpoenaFrms
         where (c.Status != "Submit" && c.DetectiveId == CurrentUser.UserId)
         select c;
 }
Пример #18
0
 public static IEnumerable<LINQ.ErrorLog> ColumnSort(string sortExpression, string direction)
 {
     AccreditationDataContext dbContext = new AccreditationDataContext();
     IEnumerable<LINQ.ErrorLog> errors = null;
     switch (sortExpression)
     {
         case "Description":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.Description ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.Description descending select e;
             return errors;
         case "Page":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.Page ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.Page descending select e;
             return errors;
         case "PostBackData":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.PostBackData ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.PostBackData descending select e;
             return errors;
         case "BrowserName":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.BrowserName ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.BrowserName descending select e;
             return errors;
         case "BrowserVersion":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.BrowserVersion ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.BrowserVersion descending select e;
             return errors;
         case "BrowserPlatform":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.BrowserPlatform ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.BrowserPlatform descending select e;
             return errors;
         case "MinorError":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.MinorError ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.MinorError descending select e;
             return errors;
         case "StackTrace":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.StackTrace ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.StackTrace descending select e;
             return errors;
         case "Time":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.Time ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.Time descending select e;
             return errors;
         case "UserID":
             if (direction.Contains("ASC"))
                 errors = from e in dbContext.ErrorLogs orderby e.UserID ascending select e;
             else
                 errors = from e in dbContext.ErrorLogs orderby e.UserID descending select e;
             return errors;
         default:
             errors = from e in dbContext.ErrorLogs orderby e.UserID ascending select e;
             return errors;
     }
 }
Пример #19
0
        public void showState()
        {
            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var state =
                from c in db.TblStates
                select c;

            if (state.Count() > 0)
            {
                DropDownState.DataSource = state;
                DropDownState.DataTextField = "StateName";
                DropDownState.DataValueField = "StateId";
                DropDownState.DataBind();
                DropDownState.Items.Insert(0, new ListItem("----Select State----", "0"));

            }
        }
Пример #20
0
 public static IEnumerable<LINQ.ExternalGroupMap> ShoweGroupMap()
 {
     AccreditationDataContext objdb = new AccreditationDataContext();
     return (from f in objdb.ExternalGroupMaps select f);
 }
Пример #21
0
 //////// Added By Rahul //////////
 protected void DropDownState_SelectedIndexChanged(object sender, EventArgs e)
 {
     AccreditationDataContext db = new AccreditationDataContext();
     db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
     var userState =
         from c1 in db.TblCounties
         where c1.StateId == Convert.ToInt16(DropDownState.SelectedItem.Value)
         select c1;
     DropDownCountry.DataSource = userState;
     DropDownCountry.DataTextField = "CountyName";
     DropDownCountry.DataValueField = "CountyId";
     DropDownCountry.DataBind();
     DropDownCountry.Items.Insert(0, new System.Web.UI.WebControls.ListItem("----Select State----", "0"));
 }
Пример #22
0
        protected void btnSubmit1_Click(object sender, EventArgs e)
        {
            //if (DropDownCountry.SelectedIndex > 0 && DropDownState.SelectedIndex > 0 && txtGroupName.Text.Trim() != string.Empty && txtAddress1.Text.Trim() != string.Empty && txtCity.Text.Trim() != string.Empty)
            ////if (txtGroupName.Text.Trim().Length > 0 && txtLastName.Text.Trim().Length > 0 && txtEmail.Text.Trim().Length > 0 && Convert.ToInt16(DropDownGroup.SelectedItem.Value)>0)
            //{
            if (btnSubmit1.Text.Equals("Submit"))
            {

                if (hdneditId.Value != null && hdneditId.Value != "" && int.Parse(hdneditId.Value.ToString()) > 0)
                {

                    AccreditationDataContext objDB = new AccreditationDataContext();
                    objDB.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
                    using (AccreditationDataContext group = new AccreditationDataContext())
                    {
                        LINQ.TblGroupCreation grp = objDB.TblGroupCreations.First(D => D.GrpId == int.Parse(hdneditId.Value.ToString()));
                        if (grp.GrpName.Trim() == txtGroupName.Text.Trim())
                        {
                            grp.GrpName = txtGroupName.Text.Trim();
                            grp.Address1 = txtAddress1.Text.Trim();
                            grp.Address2 = txtAddress2.Text.Trim();
                            grp.City = txtCity.Text.Trim();
                            grp.StateId = Convert.ToInt16(DropDownState.SelectedItem.Value);
                            grp.Zipcode = txtZipcode.Text;
                            grp.CountryId = Convert.ToInt16(DropDownCountry.SelectedItem.Value);
                            grp.Active = true;
                            objDB.SubmitChanges();
                            showOutputMessage((int)BLL.Constants.MessageType.Success, "Group updated successfully.");
                        }
                        else
                        {
                            if (!IsExistGroup(txtGroupName.Text.Trim(), int.Parse(hdneditId.Value.ToString())))
                            {
                                grp.GrpName = txtGroupName.Text.Trim();
                                grp.Address1 = txtAddress1.Text.Trim();
                                grp.Address2 = txtAddress2.Text.Trim();
                                grp.City = txtCity.Text.Trim();
                                grp.StateId = Convert.ToInt16(DropDownState.SelectedItem.Value);
                                grp.Zipcode = txtZipcode.Text;
                                grp.CountryId = Convert.ToInt16(DropDownCountry.SelectedItem.Value);
                                grp.Active = true;
                                objDB.SubmitChanges();
                                showOutputMessage((int)BLL.Constants.MessageType.Success, "Group updated successfully.");
                            }
                            else
                            {
                               // Response.Write("<script>alert('This Group Name Already exist.')</script>");
                                showOutputMessage((int)BLL.Constants.MessageType.Fail, "This Group Name Already exist.");
                                return;
                                //Utilities.CreateMessageLabel(this, BLL.Constants.UnableToCreateGroup, false);
                            }
                        }

                    }

                }
                else
                {
                    if (!IsExistGroup(txtGroupName.Text.Trim(), 0))
                    {
                        using (AccreditationDataContext group = new AccreditationDataContext())
                        {
                            TblGroupCreation group1 = new TblGroupCreation
                            {
                                GrpName = txtGroupName.Text.Trim(),
                                Address1 = txtAddress1.Text.Trim(),
                                Address2 = txtAddress2.Text.Trim(),
                                City = txtCity.Text.Trim(),
                                StateId = Convert.ToInt16(DropDownState.SelectedItem.Value),
                                Zipcode = txtZipcode.Text,
                                CountryId = Convert.ToInt16(DropDownCountry.SelectedItem.Value),
                                Active = true,
                            };
                            group.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
                            group.TblGroupCreations.InsertOnSubmit(group1);
                            group.SubmitChanges();
                            showOutputMessage((int)BLL.Constants.MessageType.Success, "Group created successfully.");

                        }
                    }
                    else
                    {
                       // Response.Write("<script>alert('This Group Name Already exist.')</script>");
                        showOutputMessage((int)BLL.Constants.MessageType.Fail, "This Group Name Already exist.");
                        return;
                        //Utilities.CreateMessageLabel(this, BLL.Constants.UnableToCreateGroup, false);
                    }

                }

            }

            Response.AddHeader("REFRESH", "5;URL=GroupList.aspx");
            //Response.Redirect("GroupList.aspx");
            return;
        }
Пример #23
0
        public void ViewData(int editid)
        {
            //ClearForm();
            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var group =
                (from c in db.TblGroupCreations
                 where c.GrpId == editid
                 select c).FirstOrDefault();

            txtGroupName.Text = group.GrpName;

            txtAddress1.Text = group.Address1;
            txtAddress2.Text = group.Address2;
            txtCity.Text = group.City;
            //DropDownState.Text = group.Address1;
            txtZipcode.Text = group.Zipcode;
            // DropDownCountry.Text = group.Address1;
            hdneditId.Value = editid.ToString();

            var state =
                from c in db.TblStates
                select c;

            if (state.Count() > 0)
            {
                DropDownState.DataSource = state;
                DropDownState.DataTextField = "StateName";
                DropDownState.DataValueField = "StateId";
                DropDownState.DataBind();
                DropDownState.Items.Insert(0, new ListItem("----Select State----", "0"));
                DropDownState.SelectedValue = group.StateId.ToString();
                DropDownState.DataBind();
            }

            var country =
                from c in db.TblCounties
                select c;

            if (country.Count() > 0)
            {
                DropDownCountry.DataSource = country;
                DropDownCountry.DataTextField = "CountyName";
                DropDownCountry.DataValueField = "CountyId";
                DropDownCountry.DataBind();
                DropDownCountry.Items.Insert(0, new ListItem("----Select Country----", "0"));
                DropDownCountry.SelectedValue = group.CountryId.ToString();
                DropDownCountry.DataBind();
            }
        }
Пример #24
0
        private void ViewNewSubpoena()
        {
            //ClearForm();
            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var subpoena1 =
                from c in db.TblSubpoenaFrms
                where (c.Status == ((int)BLL.Constants.Status.NEW).ToString())// "new")
                select c;

            //GridView2.DataSource = subpoena1;
            // GridView2.DataBind();
        }
Пример #25
0
        protected void btn_SignIn_Click(object sender, EventArgs e)
        {
            if(txtUserName.Text !="" && txtPassword.Text !="")
            {
            AccreditationDataContext objDb = new AccreditationDataContext();
            objDb.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            //LINQ.User client = objDb.Users.Where(D => D.UserName == txtUserName.Text).Single();
            var user = objDb.TblUserRegistrations.Where(D => D.UserEmail == txtUserName.Text.Trim() && D.Active==true).FirstOrDefault();
            if (user != null)
            {
                if (user.HashPass == DbConnection.GetHash(txtPassword.Text))
                {
                    Session["UserEmail"] = txtUserName.Text.Trim();
                    Session["GroupId"] = user.Group;
                    Session["UserRole"] = user.userRole;
                    if (user.userRole == "Detective")
                    {
                        Session["HomePage"] = "PageforDetective.aspx";
                        Response.Redirect("ContentPages/PageforDetective.aspx");
                    }
                    else if (user.userRole == "subpoenaproducer")
                    {
                        Session["HomePage"] = "HomePageForSubProducerUsers.aspx";
                        Response.Redirect("ContentPages/HomePageForSubProducerUsers.aspx");

                    }
                    else if (user.userRole == "Otherusers")
                    {
                        Session["HomePage"] = "OtherUsers.aspx";
                        Response.Redirect("ContentPages/OtherUsers.aspx");

                    }
                    else if (user.userRole == "SuperAdmin" || user.userRole == "Admin")
                    {
                        Session["HomePage"] = "AdminUsers.aspx";
                        Response.Redirect("ContentPages/AdminUsers.aspx");

                    }
                    else if (user.userRole == "GroupLeader")
                    {
                        Session["HomePage"] = "CalendarDashboard.aspx";
                        Response.Redirect("ContentPages/CalendarDashboard.aspx");

                    }
                }
                else
                {
                    lbFailureText.Text = "The email and password you entered don't match.";

                }
            }
            else
            {
                lbFailureText.Text = "The email and password you entered don't match.";

            }

            }
            else
            {
                lbFailureText.Text = "The email and password you entered don't match.";

            }
        }
Пример #26
0
 public static IEnumerable<LINQ.Faculty> Get()
 {
     AccreditationDataContext objDB = new AccreditationDataContext();
     IEnumerable<LINQ.Faculty> Faculties = from f in objDB.Faculties orderby f.FacultyName select f;
     return Faculties;
 }
Пример #27
0
 public static List<LINQ.ExternalGroupMap> Get(string[] role)
 {
     AccreditationDataContext objdb = new AccreditationDataContext();
     return (from f in objdb.ExternalGroupMaps where role.Contains(f.ExternalGroupName) select f).ToList();
 }
Пример #28
0
        public void showCountry()
        {
            AccreditationDataContext db = new AccreditationDataContext();
            db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
            var country =
                from c in db.TblCountries
                select c;

            if (country.Count() > 0)
            {
                DropDownCountry.DataSource = country;
                DropDownCountry.DataTextField = "CountryName";
                DropDownCountry.DataValueField = "CountryId";
                DropDownCountry.DataBind();
                DropDownCountry.Items.Insert(0, new ListItem("----Select Country----", "0"));

            }
        }
Пример #29
0
 public static IEnumerable<string> ShowexternalGroupMap()
 {
     AccreditationDataContext objdb = new AccreditationDataContext();
     return (from f in objdb.ExternalGroupMaps select f.ExternalGroupName).Distinct();
 }
Пример #30
0
 public static bool IsExistEmail(string Email)
 {
     AccreditationDataContext db = new AccreditationDataContext();
     db.Connection.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["constr"];
     return db.TblPasswordChanges.Where(d => d.EmailAddress == Email).Any();
 }