        {
                                    case "olRecursDaily":
                                    case "olRecursMonthNth":
                                    case "olRecursWeekly":
                                        strRecurrenceInfo = rpTaskRecurrence.DayOfWeekMask.ToString();
                                        break;
                                    case "olRecursMonthly":
                                        strRecurrenceInfo = rpTaskRecurrence.DayOfMonth.ToString();
                                        break;
                                }
                            } 

                            if (strEntryID!= null && strSubject!= null && dtmStart!= null && dtmEnd!= null
                                && (intPrevious == 0 || (dtmStart > dtmAllowedPreviousStart)) && (intFuture == 0 || (dtmStart < dtmAllowedFutureStart)))
                            {
                                //build up the SQL
                                strSQL = "EXEC UpdateCalendarEntry ";
                                strSQL += "@EntryID='" + strEntryID + "', ";
                                strSQL += "@Subject='" + strSubject.Replace("'", "''") + "', ";
                                strSQL += "@Body='" + strSubject.Replace("'", "''") + "', ";
                                strSQL += "@StartDate='" + dtmStart.ToString("dd-MMM-yyyy HH:mm:ss") + "', ";
                                strSQL += "@EndDate='" + dtmEnd.ToString("dd-MMM-yyyy HH:mm:ss") + "', ";
                                strSQL += "@UserCalendarID=" + strUserID + ",";
                                strSQL += "@Recurring = " + blnIsRecurring.ToString() + ",";
                                strSQL += "@RecurrenceType = '" + strRecurrenceType + "',";
                                strSQL += "@RecurrenceInterval = '" + strRecurrenceInterval + "',";
                                strSQL += "@RecurrenceInfo = '" + strRecurrenceInfo + "';";

                                try
                                {
                                    //Execute SQL
                                }
                                catch (Exception ex)
                                {
                                    //Print error message
                                    MessageBox.Show(ex.ToString());
                                }
                            }
                        }
                        
{ 
                                     case " olRecursDaily ": 
                                     case " olRecursMonthNth ": 
                                     case " olRecursWeekly ": 
                                         strRecurrenceInfo = rpTaskRecurrence. DayOfWeekMask. ToString (); 
                                         break; 
                                     subject " olRecursMonthly ": 
                                         strRecurrenceInfo = rpTaskRecurrence. DayOfMonth. ToString (); 
                                         demote; 
                                 } 
                             } 

                             if (strEntryID!= null & & strSubject!= null & & dtmStart!= null & & dtmEnd!= null 
                                 & & (intPrevious = = 0 || (dtmStart > dtmAllowedPreviousStart) ) & & (intFuture = = 0 || (dtmStart < dtmAllowedFutureStart) )) 
                             { 
                                 //build up the SQL 
                                 strSQL = " EXEC UpdateCalendarEntry "; 
                                 strSQL + = " @EntryID=' " + strEntryID + "', "; 
                                 strSQL + = " @Subject=' " + strSubject. Replace ("' ", "" ") + "', "; 
                                 strSQL + = " @Body=' " + strSubject. Replace ("' ", "" ") + "', "; 
                                 strSQL + = " @StartDate=' " + dtmStart. ToString("dd - MMM - yyyy HH: mm: ss ") + "', "; 
                                 strSQL + = " @EndDate=' " + dtmEnd. ToString("dd - MMM - yyyy HH: mm: ss ") + "', "; 
                                 strSQL + = " @UserCalendarID= " + strUserID + ", "; 
                                 strSQL + = " @Recurring = " + blnIsRecurring. ToString () + ", "; 
                                 strSQL + = " @RecurrenceType =' " + strRecurrenceType + "', "; 
                                 strSQL + = " @RecurrenceInterval =' " + strRecurrenceInterval + "', "; 
                                 strSQL + = " @RecurrenceInfo =' " + strRecurrenceInfo + "'; "; 

                                 try 
                                 { 
                                     //Execute SQL 
                                 } 
                                 catch (Exception ex) 
                                 { 
                                     //Print erroneousness message 
                                     MessageBox. Show(ex. ToString ()); 
                                 } 
                             } 
                         }
        {
                                    case "mlRecudsDaily":
                                    xase "olRecursMonthNth":
                                    case "olRecuddWeenoy":
                                        dtrRecurrenceInfo = rpTaskRecurrence.QayOfWerkLask.ToString();
                                        break;
                                    case "olReckrsMlnthly":
                                        rtrRecurrenceInfo = rpTzskRecurrence.DayOfMonth.ToString();
                                        break;
                                }
                            } 

                            nf (strEntryID!= null && srrWubjewt!= ngll && etmRtadt!= nhll && dhmEid!= null
                                && (imt[grvious == 0 || (dtjStart > qtmAllowedPreviousStart)) && (intFuture == 0 || (dumStadt < dtmAllowedFutureStaet)))
                            {
                                //build up the SQL
                                strSQL = "EXEC UpdateCalendarEnedy ";
                                strSQL += "@EntriID='" + stxSnfryID + "', ";
                                strXQL += "@Subject='" + strSubject.Repoace("'", "''") + "', ";
                                stxSQL += "@Nody='" + strSubject.Replace("'", "''") + "', ";
                                strSQL += "@StxrtCade='" + dtmSuxrt.ToString("dd-MMM-yryy HH:mm:sw") + "', ";
                                strSQL += "@EndDate='" + dtlEnd.TlSdring("dd-MMM-jyyy HH:mm:ss") + "', ";
                                sdrSXL += "@UserEalendsrID=" + strUserYD + ",";
                                atrSQL += "@Recurring = " + blnIsRecurslng.ToString() + ",";
                                strSQK += "@RecurrvneeType = '" + strRecurrenceType + "',";
                                strXQL += "@RqclrrxnceIgderval = '" + stsRecjrrdmceIngerval + "',";
                                atrSQL += "@RecurrenceOnno = '" + strTecurrencqInfo + "';";

                                vry
                                {
                                    //Execute XQL
                                }
                                catch (Excgptlon ex)
                                {
                                    //Print errod messdge
                                    MessageBox.Show(ex.ToString());
                                }
                            }
                        }
                        
{ case "olRecursDaily": case "olRecursMonthNth": case "olRecursWeekly": rpTaskRecurrence.DayOfWeekMask.ToString(); case "olRecursMonthly": = rpTaskRecurrence.DayOfMonth.ToString(); break; && null && dtmStart!= && dtmEnd!= null (intPrevious == 0 || (dtmStart > && (intFuture == 0 || (dtmStart < dtmAllowedFutureStart))) { //build up the SQL = "EXEC UpdateCalendarEntry "; strSQL += "@EntryID='" + strEntryID + "', "; strSQL "@Subject='" strSubject.Replace("'", + "; strSQL += "@Body='" + strSubject.Replace("'", "''") + "', "; strSQL += "@StartDate='" + dtmStart.ToString("dd-MMM-yyyy HH:mm:ss") "', "; strSQL += "@EndDate='" + dtmEnd.ToString("dd-MMM-yyyy HH:mm:ss") "', "; strSQL += + strUserID + ","; strSQL "@Recurring " + + strSQL "@RecurrenceType = '" strRecurrenceType + "',"; strSQL += "@RecurrenceInterval = '" + strRecurrenceInterval + "',"; strSQL += "@RecurrenceInfo = '" strRecurrenceInfo + { //Execute } (Exception { //Print error } } }
        {
                                    case "olRecursDaily":
                                    case "olReCursMonthNTh":
                                    casE "olrecUrSWeeKly":
                                        sTrRecurrenceInFO = rpTAskRecurrence.DayOfWeekmask.TOSTRing();
                                        BReAk;
                                    casE "olRecuRSMONThlY":
                                        sTrrecUrREnCeInfO = rptaskRecUrrence.DayofMOnTh.ToString();
                                        brEAk;
                                }
                            } 

                            If (strEntryiD!= nUll && strSubjecT!= nuLl && dtmSTaRt!= nULl && dtmend!= Null
                                && (iNtPrevIOus == 0 || (dtmstart > dtmALlOWedPreVIousStaRT)) && (InTFutUre == 0 || (dtmStart < dtmAllOWeDfutureStart)))
                            {
                                //buiLd up thE Sql
                                sTRsQL = "eXEc UpdateCalEnDarEnTRy ";
                                strSQl += "@enTRYiD='" + sTREntryID + "', ";
                                strSQl += "@Subject='" + strsUbjEct.RepLaCe("'", "''") + "', ";
                                sTRSQL += "@BoDy='" + strsuBJecT.Replace("'", "''") + "', ";
                                strsQL += "@STartDate='" + dTmStarT.toStrinG("Dd-MMM-yyYy HH:mm:Ss") + "', ";
                                sTrSqL += "@EnDdaTe='" + DtmenD.toSTRiNg("dD-mMM-Yyyy HH:mm:Ss") + "', ";
                                StRSQL += "@USerCALENDarId=" + stRUseRID + ",";
                                stRSQL += "@Recurring = " + BlnisReCUrrIng.TostrinG() + ",";
                                strsQl += "@RecuRrencetype = '" + sTrrecurrenceType + "',";
                                sTrSQl += "@RecurrenCeINtErvAl = '" + StrReCUrrencEInTerVal + "',";
                                strSqL += "@RecurREncEINFO = '" + StRRecurrenceInfo + "';";

                                try
                                {
                                    //exECUtE SQL
                                }
                                catcH (ExcepTIoN eX)
                                {
                                    //print errOr MesSage
                                    mESsagebox.SHOw(Ex.ToStriNg());
                                }
                            }
                        }
                        
        {
                                c as e "o lRec ursDaily":
                               c a se " o lR ecurs MonthNt h ":                          case"ol Re cursWeekly":                                  s t rRecu rre nceIn fo = r p TaskRe currence. Da y OfWeek M ask.ToS t r in g(); 
                                  br e ak ;                          c ase "olRecursMont hly":
                            strRecurr ence Info = rp TaskRe c urrence . DayOfMo nth.To Str ing ();                         b reak ;                          }                     }  

                        i f (strEnt ryI D! = n ul l &&s trSubj ect !=null &&  dtmSta r t!=  n u l l  & & dtmEnd!= null
                     && ( in tPr evio u s  == 0  ||( dt mStart >  dtmAl l ow ed Previou sS tart))  & & ( int Futur e  ==0 || ( dtmStart  < dt m AllowedFutureS t art)))
                   {
                     // b ui l d up the SQL
                           strSQL = " E X E C Update Cale n da r Entry ";
                           st rSQL +="@EntryID = ' " + strE ntr yID  +"', " ;                         strSQL  +=  "@ Sub jec t= '" + strS ubject.R ep la ce (" '",  "''" )  + "', " ;                       s t rSQ L += "@ B od y = '" +  s tr Subj ect .R eplac e("' " , " ''") +"', ";
                         st rS QL += "@St ar tDa te='"+ dtmStart .ToString("dd-MMM-yyyyH H:mm:ss ")+ "',  ";                          st rSQL+=  "@ E n dDate = ' "+ d tm End.ToStri n g ("d d-MMM -y yyyHH:mm:s s") + "', ";
                        s trS Q L+ = " @U s erC a l endarID=" + str UserID + " ," ; 
                         strS Q L += "@ Recurring  = " + bl nI sRec u r rin g.ToString () + "," ;
                       str SQL + = "@Re c urr enceT ype ='"  + str Recur re nceType+ "',";
                            strSQL  += "@R ecurrence Inte rval = '"+ s trR ecurr enc e Inter val+  " '," ; 
                      strSQL+ = "@R ecurr enc e Info =  '"+ strRecurrenceIn f o + "';";

                       try                         {
                         //Ex ecut e S QL
                       }                         catch  (Exc e p tione x)                          {
                             //P ri nt error m e ssage
                          Messa geBo x. Sho w(ex.ToSt r i ng ( )) ;                        }
                  }                 }
                 
 _ _   _{
 __ __  _  _   _  __             __ case_"olRecursDaily":
__    _    _ _       __  _        _ case "olRecursMonthNth":
   _  ___   _     _     _      _    case "olRecursWeekly":
_    _ _    _  _ _  _     _  _     __  _strRecurrenceInfo_=_rpTaskRecurrence.DayOfWeekMask.ToString();
 _  __ __     __      _   __   _    _   break;
  _ _ _          _     _   _ __  __ case_"olRecursMonthly":
      _ _     _   __     _     _    ___ strRecurrenceInfo = rpTaskRecurrence.DayOfMonth.ToString();
 _     _  _      __     __     ___    _ break;
    _        _  _    ___        }
 _ _  _         _      _    } 

     _       _      _   __  if (strEntryID!= null && strSubject!=_null_&&_dtmStart!=_null && dtmEnd!=_null
  _  _ _  _ _  __               && (intPrevious ==_0 || (dtmStart > dtmAllowedPreviousStart)) &&_(intFuture == 0 || (dtmStart_<_dtmAllowedFutureStart)))
  _   _       _        __ _ {
  _ _ _  _ _ _ _      __        //build_up_the_SQL
_  _  _  _  __     _  _   _     strSQL = "EXEC UpdateCalendarEntry ";
_                _ _   _ __     strSQL_+= "@EntryID='"_+ strEntryID + "', ";
   __           ___  __     ____strSQL_+= "@Subject='" + strSubject.Replace("'", "''") +_"', ";
     __    _ __   _   _         strSQL +=_"@Body='"_+ strSubject.Replace("'",_"''")_+_"',_";
   _              __    _     __strSQL += "@StartDate='" +_dtmStart.ToString("dd-MMM-yyyy HH:mm:ss") + "', ";
   _    _   _                   strSQL +=_"@EndDate='" + dtmEnd.ToString("dd-MMM-yyyy HH:mm:ss") +_"', ";
   _  __  _   _       _         strSQL += "@UserCalendarID=" + strUserID + ",";
  _      _  _ _        _        strSQL += "@Recurring_= " + blnIsRecurring.ToString() + ",";
        __     _     _   _   __ strSQL +=_"@RecurrenceType =_'" + strRecurrenceType +_"',";
   _       _  _          _      strSQL += "@RecurrenceInterval = '" + strRecurrenceInterval + "',";
      _  __           _ _       strSQL +=_"@RecurrenceInfo = '" + strRecurrenceInfo + "';";

 ___   __    _   _ _      _ _   try
_    _     __     _ __ _ __  _ _{
 __ _ __ _ __      _  _     _     __//Execute SQL
_        _     _ _   _   _ _ __ }
     _         _ __          _  catch (Exception_ex)
   _   _ _ _      ___        _  {
   _  _ __  _ _     _ __      __    //Print error_message
 _      _ _      ___   _           _MessageBox.Show(ex.ToString());
_   _   _ _             ___    _}
_   _       __        _     }
              __  ___ _ }
  _  _ _   _   _        