public void SentMailToPManager(int solutionid) { string strYourSinscerely = Resources.MessageResource.strYourSinscerely.ToString(); string strContactNumber = Resources.MessageResource.strContactNumber.ToString(); Solution_mst objSolution = new Solution_mst(); SolutionCreator objSolutionCreator = new SolutionCreator(); objSolution = objSolution.Get_By_id(solutionid); objSolutionCreator = objSolutionCreator.Get_By_id(solutionid); UserLogin_mst objUserCreator = new UserLogin_mst(); objUserCreator = objUserCreator.Get_By_id(objSolutionCreator.Createdby); int FlagUser; string varRole = Resources.MessageResource.strPManagerRole.ToString(); int roleid; roleid = objRole.Get_By_RoleName(varRole); colUser = objUser.Get_All_By_Role(roleid); foreach (UserLogin_mst objusr in colUser) { objC_info = objC_info.Get_By_id(objusr.Userid); obj.From = Resources.MessageResource.strAdminEmail.ToString(); obj.To = objC_info.Emailid; obj.Subject = "New Solution Added. Solution Id : " + solutionid; obj.Body = "Dear Sir/Madam,<br/>A New Solution has been Added.Please find the New Solution details .<br/><br/><b>Solution Details : </b> <br/><br/><b>Solution Id :</b>" + objSolution.Solutionid + "<br/><b>Title :</b>" + objSolution.Title + " <br/><b>Added By :</b>" + objUserCreator.Username + "<br/><b>Created Date   :</b>" + objSolutionCreator.CreateDatetime + "<br/><b>Content :</b>" + objSolution.Content + "<br/><br/>This is an auto generated mail. Please do not reply.</b><br/><br/><b>Yours sincerely,</b><br/> <b>" + strYourSinscerely + "</b>"; obj.SmtpServer = Resources.MessageResource.strSMTPServer.ToString(); obj.SentMail(); } }
protected void ShowPanal1() { panShowdata.Visible = true; panEditData.Visible = false; int Solutionid = Convert.ToInt16(Request.QueryString[0]); ObjSolution = ObjSolution.Get_By_id(Solutionid); ObjSolutionKeyword = ObjSolutionKeyword.Get_By_id(Solutionid); if (ObjCategory.CategoryName == null) { lbltitle.Text = ObjSolution.Title.ToString(); lblcontent.Text = ObjSolution.Content.ToString(); ObjCategory = ObjCategory.Get_By_id(ObjSolution.Topicid); lbltopic.Text = ""; lblkeyword.Text = ObjSolutionKeyword.Keywords.ToString(); lblsolid.Text = Solutionid.ToString(); editsolheader.Visible = false; } else { lbltitle.Text = ObjSolution.Title.ToString(); lblcontent.Text = ObjSolution.Content.ToString(); ObjCategory = ObjCategory.Get_By_id(ObjSolution.Topicid); lbltopic.Text = ObjCategory.CategoryName.ToString(); lblkeyword.Text = ObjSolutionKeyword.Keywords.ToString(); lblsolid.Text = Solutionid.ToString(); editsolheader.Visible = false; } int status = Convert.ToInt16(ObjSolution.SolutionStatus); if (status == 1) { imgapprove.Visible = true; Imgunapproved.Visible = false; lblapprove.Text = "Approve"; } else if (status == 2) { Imgunapproved.Visible = true; imgapprove.Visible = false; lblapprove.Text = "Rejected"; } else { imgapprove.Visible = false; Imgunapproved.Visible = false; lblapprove.Text = "UnApproved"; } ObjSolutionCreator = ObjSolutionCreator.Get_By_id(ObjSolution.Solutionid); int userid = Convert.ToInt16(ObjSolutionCreator.Createdby); objUser = objUser.Get_By_id(userid); lblcreatedby.Text = objUser.Username.ToString(); lblcreatedon.Text = ObjSolutionCreator.CreateDatetime.ToString(); int lastupdateid = Convert.ToInt16(ObjSolutionCreator.LastUpdateBy); if (lastupdateid != 0) { objUser = objUser.Get_By_id(lastupdateid); lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString(); lbllastupdate.Text = objUser.Username.ToString(); } else { lbllastupdateon.Text = ""; lbllastupdate.Text = ""; } //if (objUser.Username == "") //{ // lbllastupdate.Text = objUser.Username.ToString(); // lbllastupdate.Text = objUser.Username.ToString(); //} //else //{ // lbllastupdate.Text = ""; // lbllastupdateon.Text = ""; //} //if (objUser.Username != "") //{ // lbllastupdate.Text = objUser.Username.ToString(); //} //if (ObjSolutionCreator.LastUpdateon == "") //{ // lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString(); //} //if (ObjSolutionCreator.LastUpdateon != "") //{ // lbllastupdateon.Text = ObjSolutionCreator.LastUpdateon.ToString(); //} }