public void ShowData(string CORID)
        {
            CustomProfile      profile    = CustomProfile.GetProfile();
            iPartRequestClient objService = new iPartRequestClient();
            tCorrespond        Cor        = new tCorrespond();

            Cor = objService.GetCorrespondanceDetail(long.Parse(CORID.ToString()), profile.DBConnection._constr);

            txtSubject.Text  = Cor.MessageTitle;
            hdnmsgbody.Value = Cor.Message.ToString();
            lblAddHTMLQuestionInRichBox.Visible = true;

            txtSubject.Enabled = false;
            // editEmail.Enabled = false;
            btnSubmit.Visible = false;
        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            CustomProfile      profile    = CustomProfile.GetProfile();
            iPartRequestClient objService = new iPartRequestClient();

            tCorrespond Cor = new tCorrespond();

            string MessageBody = hdnmsgbody.Value;
            string MsgTitle    = txtSubject.Text;

            if (MsgTitle == "")
            {
                Response.Write("<script>");
                Response.Write("showAlert('Enter Subject ', 'Error', '#');");
                txtSubject.Focus();
                Response.Write("</script>");
            }
            else if (MessageBody == "" || MessageBody == "andBrSt;brandBrEn;\r\n")
            {
                Response.Write("<script>");
                Response.Write("showAlert('Enter Message Body ', 'Error', '#');");
                Response.Write("</script>");
            }
            else
            {
                long OrderHeadId = long.Parse(RequestID.ToString());

                Cor.date         = DateTime.Now;
                Cor.Message      = MessageBody;
                Cor.MessageFrom  = profile.Personal.UserID;
                Cor.MessageTitle = MsgTitle;
                Cor.OrderHeadId  = OrderHeadId;
                Cor.Archive      = false;
                Cor.MailStatus   = 1;

                objService.InsertIntotCorrespond(Cor, profile.DBConnection._constr);

                Response.Write("<script>");
                Response.Write("window.opener.GVInboxPOR.refresh();");
                Response.Write("self.close();");
                Response.Write("</script>");
            }
        }
        public static string WMAddMessage(string hdnmsgbody, string Subject)
        {
            CustomProfile      profile    = CustomProfile.GetProfile();
            iPartRequestClient objService = new iPartRequestClient();

            tCorrespond Cor = new tCorrespond();

            string MessageBody = hdnmsgbody;
            long   OrderHeadId = Convert.ToInt64(HttpContext.Current.Session["PORRequestID"].ToString());// long.Parse(RequestID.ToString());

            Cor.date         = DateTime.Now;
            Cor.Message      = MessageBody;
            Cor.MessageFrom  = profile.Personal.UserID;
            Cor.MessageTitle = Subject;
            Cor.OrderHeadId  = OrderHeadId;

            objService.InsertIntotCorrespond(Cor, profile.DBConnection._constr);

            return("true");
        }