示例#1
0
        public ActionResult Completed()
        {
            TestPaperModels models = new TestPaperModels();

            models.PaperList = CommanFunction.GetCompletedPaperList(Convert.ToInt32(System.Web.HttpContext.Current.Session[SessionVariable.UserID].ToString()));
            return(View(models));
        }
示例#2
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0;

        try
        {
            DS = Obj_PR.ChkDuplicate(TxtSalutation.Text.Trim(), out StrError);
            if (DS.Tables[0].Rows.Count > 0)
            {
                obj_Comm.ShowPopUpMsg("Salutation Already Exist..!", this.Page);
                TxtSalutation.Focus();
            }
            else
            {
                Entity_PR.Salutation = TxtSalutation.Text.Trim();
                Entity_PR.LoginId    = Convert.ToInt32(Session["UserId"]);
                Entity_PR.LoginDate  = DateTime.Now;
                InsertRow            = Obj_PR.InsertRecord(ref Entity_PR, out StrError);

                if (InsertRow != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page);
                    MakeEmptyForm();
                    Entity_PR = null;
                    obj_Comm  = null;
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
示例#3
0
        //
        // GET: /Live/

        public ActionResult MySession(string id)
        {
            if (!string.IsNullOrEmpty(id))
            {
                ResponseModels models = new ResponseModels();
                models = (ResponseModels)Session[SessionVariable.LoginUserDetails];


                DataSet ds = CommanFunction.GetDataSet("Select * from tbl_ScheduleClassMaster where ClassID=" + CommanFunction.UrlDecode(id));

                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    string s = "https://api.braincert.com/v2/getclasslaunch?apikey=008ue0CmckjvtN3czdIi&class_id=" +
                               ds.Tables[0].Rows[0]["ClassID"].ToString() + "&userId=" + models.UserID.ToString() +
                               "&userName="******"&isTeacher=0&lessonName=" +
                               ds.Tables[0].Rows[0]["LessionName"].ToString() + "&courseName=" + ds.Tables[0].Rows[0]["LessionName"].ToString() + "";
                    s = "http://roken4life.com/online/Class.aspx?Method=GETLINK&class_id=" +
                        ds.Tables[0].Rows[0]["ClassID"].ToString() + "&userId=" + models.UserID.ToString() +
                        "&userName="******"&isTeacher=0&lessonName=" +
                        ds.Tables[0].Rows[0]["LessionName"].ToString() + "&courseName=" + ds.Tables[0].Rows[0]["LessionName"].ToString() + "";
                    s           = CommanFunction.GetResponse(s);
                    ViewBag.Src = s;


                    Response.Redirect(s);
                }

                return(View());
            }
            else
            {
                ViewBag.ErrorText = "Somthing worng";
                return(View());
            }
        }
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        int i = Convert.ToInt32(hiddenbox.Value);

        if (i == 0)
        {
            try
            {
                int DeleteId = 0;
                if (ViewState["EditID"] != null)
                {
                    DeleteId = Convert.ToInt32(ViewState["EditID"]);
                }
                if (DeleteId != 0)
                {
                    Entity_Call.CompanyBankId = DeleteId;
                    Entity_Call.UserId        = Convert.ToInt32(Session["UserId"]);
                    Entity_Call.LoginDate     = DateTime.Now;
                    int iDelete = Obj_Call.DeleteRecord(ref Entity_Call, out StrError);
                    if (iDelete != 0)
                    {
                        Obj_Comm.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                        MakeEmptyForm();
                    }
                }
                Entity_Call = null;
                Obj_Comm    = null;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
    }
示例#5
0
        public ActionResult TestReportByQuestion(int PID)
        {
            TestQuestionReportModels models = new TestQuestionReportModels();

            DataSet ds = CommanFunction.GetQuestionReportDS(PID, Convert.ToInt32(System.Web.HttpContext.Current.Session[SessionVariable.UserID].ToString()));

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                int Index = 1;
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    models._QList.Add(new TestQuestionReportModels
                    {
                        QNo          = Index.ToString(),
                        Question     = dr["Question_Lang1"].ToString(),
                        Answer_Key   = dr["Answer_Key"].ToString(),
                        Response_Key = dr["Response_Key"].ToString(),
                    });

                    Index += Index;
                }

                models.PaperName   = ds.Tables[2].Rows[0]["Paper_Name"].ToString();
                models.StudentName = ds.Tables[1].Rows[0]["Name"].ToString();
            }
            return(View(models));
        }
示例#6
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            if (ViewState["EditID"] != null)
            {
                Entity_SU.SubUnitId = Convert.ToInt32(ViewState["EditID"]);
            }
            Entity_SU.SubUnit1         = TxtSubUnit.Text.Trim();
            Entity_SU.ConversionFactor = Convert.ToDecimal(TxtConversnFactor.Text.Trim());

            Entity_SU.UserId    = Convert.ToInt32(Session["userId"]);
            Entity_SU.LoginDate = DateTime.Now;

            UpdateRow = Obj_SU.UpdateRecord(ref Entity_SU, out StrError);

            if (UpdateRow != 0)
            {
                Obj_comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                MakeEmptyForm();
                Entity_SU = null;
                Obj_comm  = null;
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
示例#7
0
 protected void BtnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         int DeleteId = 0;
         if (ViewState["EditID"] != null)
         {
             DeleteId = Convert.ToInt32(ViewState["EditID"]);
         }
         if (DeleteId != 0)
         {
             Entity_Unit.UnitId    = DeleteId;
             Entity_Unit.UserId    = Convert.ToInt32(Session["UserID"]);
             Entity_Unit.LoginDate = DateTime.Now;
             Entity_Unit.IsDeleted = true;
             int iDelete = Obj_Unit.DeleteRecord(ref Entity_Unit, out StrError);
             if (iDelete != 0)
             {
                 obj_Comm.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                 MakeEmptyForm();
             }
         }
         Entity_Unit = null;
         obj_Comm    = null;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
 // GET: Security/Verify
 public ActionResult VerifyEmail(string Id)
 {
     try
     {
         string userId = CommanFunction.Decrypt(HttpUtility.UrlDecode(Request.QueryString["Id"]));
         var    getUserActivationStatus = securityAreaBs.userBs.GetUserIsActiveOrNot(userId);
         if (getUserActivationStatus == true)
         {
             TempData["Msg"] = "You have already verified your account. Go to login page for login your account.";
         }
         else
         {
             var updateUserIsActive = securityAreaBs.userBs.UpdateUserIsActive(userId);
             if (updateUserIsActive == true)
             {
                 TempData["Msg"] = "You have successfully verified your account. Go to login page for login your account.";
             }
         }
         return(View());
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
示例#9
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        int DeleteId = 0;

        try
        {
            if (ViewState["EditID"] != null)
            {
                DeleteId = Convert.ToInt32(ViewState["EditID"]);
            }
            if (DeleteId != 0)
            {
                Entity_Property.PropertyId = DeleteId;
                Entity_Property.UserId     = Convert.ToInt32(Session["UserID"]);
                Entity_Property.LoginDate  = DateTime.Now;

                int iDelete = obj_Property.DeletePropertyMaster(ref Entity_Property, out StrError);
                if (iDelete != 0)
                {
                    Obj_Comm.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                    MakeEmptyForm();
                }
            }
            Entity_Property = null;
            Obj_Comm        = null;
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
示例#10
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            if (ViewState["EditID"] != null)
            {
                Entity_Unit.UnitId = Convert.ToInt32(ViewState["EditID"]);
            }
            Entity_Unit.UnitName = TxtUnit.Text.Trim();

            Entity_Unit.UserId    = Convert.ToInt32(Session["UserId"]);
            Entity_Unit.LoginDate = DateTime.Now;

            UpdateRow = Obj_Unit.UpdateRecord(ref Entity_Unit, out StrError);

            if (UpdateRow != 0)
            {
                obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                MakeEmptyForm();
                Entity_Unit = null;
                obj_Comm    = null;
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
示例#11
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            if (ViewState["EditID"] != null)
            {
                Entity_SL.StockLocationID = Convert.ToInt32(ViewState["EditID"]);
            }
            Entity_SL.Location  = TxtCostCentre.Text.Trim();
            Entity_SL.SiteId    = Convert.ToInt32(ddlSite.SelectedValue);
            Entity_SL.TowerId   = Convert.ToInt32(ddlTower.SelectedValue);
            Entity_SL.CompanyId = 0;

            Entity_SL.UserId    = Convert.ToInt32(Session["UserId"]);
            Entity_SL.LoginDate = DateTime.Now;
            UpdateRow           = Obj_SL.UpdateRecord(ref Entity_SL, out StrError);

            if (UpdateRow != 0)
            {
                obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                MakeEmptyForm();
                Entity_SL = null;
                obj_Comm  = null;
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
示例#12
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        try
        {
            int DeleteId = 0;
            if (ViewState["EditID"] != null)
            {
                DeleteId = Convert.ToInt32(ViewState["EditID"]);
            }
            if (DeleteId != 0)
            {
                Entity_UserMaster.UserID    = DeleteId;
                Entity_UserMaster.LoginDate = DateTime.Now;
                Entity_UserMaster.IsDeleted = true;

                int iDelete = Obj_UserMaster.DeleteUserDetails(ref Entity_UserMaster, out StrError);

                if (iDelete != 0)
                {
                    Obj_Comm.ShowPopUpMsg("Record Deleted SuccessFully...!", this.Page);
                    MakeEmptyForm();
                }


                Entity_UserMaster = null;
                Obj_Comm          = null;
            }
        }
        catch (Exception ex)
        {
            StrError = ex.Message;
        }
    }
 protected void GrdReport_RowDeleting(object sender, GridViewDeleteEventArgs e)
 {
     try
     {
         int DeleteId = Convert.ToInt32(((ImageButton)GrdReport.Rows[e.RowIndex].Cells[0].FindControl("ImgBtnDelete")).CommandArgument.ToString());
         if (DeleteId != 0)
         {
             Entity_Receipt.ReceiptExpOutId = DeleteId;
             Entity_Receipt.UserId          = Convert.ToInt32(Session["UserId"]);
             Entity_Receipt.LoginDate       = DateTime.Now;
             int iDelete = Obj_Receipt.DeleteReceipt(ref Entity_Receipt, out StrError);
             if (iDelete != 0)
             {
                 Obj_Comm.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                 MakeEmptyForm();
             }
         }
         Entity_Receipt = null;
         Obj_Comm       = null;
     }
     catch (Exception ex)
     {
         throw new Exception(ex.Message);
     }
 }
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int i = Convert.ToInt32(hiddenbox.Value);

        if (i == 0)
        {
            int UpdateRow = 0;
            try
            {
                if (ViewState["EditID"] != null)
                {
                    Entity_Expense.ExpenseHdId = Convert.ToInt32(ViewState["EditID"]);
                }
                Entity_Expense.Expense = txtExpense.Text.Trim();

                Entity_Expense.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_Expense.LoginDate = DateTime.Now;
                UpdateRow = Obj_Expense.UpdateExpense(ref Entity_Expense, out StrError);
                if (UpdateRow != 0)
                {
                    Obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                    MakeEmptyForm();

                    Entity_Expense = null;
                    Obj_Comm       = null;
                }
            }

            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
    }
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0, InsertRowDtls = 0;

        try
        {
            DS = Obj_SL.ChkDuplicate(TxtStockLocation.Text.Trim(), out StrError);
            if (DS.Tables[0].Rows.Count > 0)
            {
                obj_Comm.ShowPopUpMsg("Location Name Already Exist..!", this.Page);
                TxtStockLocation.Focus();
            }
            else
            {
                Entity_SL.Location     = TxtStockLocation.Text.Trim();
                Entity_SL.abbreviation = Txtabbreviations.Text.Trim();
                Entity_SL.SiteId       = 0;
                Entity_SL.TowerId      = 0;
                Entity_SL.CompanyId    = Convert.ToInt32(ddlcompany.SelectedValue);
                Entity_SL.SiteAddr     = TxtSiteAddr.Text;
                Entity_SL.UserId       = Convert.ToInt32(Session["UserId"]);
                Entity_SL.LoginDate    = DateTime.Now;
                Entity_SL.IsDeleted    = false;
                Entity_SL.IsCental     = chkCenLoc.Checked ? true : false;
                InsertRow = Obj_SL.InsertRecord(ref Entity_SL, out StrError);

                if (InsertRow > 0)
                {
                    if (ViewState["CurrentTable"] != null)
                    {
                        DataTable dtInsert = new DataTable();
                        dtInsert = (DataTable)ViewState["CurrentTable"];
                        for (int i = 0; i < dtInsert.Rows.Count; i++)
                        {
                            Entity_SL.StockLocationID = InsertRow;
                            Entity_SL.EmployeeId      = Convert.ToInt32(dtInsert.Rows[i]["EmployeeId"].ToString());
                            Entity_SL.CpersonName     = dtInsert.Rows[i]["PersonName"].ToString();
                            Entity_SL.ContactNo       = dtInsert.Rows[i]["ContactNo"].ToString();
                            Entity_SL.MailId          = dtInsert.Rows[i]["EmailId"].ToString();
                            Entity_SL.PersonAddress   = dtInsert.Rows[i]["Address"].ToString();
                            InsertRowDtls             = Obj_SL.InsertDetailsRecord(ref Entity_SL, out StrError);
                        }
                    }
                    if (InsertRow != 0)
                    {
                        obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page);
                        MakeControlEmpty();
                        MakeEmptyForm();
                        Entity_SL = null;
                        obj_Comm  = null;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
        public ActionResult RessetPassword(string Id)
        {
            string userId = CommanFunction.Decrypt(HttpUtility.UrlDecode(Request.QueryString["Id"]));

            TempData["forgetPassworduserId"] = Convert.ToInt32(userId);
            TempData.Keep("forgetPassworduserId");
            return(View());
        }
示例#17
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int  InsertRow = 0, DeleteRow = 0;
        bool Flag = false;

        if (ddlProject.Items.Count == 0)
        {
            Obj_Comm.ShowPopUpMsg("Please Select Minimum One Project", this.Page);
            ddlProject.Focus();
            return;
        }
        else
        {
            for (int i = 0; i < ddlProject.Items.Count; i++)
            {
                if (ddlProject.Items[i].Selected)
                {
                    Flag = true;
                }
            }
            if (!Flag)
            {
                Obj_Comm.ShowPopUpMsg("Please Select Minimum One Project", this.Page);
                ddlProject.Focus();
                return;
            }
        }
        if (ViewState["Details"] != null)
        {
            DataTable Dt = (DataTable)ViewState["Details"];
            if (Dt.Rows.Count > 0)
            {
                DeleteRow = Obj_Call.DeleteRecord();
            }
        }
        foreach (System.Web.UI.WebControls.ListItem item in ddlProject.Items)
        {
            if (item.Selected)
            {
                Entity_Call.PCId      = Convert.ToInt32(item.Value);
                Entity_Call.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_Call.LoginDate = DateTime.Now;

                InsertRow = Obj_Call.InsertRecord(ref Entity_Call, out StrError);
            }
        }
        if (InsertRow > 0)
        {
            Obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page);
            MakeEmptyForm();
            Entity_Call = null;
            Obj_Comm    = null;
        }
    }
示例#18
0
        public ActionResult TestReport(string id, string SID)
        {
            ScoreBoardModels models = new ScoreBoardModels();

            if (!string.IsNullOrEmpty(id) && !string.IsNullOrEmpty(SID))
            {
                models = CommanFunction.GetStudentScoreBoard(CommanFunction.UrlDecode(id), CommanFunction.UrlDecode(SID));
            }


            return(View(models));
        }
示例#19
0
        public async Task <IActionResult> Register(RegisterViewModel model)
        {
            if (ModelState.IsValid)
            {
                var user = new ApplicationUser
                {
                    UserName  = model.Name,
                    Email     = model.Email,
                    CountryId = model.countryId,
                    StateId   = model.stateId,
                    CityId    = model.cityId
                };
                var result = await _userManager.CreateAsync(user, model.Password);

                if (result.Succeeded)
                {
                    var token = await _userManager.GenerateEmailConfirmationTokenAsync(user);

                    var    confirmationLInk = Url.Action("ConfirmEmail", "Account", new { area = "Comman", userId = user.Id, token = token }, Request.Scheme);
                    string Ref           = "NewAccountConfirmation";
                    int    isSendSuccess = CommanFunction.SendConfirmationLink(confirmationLInk, model.Name, model.Email, Ref);
                    if (isSendSuccess == 1)
                    {
                        if (_signInManager.IsSignedIn(User) && User.IsInRole("Admin"))
                        {
                            return(RedirectToAction("Dashboard", "Dashboard", new { Area = "User" }));
                        }
                        ViewBag.Success = "Registration successful";
                        ViewBag.Message = "Before you can Login, please confirm your email, by clicking on the confirmation link we have emailed you";
                        return(View("RegistrationSuccessful"));
                    }
                }
                // If there are any errors, add them to the ModelState object
                // which will be displayed by the validation summary tag helper
                foreach (var item in result.Errors)
                {
                    ModelState.AddModelError(string.Empty, item.Description);
                }
                var countryList = _accountRepository.CounteryList().ToList();
                if (countryList != null)
                {
                    foreach (var country in countryList)
                    {
                        model.Countries.Add(new SelectListItem {
                            Text = country.CountryName, Value = country.CountryId.ToString()
                        });
                    }
                }
            }
            return(View(model));
        }
示例#20
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            string radio_btn_value = RadioButtonList1.SelectedValue;
            if (radio_btn_value == "1")
            {
                Entity_Unit.Action = 1;
                Entity_Unit.PONO   = txtPono.Text.Trim();

                Entity_Unit.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_Unit.LoginDate = DateTime.Now;

                UpdateRow = Obj_Unit.UpdateRecord(ref Entity_Unit, out StrError);

                if (UpdateRow != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                    // MakeEmptyForm();
                    txtPono.Text = string.Empty;
                    Entity_Unit  = null;
                    obj_Comm     = null;
                }
            }
            else if (radio_btn_value == "2")
            {
                Entity_Unit.Action = 2;
                Entity_Unit.PONO   = txtPono.Text.Trim();

                Entity_Unit.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_Unit.LoginDate = DateTime.Now;

                UpdateRow = Obj_Unit.UpdateRecord(ref Entity_Unit, out StrError);

                if (UpdateRow != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                    // MakeEmptyForm();
                    txtPono.Text = string.Empty;
                    Entity_Unit  = null;
                    obj_Comm     = null;
                }
            }
        }
        catch (Exception)
        {
            throw;
        }
    }
示例#21
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            if (Check() == true)
            {
                if (ViewState["EditID"] != null)
                {
                    Entity_PM.PartyId = Convert.ToInt32(ViewState["EditID"]);
                }

                Entity_PM.PartyName      = TxtPartyName.Text.Trim();
                Entity_PM.PartyAddress   = TxtAddress.Text.Trim();
                Entity_PM.PEmailId       = TxtEmail.Text.Trim();
                Entity_PM.PTelNo         = TxtPhoneNo.Text.Trim();
                Entity_PM.PmobileNo      = txtMobileNo.Text.Trim();
                Entity_PM.PWebsite       = TxtWebsite.Text.Trim();
                Entity_PM.ContPerName    = txtContPerName.Text.Trim();
                Entity_PM.ContPerAddress = txtContPerAddress.Text.Trim();
                Entity_PM.CEmailId       = txtContPerEId.Text.Trim();
                Entity_PM.CMobileNo      = txtContPerMobNo.Text.Trim();
                Entity_PM.CAdharCardNo   = TxtAdharNo.Text.Trim();
                Entity_PM.CTelNo         = txtContPerTelNo.Text.Trim();
                Entity_PM.PANNO          = TxtPANNo.Text.Trim();
                Entity_PM.GSTNo          = TxtGSTINNo.Text.Trim();
                Entity_PM.Note           = TxtNoteC.Text.Trim();

                Entity_PM.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_PM.LoginDate = DateTime.Now;

                UpdateRow = Obj_PM.UpdatePartyMaster(ref Entity_PM, out StrError);

                if (UpdateRow != 0)
                {
                    Obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                    MakeEmptyForm();
                    Entity_PM = null;
                    Obj_Comm  = null;
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
示例#22
0
        public ActionResult SessionList()
        {
            ScheduleClassModels model = new ScheduleClassModels();

            if (Session[SessionVariable.LoginUserDetails] != null)
            {
                ResponseModels models = new ResponseModels();
                models = (ResponseModels)Session[SessionVariable.LoginUserDetails];
                model.ScheduleClassList = CommanFunction.MyScheduleClassList(models.UserID);
            }
            else
            {
                return(RedirectToAction("Login", "Home"));
            }

            return(View(model));
        }
示例#23
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0;

        try
        {
            DS = Obj_EM.ChkDuplicate(TxtEmpName.Text.Trim(), out StrError);

            if (DS.Tables[0].Rows.Count > 0)
            {
                obj_Comm.ShowPopUpMsg("Employee Name Already Exist !!!", this.Page);
                TxtEmpName.Focus();
            }
            else
            {
                Entity_EM.EmpName     = TxtEmpName.Text.Trim();
                Entity_EM.Address     = TxtEmpAddress.Text.Trim();
                Entity_EM.TelNo       = TxtTelNo.Text.Trim();
                Entity_EM.Email       = TxtEmail.Text.Trim();
                Entity_EM.Note        = TxtNotes.Text.Trim();
                Entity_EM.MobileNo    = TxtMobileNo.Text.Trim();
                Entity_EM.Department  = txtDepartment.Text.Trim();
                Entity_EM.Designation = txtDesignation.Text.Trim();
                Entity_EM.UserId      = Convert.ToInt32(Session["UserId"]);
                Entity_EM.LoginDate   = DateTime.Now;
                Entity_EM.IsDeleted   = false;
                InsertRow             = Obj_EM.InsertRecord(ref Entity_EM, out StrError);

                if (InsertRow != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Saved Successfully!!", this.Page);
                    MakeEmptyForm();
                    Entity_EM = null;
                    obj_Comm  = null;
                }
            }
        }
        catch (Exception ex)
        {
            StrError = ex.Message;
        }
    }
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            //Check Duplicate
            //DS = Obj_IS.ChkDuplicate(TxtItemSubCat.Text.Trim(), out StrError);

            //if (DS.Tables[0].Rows.Count > 0)
            //{
            //    Obj_comm.ShowPopUpMsg("This Sub Category Is Already Exist....", this.Page);
            //    TxtItemSubCat.Focus();
            //}
            //else
            //{
            if (ViewState["EditID"] != null)
            {
                Entity_IS.SubCategoryId = Convert.ToInt32(ViewState["EditID"]);
            }

            Entity_IS.SubCategoryName = TxtItemSubCat.Text.Trim();
            Entity_IS.CategoryId      = Convert.ToInt32(ddlCategory.SelectedValue.ToString());
            Entity_IS.UserId          = Convert.ToInt32(Session["userId"]);
            Entity_IS.LoginDate       = DateTime.Now;
            Entity_IS.Remark          = txtRemark.Text.Trim();
            UpdateRow = Obj_IS.UpdateRecord(ref Entity_IS, out StrError);

            if (UpdateRow != 0)
            {
                Obj_comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                MakeEmptyForm();
                Entity_IS = null;
                Obj_comm  = null;
            }
            // }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
示例#25
0
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            UpdateRow = Obj_PR.UpdatePassword(Convert.ToInt32(Session["UserID"].ToString()), OPassword.Text, Password.Text, Convert.ToInt32(Session["UserID"].ToString()), out StrError);
            if (UpdateRow != 0)
            {
                obj_Comm.ShowPopUpMsg("Password Change Successfully", this.Page);
                MakeEmptyForm();
                obj_Comm = null;
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
        private bool SendResetPasswordLink(int userId, string name, string email)
        {
            bool        IsSendSuccess      = false;
            var         key                = CommanFunction.Encrypt(Convert.ToString(userId));
            string      forgetPasswordLink = ConfigurationManager.AppSettings["WebRoot"] + "Security/Login/RessetPassword?Id=" + key;
            string      to          = email;
            MailMessage mailMessage = new MailMessage();

            mailMessage.To.Add(to);
            mailMessage.Subject = "Forget Password Notification from " + ConfigurationManager.AppSettings["AppName"];
            StringBuilder sbEmailBody = new StringBuilder();

            sbEmailBody.Append("Hello" + " " + name + ",");
            sbEmailBody.Append("<br /><br />Your forget password link.");
            sbEmailBody.Append("<br /><br />Please click <a href='" + forgetPasswordLink + "'>here</a> to create new password for your account.");
            sbEmailBody.Append("<br /><br />Thanks,");
            sbEmailBody.Append("<br /><br />" + ConfigurationManager.AppSettings["AppName"]);
            mailMessage.Body = sbEmailBody.ToString();
            IsSendSuccess    = CommanFunction.SendEmail(mailMessage);
            return(IsSendSuccess);
        }
示例#27
0
        private bool SendEmail(int userId, string email, string name)
        {
            bool        IsSendSuccess     = false;
            var         key               = CommanFunction.Encrypt(Convert.ToString(userId));
            string      sVerificationLink = ConfigurationManager.AppSettings["VerfiyAccountRoot"] + "?Id=" + key;
            string      to          = email;
            MailMessage mailMessage = new MailMessage();

            mailMessage.To.Add(to);
            mailMessage.Subject = "Registration Notification from " + ConfigurationManager.AppSettings["AppName"];
            StringBuilder sbEmailBody = new StringBuilder();

            sbEmailBody.Append("Hello" + " " + name + ",");
            sbEmailBody.Append("<br /><br />You have registered successfully.You have to verify your account for login.");
            sbEmailBody.Append("<br /><br />Please click <a href='" + sVerificationLink + "'>here</a> to activate your account.");
            sbEmailBody.Append("<br /><br />Thanks,");
            sbEmailBody.Append("<br /><br />" + ConfigurationManager.AppSettings["AppName"]);
            mailMessage.Body = sbEmailBody.ToString();
            IsSendSuccess    = CommanFunction.SendEmail(mailMessage);
            return(IsSendSuccess);
        }
示例#28
0
    protected void BtnDelete_Click(object sender, EventArgs e)
    {
        int i = Convert.ToInt32(hiddenbox.Value);

        if (i == 0)
        {
            try
            {
                int DeleteId = 0;
                if (ViewState["EditID"] != null)
                {
                    if (long.Parse(hdnFldUsedCnt.Value.ToString()) > 0)
                    {
                        Obj_Comm.ShowPopUpMsg("Unit type is in use. Cannot Delete Record...", this.Page);
                        return;
                    }

                    DeleteId = Convert.ToInt32(ViewState["EditID"]);
                }
                if (DeleteId != 0)
                {
                    Entity_FlatType.FlatTypeId = DeleteId;
                    Entity_FlatType.UserId     = Convert.ToInt32(Session["UserId"]);
                    Entity_FlatType.LoginDate  = DateTime.Now;
                    int iDelete = Obj_FlatType.DeleteFlatType(ref Entity_FlatType, out StrError);
                    if (iDelete != 0)
                    {
                        Obj_Comm.ShowPopUpMsg("Record Deleted Successfully..!", this.Page);
                        MakeEmptyForm();
                    }
                }
                Entity_FlatType = null;
                Obj_Comm        = null;
            }
            catch (Exception ex)
            {
                throw new Exception(ex.Message);
            }
        }
    }
    protected void BtnUpdate_Click(object sender, EventArgs e)
    {
        int UpdateRow = 0;

        try
        {
            if (ViewState["EditID"] != null)
            {
                Entity_PR.PropertySubTypeId = Convert.ToInt32(ViewState["EditID"]);
            }
            Entity_PR.PropertySubTypeDesc = TxtPropertySubType.Text.Trim();

            if (Convert.ToInt32(ddlPropertyType.SelectedValue) > 0)
            {
                Entity_PR.PropertyTypeId = Convert.ToInt32(ddlPropertyType.SelectedValue);
            }
            else
            {
                obj_Comm.ShowPopUpMsg("Select ProprtyType First", this.Page);
                ddlPropertyType.Focus();
                return;
            }
            Entity_PR.LoginId   = Convert.ToInt32(Session["UserId"]);
            Entity_PR.LoginDate = DateTime.Now;
            UpdateRow           = Obj_PR.UpdateRecord(ref Entity_PR, out StrError);
            if (UpdateRow != 0)
            {
                obj_Comm.ShowPopUpMsg("Record Updated Successfully", this.Page);
                MakeEmptyForm();
                Entity_PR = null;
                obj_Comm  = null;
            }
        }

        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }
示例#30
0
    protected void BtnSave_Click(object sender, EventArgs e)
    {
        int InsertRow = 0;

        try
        {
            DS = Obj_SL.ChkDuplicate(TxtCostCentre.Text.Trim(), out StrError);

            if (DS.Tables[0].Rows.Count > 0)
            {
                obj_Comm.ShowPopUpMsg("Cost Location Name Already Exist..!", this.Page);
                TxtCostCentre.Focus();
            }
            else
            {
                Entity_SL.Location  = TxtCostCentre.Text.Trim();
                Entity_SL.SiteId    = Convert.ToInt32(ddlSite.SelectedValue);
                Entity_SL.TowerId   = Convert.ToInt32(ddlTower.SelectedValue);
                Entity_SL.CompanyId = 0;
                Entity_SL.UserId    = Convert.ToInt32(Session["UserId"]);
                Entity_SL.LoginDate = DateTime.Now;
                Entity_SL.IsDeleted = false;
                InsertRow           = Obj_SL.InsertRecord(ref Entity_SL, out StrError);

                if (InsertRow != 0)
                {
                    obj_Comm.ShowPopUpMsg("Record Saved Successfully", this.Page);
                    MakeEmptyForm();
                    Entity_SL = null;
                    obj_Comm  = null;
                }
            }
        }
        catch (Exception ex)
        {
            throw new Exception(ex.Message);
        }
    }