Beispiel #1
0
        public DesignationHTMLTemplate GetDesignationHTMLTemplate(HTMLTemplates objHTMLTemplates, string strDesignation)
        {
            try
            {
                SqlDatabase database = MSSQLDataBase.Instance.GetDefaultDatabase();
                {
                    DbCommand command = database.GetStoredProcCommand("GetDesignationHTMLTemplate");
                    command.CommandType = CommandType.StoredProcedure;
                    database.AddInParameter(command, "@Id", DbType.Int16, (byte)objHTMLTemplates);
                    if (!string.IsNullOrEmpty(strDesignation))
                    {
                        database.AddInParameter(command, "@Designation", DbType.String, strDesignation);
                    }

                    DataSet dsHTMLTemplate = database.ExecuteDataSet(command);
                    DesignationHTMLTemplate objHTMLTemplate = null;
                    if (
                        dsHTMLTemplate != null &&
                        dsHTMLTemplate.Tables.Count > 0 &&
                        dsHTMLTemplate.Tables[0].Rows.Count > 0
                        )
                    {
                        DataRow dr = dsHTMLTemplate.Tables[0].Rows[0];

                        objHTMLTemplate = new DesignationHTMLTemplate();

                        objHTMLTemplate.Id = Convert.ToInt32(dr["Id"]);
                        objHTMLTemplate.HTMLTemplatesMasterId = Convert.ToInt32(dr["HTMLTemplatesMasterId"]);
                        objHTMLTemplate.Subject = Convert.ToString(dr["Subject"]);
                        objHTMLTemplate.Header  = Convert.ToString(dr["Header"]);

                        String BodyText = Convert.ToString(dr["Body"]);

                        if (BodyText.IndexOf("#UNSEMAIL#") > 0)
                        {
                            objHTMLTemplate.Body = BodyText;
                        }
                        else
                        {
                            objHTMLTemplate.Body = String.Concat(BodyText, JGCommon.GetEmailUnSubscribeSection());
                        }

                        objHTMLTemplate.Footer      = Convert.ToString(dr["Footer"]);
                        objHTMLTemplate.DateUpdated = Convert.ToDateTime(dr["DateUpdated"]);
                    }

                    return(objHTMLTemplate);
                }
            }
            catch (Exception ex)
            {
                return(null);
            }
        }
        private void SetExamPassedMessage(String InstallId, String TaskTitle, Int64 TaskId, Int64 ParentTaskId, String ParentTaskTitle, Boolean IsWithOutTask, string Sequence = null, int SequenceDesignationId = 0)
        {
            ltlUDesg.Text = this.DesignationName;

            // IF task is assigned to user.
            if (!IsWithOutTask)
            {
                ltlTaskInstallID.Text = InstallId;
                ltlTaskTitle.Text     = TaskTitle;
                ltlParentTask.Text    = ParentTaskTitle;

                //ltlAssignTo.Text = String.Concat(txtfirstname.Text, " ", txtlastname.Text, " - ");

                //ltlAssignToInstallID.Text = hlnkUserID.Text;

                hypTaskLink.HRef  = String.Concat(JGApplicationInfo.GetSiteURL(), "/Sr_App/ITDashboard.aspx?TaskId=", ParentTaskId.ToString(), "&hstid=", TaskId.ToString());
                hypTaskLink1.HRef = String.Concat(JGApplicationInfo.GetSiteURL(), "/Sr_App/ITDashboard.aspx?TaskId=", ParentTaskId.ToString(), "&hstid=", TaskId.ToString());

                divTaskAssigned.Visible = true;
            }

            #region "-- User Details in Popup --"


            //ddlEmployeeType.SelectedIndex = ddlEmployeeType.SelectedIndex;

            //  divCountryCode.Attributes.Add("class", ddlCountry.SelectedValue);

            //lblCity.Text = txtCity.Text;
            //lblZip.Text = txtZip.Text;

            ////lbtnEmail.Text = hidExtEmail.Value;

            //lblPrimaryPhone.Text = txtPhone.Text;
            lblExt.Text          = txtExt.Text;
            lblSeqtask.InnerText = JGCommon.GetSequenceDisplayText(string.IsNullOrEmpty(Sequence) ? "N.A." : Sequence, SequenceDesignationId, "TT");

            #endregion

            hypExam.HRef = String.Concat(hypExam.HRef, this.UserID);

            hypTaskLink.HRef  = String.Concat(JGApplicationInfo.GetSiteURL(), "/Sr_App/ITDashboard.aspx?TaskId=", ParentTaskId.ToString(), "&hstid=", TaskId.ToString(), "&did=", this.DesignationID, "&uid=", this.UserID);
            hypTaskLink1.HRef = String.Concat(JGApplicationInfo.GetSiteURL(), "/Sr_App/ITDashboard.aspx?TaskId=", ParentTaskId.ToString(), "&hstid=", TaskId.ToString(), "&did=", this.DesignationID, "&uid=", this.UserID);

            ////Only for programming designations
            //if (ShowGithubField)
            //{
            //    txtGithubUsername.Text = InstallUserBLL.Instance.GetUserGithubUserName(this.UserID);
            //}

            //trConfirmInterview.Visible = true;
        }
Beispiel #3
0
        // POST api/validatestaff
        public ResultClass Post([FromBody] LoginUser value)
        {
            ResultClass Result = new ResultClass();

            Result.Message = "User is not valid";
            Result.Status  = false;
            Result.Result  = 0;

            if (value != null)
            {
                if ((!string.IsNullOrWhiteSpace(value.Email) || !string.IsNullOrWhiteSpace(value.Phone)) && !string.IsNullOrWhiteSpace(value.Password))
                {
                    DataSet ds = InstallUserBLL.Instance.CheckRegistration(value.Email.Trim(), value.Phone.Trim());
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        value.FirstName = ds.Tables[0].Rows[0]["FristName"].ToString().Trim();
                        value.LastName  = ds.Tables[0].Rows[0]["LastName"].ToString().Trim();
                        value.ID        = Convert.ToInt32(ds.Tables[0].Rows[0]["Id"].ToString().Trim());

                        if (string.IsNullOrWhiteSpace(value.Email))
                        {
                            value.Email = ds.Tables[0].Rows[0]["Email"].ToString().Trim();
                        }

                        int IsValidInstallerUser = InstallUserBLL.Instance.IsValidInstallerUser(value.Email.Trim(), value.Password);
                        if (IsValidInstallerUser > 0)
                        {
                            var OTP = JGCommon.GenerateOTP(6);

                            int res = InstallUserBLL.Instance.InsertUserOTP(value.ID, 1, OTP);

                            if (res > 0)
                            {
                                string str_Body = "<table><tr><td>Hello,<span style=\"background-color: orange;\">User</span></td></tr><tr><td>your OTP for access api : " + OTP;
                                str_Body = str_Body + "</td></tr>";
                                str_Body = str_Body + "<tr><td></td></tr>";
                                str_Body = str_Body + "<tr><td>Thanks & Regards.</td></tr>";
                                str_Body = str_Body + "<tr><td><span style=\"background-color: orange;\">JM Grove Constructions</span></td></tr></table>";

                                CommonFunction.SendEmail("", value.Email, "JM Grove Construction:API OTP", str_Body, new List <Attachment>());

                                Result.Message = "User is valid and OTP is generated";
                                Result.Status  = true;
                                Result.Result  = 1;
                            }
                            else
                            {
                                Result.Message = "User is valid but OTP is not generated";
                            }
                        }
                        else
                        {
                            Result.Message = "Password is incorrect";
                        }
                    }
                    else
                    {
                        Result.Message = "Please check your user details";
                    }
                }
            }

            return(Result);
        }