예제 #1
0
        public ResponseObj SaveTempTransTrip(TransporterVehicleTrip obj)
        {
            var res = _transdal.SaveTempTransTrip(obj);

            if (Convert.ToInt32(res.Value) > 0)
            {
                var TripRequestMsg = Convert.ToString(ConfigurationSettings.AppSettings["TripRequestMsg"]);
                // var LogisticIds = Convert.ToString(ConfigurationSettings.AppSettings["LogisticIds"]);
                // var idsList = CommonBal.GetListValue(LogisticIds);

                var idsList = new NotificationBal().GetFcmByRoleId(15);
                foreach (var item in idsList)
                {
                    //var fcmList = new NotificationBal().GetFcmByUserId(Convert.ToInt32(item));
                    CommonBal.SendNotification(item, TripRequestMsg, 15, "Trip");
                }
                /**********Mail Report of Trip*********/

                #region  Trip Sheet Mail send

                if (ConfigurationManager.AppSettings["TripCreateMailSend"] == "1")
                {
                    if (Convert.ToInt32(res.Value) > 0)
                    {
                        ReasonStatusDal _rsdal = new ReasonStatusDal();
                        var             DS     = _rsdal.Get_FoTripOrders(Convert.ToInt32(res.Value), obj.Mobile, "TT");
                        if (DS != null)
                        {
                            if (DS.Tables[0].Rows.Count > 0 && DS.Tables[1].Rows.Count > 0)
                            {
                                var sendToList  = DS.Tables[1].Rows[0]["ToList"].ToString();
                                var sendCCList  = DS.Tables[1].Rows[0]["CCList"].ToString();
                                var mailSubject = DS.Tables[1].Rows[0]["Subject"].ToString();
                                var mailBody    = string.Format(DS.Tables[1].Rows[0]["Body"].ToString(), DS.Tables[1].Rows[0]["OrderDate"].ToString());
                                var fileName    = DS.Tables[1].Rows[0]["FOName"].ToString() + "(" + obj.Mobile + ") " + DS.Tables[1].Rows[0]["OrderDate"].ToString();

                                ReportInXMail.SendMailForFoTripOrders(DS.Tables[0], sendToList, sendCCList, mailSubject, mailBody, fileName, Convert.ToInt32(obj.CreatedBy));
                            }
                        }
                    }
                }
                #endregion
            }
            return(res);
        }
예제 #2
0
        public ResponseObj UpdateTempTripStatus(string tempTripId, string status, int userId)
        {
            string FoFCM = "", FoName = "", RoFCM = "", TransName = "";
            var    result = _transdal.UpdateTempTripStatus(tempTripId, status, userId, ref FoFCM, ref FoName, ref RoFCM, ref TransName);

            if (Convert.ToInt32(result.Value) > 0)
            {
                var TripMsg        = Convert.ToString(ConfigurationSettings.AppSettings["TripMsg"]);
                var TripRejectMsg  = Convert.ToString(ConfigurationSettings.AppSettings["TripRejectMsg"]);
                var TripApproveMsg = Convert.ToString(ConfigurationSettings.AppSettings["TripApproveMsg"]);
                if (status == "1")
                {
                    TripApproveMsg = string.Format(TripApproveMsg, TransName, FoName);
                    CommonBal.SendNotification(FoFCM, TripMsg, userId, "Trip");
                    CommonBal.SendNotification(RoFCM, TripApproveMsg, userId, "Trip");
                }
                else
                {
                    TripRejectMsg = string.Format(TripRejectMsg, TransName, FoName);
                    CommonBal.SendNotification(RoFCM, TripRejectMsg, userId, "Trip");
                }
            }
            return(result);
        }