public static bool UpdateRequest(OnDemandRequest Request)
 {
     bool isFlag = false;
     OnDemandRequestBLL objMyRequestBLL = null;
     try
     {
         Common objCommon = new Common();
         objMyRequestBLL = new OnDemandRequestBLL();
         Request.ModifiedBy = objCommon.GetCurrentUserName();
         isFlag = objMyRequestBLL.UpdateRequest(Request);
     }
     catch (Exception ex)
     {
         // Log the error to a text file in the Error folder
         Common.WriteError(ex);
     }
     finally
     {
         objMyRequestBLL = null;
     }
     return isFlag;
 }
        public bool UpdateRequest(OnDemandRequest Request)
        {
            string proc_name = ConstantsDLL.USP_UPDATEONDEMANDREQUEST;
            SqlParameter[] param = new SqlParameter[8];
            param[0] = new SqlParameter("@OnDemandID", Request.OndemandRequestId);
            param[1] = new SqlParameter("@Approver", Request.Approver);
            param[2] = new SqlParameter("@Address", Request.Address);
             //   param[3] = new SqlParameter("@RequestedDate", Request.RequestedDate);

            param[3] = new SqlParameter("@RequestedDate", System.Data.SqlDbType.Date, 50);
            param[3].Value =Convert.ToDateTime(Request.RequestedDate);

            param[4] = new SqlParameter("@RequestedTime", Request.RequestedTime);
            param[5] = new SqlParameter("@ApproverRemarks", Request.RequestRemarks);
            param[6] = new SqlParameter("@RequestType", Request.RequestType);
               // param[7] = new SqlParameter("@RouteName", Request.RouteName);
            param[7] = new SqlParameter("@BookingType", Request.BookingType);

            using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper())
            {
                db.ExecNonQueryProc(proc_name, param);
            }
            return true;
        }
        /// <summary>
        /// Method to insert the details for creating new request
        /// </summary>
        /// <param name="vendor"></param>
        /// <returns></returns>
        public bool InsertRequest(OnDemandRequest request)
        {
            string proc_name = ConstantsDLL.USP_INSERTNEWREQUEST;
            SqlParameter[] param = new SqlParameter[15];
            param[0] = new SqlParameter("@RequestType", request.RequestType);
            param[1] = new SqlParameter("@ReoccuringRequestId", request.ReoccuringRequest);
            param[2] = new SqlParameter("@ToDate", request.toDate);

            param[3] = new SqlParameter("@EmailId", request.EmailId);
            param[4] = new SqlParameter("@BookingType", request.BookingType);
            param[5] = new SqlParameter("@Gender", request.Gender);
            param[6] = new SqlParameter("@RouteId", request.RouteId);
            param[7] = new SqlParameter("@RequestedDate", request.RequestedDate);

            param[8] = new SqlParameter("@RequestedTime", System.Data.SqlDbType.Time,50);
            param[8].Value = request.RequestedTime;
            param[9] = new SqlParameter("@Address", request.Address);
            param[10] = new SqlParameter("@Mobile", request.Mobile);
            param[11] = new SqlParameter("@RequestRemarks", request.RequestRemarks);
            param[12] = new SqlParameter("@CreatedBy", request.CreatedBy);
            param[13] = new SqlParameter("@DCID", request.DCID);
            param[14] = new SqlParameter("@Approver", request.Approver);

            using (SqlHelper.SqlHelper db = new SqlHelper.SqlHelper())
            {
                db.ExecNonQueryProc(proc_name, param);
            }
            return true;
        }