Beispiel #1
0
        protected void ButtonSave_Click(object sender, EventArgs e)
        {
            CRComments crComments = new CRComments();

            crComments.PMSID = DropDownListCRID.SelectedValue;
            crComments.CRID  = DropDownListCRID.Text;
            if (TextBoxPMCom.Text == "")
            {
                crComments.PMComments = " ";
            }
            else
            {
                crComments.PMComments = TextBoxPMCom.Text.Trim();
            } if (TextBoxSDCom.Text == "")
            {
                crComments.SDComments = " ";
            }
            else
            {
                crComments.SDComments = TextBoxSDCom.Text.Trim();
            }
            if (pagebiz.SaveComments(LoginName, crComments) == true)
            {
                Msgbox("Save successfully !");
                ShowCRInfo(crComments.PMSID);
            }
            else
            {
                Msgbox("Save failed !");
            }
        }
Beispiel #2
0
 public bool InsertCRComments(CRComments crcomments)
 {
     try
     {
         m_PMSSqlConnection.Insert("InsertSDComments", crcomments);
         return(true);
     }
     catch (Exception ex)
     {
         m_Logger.Error("NotCloseCRCommentsBiz/InsertCRComments:" + ex.ToString());
         return(false);
     }
 }
Beispiel #3
0
 public bool SaveComments(string userName, CRComments crComments)
 {
     try
     {
         if (CommentsExits(crComments.PMSID) == false)
         {
             if (InsertCRComments(crComments) == true)
             {
                 return(true);
             }
         }
         else
         {
             if (IsLeader(userName) == true)
             {
                 //save All Comments
                 if (UpdateComments(crComments) == true)
                 {
                     return(true);
                 }
             }
             else
             {
                 if (IsPMRole(crComments.PMSID, userName) == true)
                 {
                     //save PM Comments
                     if (UpdatePMComments(crComments.PMSID, crComments.PMComments) == true)
                     {
                         return(true);
                     }
                 }
                 else
                 {
                     //save SD Comments
                     if (UpdateSDComments(crComments.PMSID, crComments.SDComments) == true)
                     {
                         return(true);
                     }
                 }
             }
         }
         return(false);
     }
     catch (Exception ex)
     {
         m_Logger.Error("NotCloseCRCommentsBiz/SaveComments:" + ex.ToString());
         return(false);
     }
 }
Beispiel #4
0
        private void ShowCRInfo(string strPMSID)
        {
            DropDownListCRID.SelectedValue = strPMSID;
            VPmsNotClosedcr crInfo = pagebiz.GetCRInfo(strPMSID);

            if (crInfo != null)
            {
                LabelCRNameD.Text      = crInfo.Pmsname;
                LabelTypeD.Text        = crInfo.Type;
                LabelSystemD.Text      = crInfo.System;
                LabelPMD.Text          = crInfo.Pm;
                LabelSDD.Text          = crInfo.Sd;
                LabelReleaseDateD.Text = crInfo.Releasedate;
                LabelCRCostD.Text      = crInfo.Cost.ToString();
                CRComments crComments = pagebiz.GetCRComments(strPMSID);
                if (crComments != null)
                {
                    TextBoxPMCom.Text = crComments.PMComments;
                    TextBoxSDCom.Text = crComments.SDComments;
                }
                else
                {
                    TextBoxPMCom.Text = "";
                    TextBoxSDCom.Text = "";
                }
                //Enable Comments TextBox by Role
                TextBoxPMCom.Enabled = true;
                TextBoxSDCom.Enabled = true;
                if (IsLeader != "Y")
                {
                    if (pagebiz.IsPMRole(strPMSID, LoginName) != true)
                    {
                        TextBoxPMCom.Enabled = false;
                    }
                    if (pagebiz.IsSDRole(strPMSID, LoginName) != true)
                    {
                        TextBoxSDCom.Enabled = false;
                    }
                }
            }
        }
Beispiel #5
0
 public bool UpdateComments(CRComments comments)
 {
     try
     {
         Hashtable hashPara = new Hashtable();
         hashPara.Add("PMComments", comments.PMComments);
         hashPara.Add("SDComments", comments.SDComments);
         hashPara.Add("PMSID", comments.PMSID);
         if (m_PMSSqlConnection.Update("UpdateComments", hashPara) == 1)
         {
             return(true);
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         m_Logger.Error("NotCloseCRCommentsBiz/UpdatePMComments:" + ex.ToString());
         return(false);
     }
 }