Beispiel #1
0
        // GET: User
        public ActionResult Details()
        {
            CommonBL objCommonBL = null;

            try
            {
                objDetailsVM        = new StateDetailsVM();
                objCommonBL         = new CommonBL();
                objDetailsVM.CntMst = Chikitsa.DataAccessLayer.StateDAL.GetCountry();
                return(View(objDetailsVM));
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                objCommonBL = null;
            }
        }
Beispiel #2
0
 private void SetCommandFromDB()
 {
     try
     {
         //*command
         if (CommonBL.ListTaxiCommands.Count > 0)
         {
             LENH_1_MOIKHACH         = CommonBL.GetNameByCode(CommandCode.MoiKhach, 2);
             LENH_2_GIUKHACH         = CommonBL.GetNameByCode(CommandCode.GiuKhach, 2);
             LENH_3_HOILAIDC         = CommonBL.GetNameByCode(CommandCode.HoiLaiDiaChi, 2);
             LENH_4_CHUYENKENH       = CommonBL.GetNameByCode(CommandCode.ChuyenKenh, 2);
             LENH_5_KHONGXE_XINLOI   = CommonBL.GetNameByCode(CommandCode.KoXeLan1, 2);
             LENH_5_2_KHONGXE_XINLOI = CommonBL.GetNameByCode(CommandCode.KhongXeXL, 2);
             LENH_6_KTRAKHACH        = CommonBL.GetNameByCode(CommandCode.KiemTraKhach, 2);
         }
     }
     catch
     {
     }
 }
Beispiel #3
0
        // GET: User
        public ActionResult Details()
        {
            CommonBL objCommonBL = null;

            try
            {
                objDetailsVM = new CountryDetailsVM();
                objCommonBL  = new CommonBL();
                //objDetailsVM.CntMstr.Status = true;
                //objDetailsVM.lstUserTypes = objCommonBL.GetCodeDetail(new CodeDetailFilter() { CodeTypeId = 1 });
                return(View(objDetailsVM));
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                objCommonBL = null;
            }
        }
Beispiel #4
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        /// <param name="iPageIndex">当前页数</param>
        /// <param name="iPageSize">每页显示行数</param>
        /// 创 建 人:HNAS Framework 4.0 项目组
        /// 创建日期:2012/3/15 17:21:32
        /// 修 改 人:
        /// 修改日期:
        protected void BindData(int iPageIndex, int iPageSize)
        {
            _classBM = new ClassBM();

            //获取textbox查询条件的值
            base.GetObjValueByTextBox(_classBM, "txb");

            /**** 自定义控件值得获取可在这里输入,例如:
             *
             * student.Email = this.ddlContry.Text;
             * student.IfDelete = this.radio.check;
             *
             * ****/

            int?iTotal = 0;
            /*调用BF查询函数进行查询*/
            CallResult <DataTable> result = new CommonBL("dbDemo1").GetDataTableByLike(_classBM, out iTotal, iPageSize, iPageIndex);//非默认数据库操作

            //CallResult<DataTable> result = new CommonBL().GetDataTableByLike(_classBM);//不分页
            if (result.HasError)
            {
                AspNetPager1.RecordCount = 0;
                AlertMsn.PopMsn(result.Message);
            }

            if (result.Result != null)
            {
                AspNetPager1.RecordCount = iTotal.Value;//result.Result.Rows.Count;(不分页)
                //动态设置用户自定义文本内容
                this.BindPagerCustomInfoHTML(AspNetPager1);
                //页面绑定
                gvData.PageIndex = AspNetPager1.CurrentPageIndex - 1;
                //鼠标悬停高亮显示
                gvData.RowCreated += new GridViewRowEventHandler(this.GridViewRowsChangeColor);
            }

            gvData.DataSource = result.Result;

            gvData.DataBind();
        }
Beispiel #5
0
        protected void btnAccrual_Click(object sender, EventArgs e)
        {
            util = new Utilities();
            if (util.UserAuthentication())
            {
                string userRole = Session["UserRole"].ToString();

                //Validation: only Super user can access this page
                if (userRole.ToLower() == UserRole.SuperUser.ToString().ToLower())
                {
                    //JIRA- 1172- Changes by Harshika--Start
                    string runflag = "";
                    if (hdnConfirmation.Value == "RunAccruals")
                    {
                        runflag = "RUN";
                    }
                    else if (hdnConfirmation.Value == "ReRunAccruals")
                    {
                        runflag = "RERUN";
                    }
                    //JIRA- 1172- Changes by Harshika--End
                    string   message;
                    CommonBL commonBl = new CommonBL();
                    commonBl.RunAccrualProcess(runflag, out message, out errorId);
                    commonBl = null;
                    if (errorId == 0)
                    {
                        msgView.SetMessage(message, MessageType.Warning, PositionType.Auto);
                    }
                    else if (errorId == 2)
                    {
                        msgView.SetMessage("Error in Accrual process", MessageType.Warning, PositionType.Auto);
                    }
                }
                else
                {
                    msgView.SetMessage("Accruals can only be run by a SuperUser", MessageType.Warning, PositionType.Auto);
                }
            }
        }
 static void Timer_RealTime_Tick(object sender, EventArgs e)
 {
     try
     {
         TimeServer = TimeServer.AddSeconds(1);
         Step10++;
         Step60++;
         Step5++;
         if (Step5 > 5)
         {
             Task.Factory.StartNew(() =>
             {
                 //Viết các hàm xử lý vào đây.
             });
             Step5 = 0;
         }
         if (Step10 > 10)
         {
             Task.Factory.StartNew(() =>
             {
                 CommonBL.LoadDrivers_Active_LastUpdate();
                 CommonBL.LoadVehicles_Active_LastUpdate();
                 Config_Common.LoadConfigCommonByLastUpdate();
             });
             Step10 = 0;
         }
         if (Step60 > 60)
         {
             Task.Factory.StartNew(() =>
             {
                 //Viết các hàm xử lý vào đây.
             });
             Step60 = 0;
         }
     }
     catch (Exception ex)
     {
         LogError.WriteLogError("Timer_RealTime_Tick", ex);
     }
 }
 //JIRA-908 CHanges by Ravi on 13/02/2019 -- Start
 protected void btnYes_Click(object sender, EventArgs e)
 {
     try
     {
         string   message;
         CommonBL commonBl = new CommonBL();
         commonBl.RunRotaltyEngine("Full", out message, out errorId);
         commonBl = null;
         if (errorId == 0)
         {
             msgView.SetMessage(message, MessageType.Warning, PositionType.Auto);
         }
         else if (errorId == 2)
         {
             msgView.SetMessage("Error in triggering royalty engine.", MessageType.Warning, PositionType.Auto);
         }
     }
     catch (Exception ex)
     {
         ExceptionHandler("Error in triggering royalty engine.", ex.Message);
     }
 }
Beispiel #8
0
        //JIRA-938 Changes done by Ravi on 28/01/2019 -- End

        protected void btnAdHocFileLoad_Click(object sender, EventArgs e)
        {
            try
            {
                string   message;
                CommonBL commonBl = new CommonBL();
                commonBl.LoadAdhocCostFile(out message, out errorId);
                commonBl = null;
                if (errorId == 0)
                {
                    msgView.SetMessage(message, MessageType.Warning, PositionType.Auto);
                }
                else if (errorId == 2)
                {
                    msgView.SetMessage("Error in loading Adhoc/Cost file", MessageType.Warning, PositionType.Auto);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler("Error in loading Adhoc/Cost file", ex.Message);
            }
        }
Beispiel #9
0
        public ActionResult Save(JariCompany oJariCompany)
        {
            bool Add_Flag = new CommonBL().isNewEntry(oJariCompany.JariCompanyId);

            try
            {
                if (Add_Flag)
                {
                    new JariCompanyBL().Create(oJariCompany);
                }
                else
                {
                    new JariCompanyBL().Update(oJariCompany);
                }

                return(Json(new { success = true, message = CommonMsg.Success(EntityNames.Company, Add_Flag == true ? En_CRUD.Insert : En_CRUD.Update) }));
            }
            catch (Exception)
            {
                return(Json(new { success = false, message = CommonMsg.Fail(EntityNames.Company, Add_Flag == true ? En_CRUD.Insert : En_CRUD.Update) }));
            }
        }
        public ActionResult DetailsPost(UserDetailsVM objDetailsVM, string Submit, HttpPostedFileBase file)
        {
            CommonBL objCommonBL = null;

            try
            {
                if (Submit == "Save")
                {
                    objUserBL   = new UserBL();
                    objCommonBL = new CommonBL();

                    objDetailsVM.User.Status = 1;
                    if (file != null)
                    {
                        string path = "~/Content/profileimages/" + Guid.NewGuid() + file.FileName;
                        file.SaveAs(Server.MapPath(path));
                        objDetailsVM.User.ImageUrl = path;//.Substring(2, path.Length - 2);
                    }
                    objResponse = objUserBL.SaveUser(objDetailsVM.User, objDetailsVM.User.UserId > 0 ? "U" : "C");
                    objDetailsVM.lstUserTypes = objCommonBL.GetCodeDetail(new CodeDetailFilter()
                    {
                        CodeTypeId = 1
                    });
                    objDetailsVM.Toast = WebCommon.SetToast(objResponse, "User", "Index");
                }
                return(View(objDetailsVM));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                objUserBL    = null;
                objDetailsVM = null;
                objCommonBL  = null;
            }
        }
        /// <summary>
        /// Get data on the form (Adding / Updating)
        /// </summary>
        private void GetDataInput()
        {
            g_KhachDat.StatusRow        = 0;
            g_KhachDat.PK_KhachDatID    = g_IDKhachDat;
            g_KhachDat.FK_CuocGoiID     = g_IDCuocGoi;
            g_KhachDat.TenKhachHang     = txtTenKH.Text.Trim();
            g_KhachDat.DiaChiDon        = txtDiaChi.Text.Trim();
            g_KhachDat.ThoiDiemTiepNhan = calThoiDiemTiepNhan.DateTime;
            g_KhachDat.SoDienThoai      = txtDienThoai.Text.Trim();
            g_KhachDat.VungKenh         = Convert.ToInt16(txtKenh.Value);
            g_KhachDat.TenLoaiXe        = GetThongTinLoaiXeChon2() + " - " + txtLoaiXe.Text;
            g_KhachDat.LoaiXe           = ipLoaiXe.EditValue.ToString();
            g_KhachDat.SoLuongXe        = Convert.ToInt16(txtSoLuong.Text);
            if (rbLapLai.Checked)
            {
                g_KhachDat.IsLapLai            = true;
                g_KhachDat.ThoiDiemKetThuc     = calNgayKetThuc.DateTime.Date.AddDays(1).AddSeconds(-1);
                g_KhachDat.NgayTrongTuanLapLai = GetNgayTrongTuan();
            }
            else
            {
                g_KhachDat.IsLapLai            = false;
                g_KhachDat.ThoiDiemKetThuc     = calNgayKetThuc.DateTime.Date.AddDays(1).AddSeconds(-1);//*sign
                g_KhachDat.NgayTrongTuanLapLai = "";
            }
            g_KhachDat.GioDon         = new DateTime(calNgayBatDau.DateTime.Date.Year, calNgayBatDau.DateTime.Date.Month, calNgayBatDau.DateTime.Date.Day, calGioDon.DateTime.Hour, calGioDon.DateTime.Minute, 0);
            g_KhachDat.ThoiDiemBatDau = calNgayBatDau.DateTime.Date;
            g_KhachDat.SoPhutBaoTruoc = Convert.ToInt16(cbSoPhut.Value);
            g_KhachDat.CreatedBy      = ThongTinDangNhap.USER_ID;
            g_KhachDat.UpdatedBy      = ThongTinDangNhap.USER_ID;
            g_KhachDat.GhiChu         = txtGhiChu.Text.Trim();
            double soTien;

            double.TryParse(txtSoTien.Text.Trim(), out soTien);
            g_KhachDat.SoTien      = soTien;
            g_KhachDat.UpdatedDate = CommonBL.GetTimeServer();
            g_KhachDat.CreatedDate = CommonBL.GetTimeServer();
        }
Beispiel #12
0
        public ActionResult SaveShadeCard()
        {
            ShadeCard oShadeCard = new System.Web.Script.Serialization.JavaScriptSerializer().Deserialize <ShadeCard>(Request["objShadeCard"]);

            bool Add_Flag = new CommonBL().isNewEntry(oShadeCard.ShadeId);

            try
            {
                if (Request.Files != null && Request.Files.Count > 0)
                {
                    using (var binaryReader = new BinaryReader(Request.Files[0].InputStream))
                        oShadeCard.ShadeImage = SiteUtility.ResizeImage(binaryReader.ReadBytes(Request.Files[0].ContentLength), 200, 50);
                }
                else if (oShadeCard.ShadeId != 0)
                {
                    oShadeCard.ShadeImage = new ShadeCardBL().GetById(oShadeCard.ShadeId).ShadeImage;
                }


                oShadeCard.ModifiedBy = oUser.Email;
                oShadeCard.ModifiedOn = DateTime.UtcNow;

                if (Add_Flag)
                {
                    new ShadeCardBL().Create(oShadeCard);
                }
                else
                {
                    new ShadeCardBL().Update(oShadeCard);
                }

                return(Json(new { success = true, message = CommonMsg.Success(EntityNames.Shade, Add_Flag == true ? En_CRUD.Insert : En_CRUD.Update) }));
            }
            catch (Exception ex)
            {
                return(Json(new { success = false, message = CommonMsg.Fail(EntityNames.Shade, Add_Flag == true ? En_CRUD.Insert : En_CRUD.Update) }));
            }
        }
Beispiel #13
0
        public ActionResult Save(tblStudent oStudent)
        {
            try
            {
                bool Add_Flg = new CommonBL().isNewEntry(oStudent.StudentId);
                if (Add_Flg)
                {
                    new StudentBL().Create(oStudent);
                }
                else
                {
                    new StudentBL().Update(oStudent);
                }

                TempData["successmsg"] = CommonMsg.Success_Update(EntityNames.Student);
                return(RedirectToAction("ManageStudent", new { id = oStudent.StudentId }));
            }
            catch (Exception ex)
            {
                TempData["errormsg"] = CommonMsg.Error();
                return(RedirectToAction("Index"));
            }
        }
Beispiel #14
0
        /// <summary>
        /// 添加事件--保存到数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// 创 建 人:HNAS Framework 4.0 项目组
        /// 创建日期:2012/3/15 17:21:32
        /// 修 改 人:
        /// 修改日期:
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            /*获取新添加对象的值*/
            GetBMNewInfor(_classBM);

            /**** 自定义控件值得获取可在这里输入,或者在函数GetBMNewInfor里添加,例如:
             *
             * student.Email = this.ddlContry.Text;
             * student.IfDelete = this.radio.check;
             *
             * ****/

            //存入数据库
            CallResult <string> cr = new CommonBL().Add(_classBM);

            AlertMsn.PopMsn(cr.Message);
            if (!cr.HasError)
            {
                //添加成功,并重新绑定数据
                this.AspNetPager1.CurrentPageIndex = 1;
                BindData(this.AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);
            }
        }
Beispiel #15
0
        protected void btnRunAutoConsolidate_Click(object sender, EventArgs e)
        {
            try
            {
                CommonBL commonBl = new CommonBL();
                commonBl.RunAutoConsolidate(out errorId);
                commonBl = null;

                if (errorId == 0)
                {
                    msgView.SetMessage("Auto Consolidate process is complete. Check email for any consolidation failures. Consolidated Products will require Manager Sign Off before statementing.",
                                       MessageType.Warning, PositionType.Auto);
                }
                else if (errorId == 2)
                {
                    ExceptionHandler("Error in running participant auto consolidate", string.Empty);
                }
            }
            catch (Exception ex)
            {
                ExceptionHandler("Error in running participant auto consolidate", ex.Message);
            }
        }
        // GET: User
        public ActionResult Details()
        {
            CommonBL objCommonBL = null;

            try
            {
                objDetailsVM = new UserDetailsVM();
                objCommonBL  = new CommonBL();
                objDetailsVM.User.IsActiveOnSite = true;
                objDetailsVM.lstUserTypes        = objCommonBL.GetCodeDetail(new CodeDetailFilter()
                {
                    CodeTypeId = 1
                });
                return(View(objDetailsVM));
            }
            catch (Exception ex)
            {
                throw;
            }
            finally
            {
                objCommonBL = null;
            }
        }
Beispiel #17
0
        public string[] GetCompletionList(string prefixText, int count, string contextKey)
        {
            //fiddler
            //http://localhost/ETEM/Services/Common/Common.svc/GetCompletionList
            //User-Agent: Fiddler
            //Host: localhost
            //Content-Length: 92
            //Content-Type: application/json;charset=UTF-8
            //{
            //    "prefixText":"геор",
            //    "count":"10",
            //    "contextKey":"case=StudentAndCandidateByName"
            //}
            if (count == 0)
            {
                count = 10;
            }

            List <string> items = new List <string>();

            items = new CommonBL().GetCompletionList(prefixText, count, contextKey);

            return(items.ToArray <string>());
        }
        public static bool SendInitTrip(CuocGoi objCuocGoi)
        {
            try
            {
                var tenKH = "";
                if (!string.IsNullOrEmpty(objCuocGoi.DiaChiGoi.Trim()))
                {
                    tenKH = string.Format("-[{0}]", objCuocGoi.DiaChiGoi.Trim());
                }
                LatLng currentLatLng = new LatLng {
                    Lat = (float)objCuocGoi.GPS_ViDo, Lng = (float)objCuocGoi.GPS_KinhDo
                };
                var from = new AddressInfo
                {
                    Address = string.Format("{0}{1}", objCuocGoi.DiaChiDonKhach, tenKH),
                    Name    = objCuocGoi.DiaChiDonKhach,
                    LatLng  = currentLatLng
                };
                var to = new AddressInfo
                {
                    Address = objCuocGoi.DiaChiTraKhach,
                    Name    = objCuocGoi.DiaChiTraKhach,
                    LatLng  = new LatLng {
                        Lat = (float)objCuocGoi.GPS_ViDo_Tra, Lng = (float)objCuocGoi.GPS_KinhDo_Tra
                    }
                };
                byte carType = 0;
                if (objCuocGoi.G5_CarType == "" || objCuocGoi.G5_CarType.Split(',').Length > 1)
                {
                    carType = 0;
                }
                else
                {
                    byte.TryParse(objCuocGoi.G5_CarType, out carType);
                }
                byte   customerType   = 0;
                var    vehicleOptions = new List <VehicleOption>();
                string xeDonChiDinh   = ""; // objCuocGoi.XeDenDiem != null && objCuocGoi.XeDenDiem != "" ? objCuocGoi.XeDenDiem : objCuocGoi.XeNhan;
                string xeDieuChiDinh  = ""; // objCuocGoi.TrangThaiCuocGoi == TrangThaiCuocGoiTaxi.DieuLaiAppLaiXe ? string.Empty : xeDonChiDinh;
                if (Config_Common.App_SendRadioTrip && objCuocGoi.XeDenDiem.IndexOf(".") <= 0)
                {
                    xeDonChiDinh  = objCuocGoi.XeDenDiem != null && objCuocGoi.XeDenDiem != "" ? objCuocGoi.XeDenDiem : objCuocGoi.XeNhan;
                    xeDieuChiDinh = objCuocGoi.TrangThaiCuocGoi == TrangThaiCuocGoiTaxi.DieuLaiAppLaiXe ? string.Empty : xeDonChiDinh;
                }
                if (!string.IsNullOrEmpty(xeDieuChiDinh))
                {
                    var lst = xeDieuChiDinh.Split('.');
                    foreach (var s in lst)
                    {
                        vehicleOptions.Add(new VehicleOption
                        {
                            Distance = 0,                            //Khoảng cách
                            Vehicle  = CommonBL.ConvertSangBienSo(s) // Chuyển đổi thành biển số
                        });
                    }
                }
                string[] arrVehicleDeny = null;
                if (!string.IsNullOrEmpty(objCuocGoi.XeNhan))
                {
                    arrVehicleDeny = new string[] { objCuocGoi.XeNhan };
                }
                else if (!string.IsNullOrEmpty(objCuocGoi.XeDungDiem))
                {
                    arrVehicleDeny = new string[] { objCuocGoi.XeDungDiem };
                }
                Direction chieu = Direction.One;
                if (objCuocGoi.Long_ChieuID == 2)
                {
                    chieu = Direction.Two;
                }
                int GiaPhuTroi_Km  = 0;
                int GiaPhuTroi_Gio = 0;
                int LoaiXeID       = 0;
                int.TryParse(objCuocGoi.Long_LoaiXeID, out LoaiXeID);
                if (CommonBL.ListDanhMucVuotGio != null)
                {
                    Data.BanCo.Entity.TuyenThueBao.VuotGioQuyDinh temp = CommonBL.ListDanhMucVuotGio.Find(a => a.FK_LoaiXeID == LoaiXeID);
                    if (temp != null)
                    {
                        if (chieu == Direction.Two)
                        {
                            int.TryParse(temp.GiaDinhMucVuot1KmHaiChieu.ToString(), out GiaPhuTroi_Km);
                            int.TryParse(temp.GiaDinhMucVuot1GioHaiChieu.ToString(), out GiaPhuTroi_Gio);
                        }
                        else
                        {
                            int.TryParse(temp.GiaDinhMucVuot1KmMotChieu.ToString(), out GiaPhuTroi_Km);
                        }
                    }
                }
                BookTripType tripType = BookTripType.Normal;
                if (objCuocGoi.LoaiCuocKhach == LoaiCuocKhach.ChoKhachDuongDai)
                {
                    tripType = BookTripType.Long;
                }
                if (objCuocGoi.BookId == Guid.Empty)//Chưa khởi tạo thì khởi tạo
                {
                    objCuocGoi.BookId = Guid.NewGuid();
                    CuocGoi.G5_DIENTHOAI_UpdateBookIdByIdCuocGoi(objCuocGoi.BookId, objCuocGoi.IDCuocGoi, Enum_G5_Type.DieuApp, objCuocGoi.LenhDienThoai);
                    LogError.WriteLogInfo(string.Format("G5_DIENTHOAI_UpdateBookIdByIdCuocGoi:{0}-{1}-{2} Taxi", objCuocGoi.IDCuocGoi, objCuocGoi.CuocGoiLaiIDs, objCuocGoi.BookId));
                }

                string comment   = objCuocGoi.GhiChuDienThoai;
                string ghichu    = "";
                string showphone = "0";
                if (Config_Common.AppLX_CMDID_ShowPhoneNumber > 0)
                {
                    //{"p":1, "c":"ghi chu"}
                    if (objCuocGoi.GhiChuDienThoai != null && objCuocGoi.GhiChuDienThoai != "")
                    {
                        ghichu = objCuocGoi.GhiChuDienThoai;
                    }
                    if ((objCuocGoi.ShowPhoneAppDriver != null && objCuocGoi.ShowPhoneAppDriver) || objCuocGoi.LenhDienThoai.Contains(CommandCode.LENH_SHOWPHONENUMBER))
                    {
                        showphone = "1";
                    }

                    comment = "{" + string.Format("\"p\":{0}, \"c\":\"{1}\"", showphone, ghichu) + "}";
                }
                //temp.GiaDinhMucVuot1GioHaiChieu
                return(Client.TryGet(p => p.SendInitTrip(
                                         objCuocGoi.BookId,
                                         from,
                                         to,
                                         comment,
                                         (byte)objCuocGoi.SoLuong,
                                         carType,
                                         customerType,
                                         objCuocGoi.PhoneNumber,
                                         vehicleOptions.ToArray(),
                                         currentLatLng,
                                         arrVehicleDeny,
                                         tripType,
                                         objCuocGoi.Money_Contract > 0 ? objCuocGoi.Money_Contract : objCuocGoi.Long_GiaTien,
                                         objCuocGoi.Long_Km,
                                         chieu,
                                         GiaPhuTroi_Km,
                                         GiaPhuTroi_Gio)).Value);
            }
            catch (Exception ex)
            {
                LogError.WriteLogError("App SendInitTrip", ex);
                return(false);
            }
        }
Beispiel #19
0
        public string Date_Checking([FromBody] ProjectModel pModel)
        {
            CommonBL cmbl = new CommonBL();

            return(cmbl.Date_Checking(pModel.ContractDate));
        }
 /// <summary>
 /// Gửi sms khi xe đến điểm gặp khách trong điều xe đường dài! (VD: Ba Sao)
 /// </summary>
 public static bool SendSMS_ReceiveCatchedUser(Guid bookId, string mobile, string privateCode, int money, LoaiCuocKhach loaiCuoc, int giaPhuTroi, int quangduong, TcpOPDirection dir,
                                               string param6 = "", string param7 = "", string param8 = "", string param9 = "", string param10 = "")
 {
     try
     {
         string driverName = "";
         if (CommonBL.DictDriver != null && CommonBL.DictDriver.ContainsKey(privateCode))
         {
             driverName = UnicodeStrings.UnicodeFormat_V2(CommonBL.DictDriver[privateCode].TenNhanVien);
         }
         TcpOPBookTripType tripType = TcpOPBookTripType.Normal;
         if (loaiCuoc == LoaiCuocKhach.ChoKhachDuongDai)
         {
             tripType = TcpOPBookTripType.Long;
         }
         else if (loaiCuoc == LoaiCuocKhach.ChoKhachSanBay)
         {
             tripType = TcpOPBookTripType.Airport;
             #region BaSao : Xe nội thành chở khách đi sân bay mới nhắn tin
             if (license.IsTaxiBaSao)
             {
                 int soXe = 0;
                 if (int.TryParse(privateCode, out soXe)) //Nhiều xe cũng ko gửi sms
                 {
                     if (soXe >= 1000)                    //Xe sân bay của Ba Sao là xe lớn hơn 1000
                     {
                         return(true);
                     }
                 }
             }
             #endregion
         }
         if (Config_Common.SMS_CuocDuongDai_LaiXe)
         {
             return(Client.TryGet(p => p.SendSMS_ReceiveCatchedUser_V2(bookId, mobile, privateCode, driverName, CommonBL.ConvertSangBienSo(privateCode), money, tripType, giaPhuTroi, quangduong, dir, param6, param7, param8, param9, param10)).Value);
         }
         else
         {
             return(Client.TryGet(p => p.SendSMS_ReceiveCatchedUser(bookId, mobile, privateCode, money, tripType, giaPhuTroi, quangduong, dir, param6, param7, param8, param9, param10)).Value);
         }
     }
     catch (Exception ex)
     {
         LogError.WriteLogError("SendSMS_ReceiveCatchedUser", ex);
         return(false);
     }
 }
Beispiel #21
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        /// <param name="iPageIndex">当前页数</param>
        /// <param name="iPageSize">每页显示行数</param>
        /// 创 建 人:HNAS Framework 4.0 项目组
        /// 创建日期:2012/3/15 17:21:33
        /// 修 改 人:
        /// 修改日期:
        protected void BindData(int iPageIndex, int iPageSize)
        {

            _studentBM = new StudentBM();

            //获取textbox查询条件的值    
            base.GetObjValueByTextBox(_studentBM, "txb");
            /**** 自定义控件值得获取可在这里输入,例如:
             * 
             * student.Email = this.ddlContry.Text;
             * student.IfDelete = this.radio.check;
             * 
             * ****/


            /*调用BF查询函数进行查询*/
            //CallResult<DataTable> result = new CommonBL().GetDataTableByLike(_studentBM);//默认

            int? iTotal = 0;//数据总数
            //CallResult<DataTable> result = new CommonBL().GetDataTableByLike(_studentBM, out iTotal, iPageSize, iPageIndex);//数据库分页默认

            #region 自定义查询Demo
            //列过滤
            const string strColumnFilter = "cniID,cniClassID,cnvcSID,cnvcName,cnvcPassword,cniSex,cndBirthDay,cnvcEmail,cniIsAdmin,cniValid";

            //自定义条件(支持比较操作符)
            Dictionary<string, DbParameter> dictionary = new Dictionary<string, DbParameter>();//操作符-参数键值对
            if (!string.IsNullOrEmpty(txbMin.Text.Trim()))
            {
                DbParameter parameter1 = new SqlParameter("cniID", txbMin.Text.Trim());
                dictionary.Add(">=", parameter1);
            }
            if (!string.IsNullOrEmpty(txbMax.Text.Trim()))
            {
                DbParameter parameter2 = new SqlParameter("1cniID", txbMax.Text.Trim());//如查询一个字段的多个区间,请将其中一个参数设置为数字开头的名称
                dictionary.Add("<=", parameter2);
            }

            //参数设置
            CallResult<DataTable> result = new CommonBL().GetDataTableByLike(_studentBM,
                out iTotal,                                                      //数据总数
                iPageSize,                                                      //每页个数
                iPageIndex,                                                   //第几页
                bCache: false, strCacheKey: "StudentCache", //是否缓存(默认false)
                strOrderBy: "cniID ASC",                               //自定义排序
                strColumnFilter: strColumnFilter,                   //列过滤(默认返回所有)
                dicOperator_Parameter: dictionary,               //自定义查询条件(支持比较操作符(等于,不等于,小于,大于,小于等于,大于等于)
                bValidate: false);                                            //是否验证实体(默认false)

            #endregion

            if (result.HasError)
            {
                AspNetPager1.RecordCount = 0;
                AlertMsn.PopMsn(result.Message);
            }

            if (result.Result != null)
            {
                //AspNetPager1.RecordCount = result.Result.Rows.Count;  //不应用数据库分页
                AspNetPager1.RecordCount = iTotal.Value;
                //动态设置用户自定义文本内容
                this.BindPagerCustomInfoHTML(AspNetPager1);
                //页面绑定           
                gvData.PageIndex = AspNetPager1.CurrentPageIndex - 1;
                //鼠标悬停高亮显示
                gvData.RowCreated += this.GridViewRowsChangeColor;
            }

            gvData.DataSource = result.Result;
            gvData.DataBind();
        }
Beispiel #22
0
        /// <summary>
        /// 自定义更新Demo
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// 创 建 人:
        /// 创建日期:2012/2/29 10:57:38
        /// 修 改 人:
        /// 修改日期:
        protected void btnUpdate_Click(object sender, EventArgs e)
        {

            //存入数据库(默认方法:根据主键更新,记录日志,验证实体)
            //CallResult<bool> cr = new CommonBL().Update(_studentBM);

            //自定义条件更新Demo
            //条件参数
            DbParameter[] parameters = new DbParameter[2];
            parameters[0] = new SqlParameter("cniClassID", txbClassID.Text.Trim());
            parameters[1] = new SqlParameter("cniValid", rblValid.SelectedValue);

            //更新内容
            _studentBM.M_Email = txbEmail.Text.Trim();
            //提交更新,不记录日志,不验证实体
            CallResult<bool> cr = new CommonBL().Update(_studentBM, parameters, bLogging: false, bValidate: false);

            #region 生成测试数据
            //IList<StudentBM> iList = new List<StudentBM>();
            //if (_studentBM != null)
            //{
            //    for (int i = 0; i < 10000; i++)
            //    {
            //        StudentBM student = new StudentBM();
            //        GetBMNewInfor(student);
            //        if (i<5000)
            //        {
            //            student.M_ClassID = 40;
            //        }
            //        else
            //        {
            //            student.M_ClassID = 41;
            //        }
            //        student.M_SID = "Student" + i.ToString();
            //        student.M_Name = student.M_SID;
            //        iList.Add(student);
            //    }

            //    //批量添加方法(默认:记录日志,并验证BM实体)
            //    CallResult<bool> cr2 = new CommonBL().Add(iList);

            //    //可设置不记录,不验证BM实体
            //    //cr2 = new CommonBL().Add(iList, bLogging: false, bValidate: false);
            //}
            #endregion

            if (!cr.HasError || cr.Result)
            {
                //修改成功重新绑定数据
                BindData(this.AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);
            }
            AlertMsn.PopMsn(cr.Message);
        }
Beispiel #23
0
        /// <summary>
        /// 修改事件--保存到数据库
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// 创 建 人:HNAS Framework 4.0 项目组
        /// 创建日期:2012/3/15 17:21:32
        /// 修 改 人:
        /// 修改日期:
        protected void btnEdit_Click(object sender, EventArgs e)
        {
            if (ViewState["_subjectBM"]!=null)
            {
                _subjectBM = ViewState["_subjectBM"] as SubjectBM ;// 获取对象主键信息
            }
            /*获取对象的新值*/
            GetBMNewInfor(_subjectBM);
            /**** 自定义控件值得获取可在这里输入,或者在函数GetBMNewInfor里添加,例如:
             * 
             * student.Email = this.ddlContry.Text;
             * student.IfDelete = this.radio.check;
             * 
             * ****/

            //存入数据库
            CallResult<bool> cr = new CommonBL().Update(_subjectBM);
            AlertMsn.PopMsn(cr.Message);
            if (!cr.HasError || cr.Result)
            {
                //修改成功重新绑定数据
                this.AspNetPager1.CurrentPageIndex = 1;
                BindData(this.AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);
            }         
        }
Beispiel #24
0
        /// <summary>
        /// 数据绑定
        /// </summary>
        /// <param name="iPageIndex">当前页数</param>
        /// <param name="iPageSize">每页显示行数</param>
        /// 创 建 人:HNAS Framework 4.0 项目组
        /// 创建日期:2012/3/15 17:21:32
        /// 修 改 人:
        /// 修改日期:
        protected void BindData(int iPageIndex, int iPageSize)
        {
            
            _subjectBM = new SubjectBM();
            
            //获取textbox查询条件的值    
            base.GetObjValueByTextBox(_subjectBM, "txb");
            /**** 自定义控件值得获取可在这里输入,例如:
             * 
             * student.Email = this.ddlContry.Text;
             * student.IfDelete = this.radio.check;
             * 
             * ****/

            int? iTotal = 0;
            /*调用BF查询函数进行查询*/
            CallResult<DataTable> result = new CommonBL().GetDataTableByLike(_subjectBM, out iTotal, iPageSize, iPageIndex);
            //CallResult<DataTable> result = new CommonBL().GetDataTableByLike(_subjectBM);//不分页
            if (result.HasError)
            {
                AspNetPager1.RecordCount = 0;
                AlertMsn.PopMsn( result.Message);
            }

            if (result.Result != null)
            {
                AspNetPager1.RecordCount = iTotal.Value;//result.Result.Rows.Count;(不分页)
                //动态设置用户自定义文本内容
                this.BindPagerCustomInfoHTML(AspNetPager1);
                //页面绑定           
                gvData.PageIndex = AspNetPager1.CurrentPageIndex - 1;
                //鼠标悬停高亮显示
                gvData.RowCreated += new GridViewRowEventHandler(this.GridViewRowsChangeColor);
            }

            gvData.DataSource = result.Result;
            gvData.DataBind();
        }
Beispiel #25
0
        /// <summary>
        /// 添加事件--保存到数据库
        /// </summary>        
        /// <param name="sender"></param>
        /// <param name="e"></param>
        /// 创 建 人:HNAS Framework 4.0 项目组
        /// 创建日期:2012/3/15 17:21:32
        /// 修 改 人:
        /// 修改日期:
        protected void btnAdd_Click(object sender, EventArgs e)
        {
            /*获取新添加对象的值*/
            GetBMNewInfor(_subjectBM);
             /**** 自定义控件值得获取可在这里输入,或者在函数GetBMNewInfor里添加,例如:
             * 
             * student.Email = this.ddlContry.Text;
             * student.IfDelete = this.radio.check;
             * 
             * ****/

            //存入数据库
            CallResult<string> cr = new CommonBL().Add(_subjectBM);

            AlertMsn.PopMsn(cr.Message);
            if (!cr.HasError )
            {
               //添加成功,并重新绑定数据
                this.AspNetPager1.CurrentPageIndex = 1;
                BindData(this.AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);
            }
          
        }
Beispiel #26
0
        /// <summary>
        /// 删除事件--从数据库中删除
        /// </summary>
        /// <param name="subjectBM"></param>
        /// 创 建 人:HNAS Framework 4.0 项目组
        /// 创建日期:2012/3/15 17:21:32
        /// 修 改 人:
        /// 修改日期:
        protected void DelBM(SubjectBM subjectBM)
        {
            // 从数据库中删除
            CallResult<bool> cr = new CommonBL().Delete(subjectBM);//直接使用BL基类方法

            AlertMsn.PopMsn(cr.Message);
            if (!cr.HasError || cr.Result)
            {
                //删除成功重新绑定数据
                this.AspNetPager1.CurrentPageIndex = 1;
                BindData(this.AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);
            }
           
        }
Beispiel #27
0
 private void btnExportExcel_Click(object sender, EventArgs e)
 {
     try
     {
         string FilenameDefault = string.Format("12_BaoCaoKhachQuenTheoThang-{0:yyyy-MM-dd-HH-mm}.xls", CommonBL.GetTimeServer().Date);
         saveFileDialog1.FileName = FilenameDefault;
         if (saveFileDialog1.ShowDialog() == DialogResult.OK)
         {
             FileStream objFile = new FileStream(saveFileDialog1.FileName, FileMode.OpenOrCreate);
             gridEXExporter1.Export(objFile);
             new MessageBox.MessageBoxBA().Show("Tạo file Excel thành công.", "Thông báo");
         }
     }
     catch (Exception ex)
     {
         LogError.WriteLogError("btnExportExcel_Click: ", ex);
     }
 }
        public IHttpActionResult ExistsCheck([FromBody] BaseModel baseModel)
        {
            CommonBL commonBL = new CommonBL();

            return(Ok(commonBL.ExistsCheck(baseModel)));
        }
        private bool IsValid()
        {
            lblMsg.Text      = "";
            lblMsg.ForeColor = Color.Red;
            if (txtTenKH.Text.Trim() == String.Empty)
            {
                lblMsg.Text = "Vui lòng nhập Tên khách hàng";
                txtTenKH.Focus();
                return(false);
            }
            if (txtDiaChi.Text.Trim() == String.Empty)
            {
                lblMsg.Text = "Vui lòng nhập Địa chỉ";
                txtDiaChi.Focus();
                return(false);
            }
            if (txtDienThoai.Text.Trim() == String.Empty)
            {
                lblMsg.Text = "Vui lòng nhập Số điện thoại";
                txtDienThoai.Focus();
                return(false);
            }
            if (txtKenh.Text.Trim() == String.Empty || Convert.ToInt16(txtKenh.Value) <= 0)
            {
                lblMsg.Text = "Vui lòng nhập Vùng/Kênh";
                txtKenh.Focus();
                return(false);
            }
            if (txtSoLuong.Text.Trim() == String.Empty || Convert.ToInt16(txtSoLuong.EditValue) <= 0)
            {
                lblMsg.Text = "Vui lòng nhập Số lượng xe";
                txtSoLuong.Focus();
                return(false);
            }
            if (rbLapLai.Checked && calNgayBatDau.DateTime > DateTime.MinValue && calNgayKetThuc.DateTime > DateTime.MinValue &&
                calNgayBatDau.DateTime.Date > calNgayKetThuc.DateTime.Date)
            {
                lblMsg.Text = "Vui lòng nhập ngày bắt đầu nhỏ hơn hoặc bằng ngày kết thúc";
                calNgayBatDau.Focus();
                return(false);
            }

            if (calNgayBatDau.DateTime.Date < CommonBL.GetTimeServer().Date&& !rbLapLai.Checked)
            {
                lblMsg.Text = "Ngày bắt đầu không được nhỏ hơn thời điểm tiếp nhận!";
                calNgayBatDau.Focus();
                return(false);
            }

            if (calGioDon.DateTime.TimeOfDay < CommonBL.GetTimeServer().TimeOfDay&& calNgayBatDau.DateTime.Date == CommonBL.GetTimeServer().Date&& !rbLapLai.Checked)
            {
                lblMsg.Text = "Giờ đón không được nhỏ hơn thời điểm tiếp nhận";
                calGioDon.Focus();
                return(false);
            }

            double giaTien;

            if (!double.TryParse(txtGiaTien.Text.Trim(), out giaTien))
            {
                lblMsg.Text = "Giá tiền không hợp lệ";
                txtGiaTien.Focus();
                return(false);
            }

            return(true);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="ActiveDirectoryController"/> class.
 /// AccountController.
 /// </summary>
 public ActiveDirectoryController()
 {
     this.commonBL   = new CommonBL();
     this.userDataBL = new UserDataBL();
 }
        private void ShowHienTrangXe(VehicleOnline xeonline, string SoHieuXe)
        {
            #region --Kiem tra tra trang thai xe va dua thong tin vao panel--

            var address = !Taxi.Business.ThongTinCauHinh.GPS_TrangThai ? "" : Service_Common.GetAddressByGeoBA(xeonline.ViDo, xeonline.KinhDo);
            #region Thông tin xe
            pnMarker.Visible = true;
            pnMarker.Refresh();

            if ((xeonline.Trangthai & 3) > 0)
            {
                TrangThaiXe = "Có khách";
            }
            else if ((xeonline.Trangthai & 3) <= 0)
            {
                TrangThaiXe = "Không khách";
            }
            if ((xeonline.Trangthai & 8) == 0)
            {
                may         = "Bật";
                DungXeNoMay = "\r\nDừng xe nổ máy: \t" + xeonline.TGDungXeNoMay;
            }
            else if ((xeonline.Trangthai & 8) > 0)
            {
                may = "Tắt";
            }
            if ((xeonline.Trangthai & 32) > 0)
            {
                DieuHoa = "Tắt";
            }
            else if ((xeonline.Trangthai & 32) == 0)
            {
                DieuHoa = "Bật";
            }

            int.TryParse((xeonline.TGGPS - xeonline.ThoiDiemDiChuyenGanNhat).ToString("mm"), out timedung);

            if ((xeonline.TrangThaiKhac) == -2 && (xeonline.VGPS) >= 3 && timedung < 0)
            {
                DaDung = "";
            }
            else
            {
                DaDung = "\r\nĐã dừng:\t\t" + timedung.ToString() + " phút";
            }

            var    dt       = lienlac.Map_HienTrangXe(SoHieuXe);
            string BienSoXe = "";
            if (dt != null && dt.Rows.Count > 0)
            {
                if (dt.Rows[0]["TenNhanVien"] != null && !dt.Rows[0]["TenNhanVien"].ToString().Equals(""))
                {
                    //TenLaiXe = "Tên lái xe:\t" + dt.Rows[0]["TenNhanVien"].ToString();
                    //Phone = "Sđt:\t" + dt.Rows[0]["DiDong"].ToString();
                    loaixe = dt.Rows[0]["TenLoaiXe"].ToString() + " ";
                    socho  = dt.Rows[0]["SoCho"].ToString();
                    gara   = "\r\nGara: \t\t" + dt.Rows[0]["Name"].ToString();
                }
                else if (dt.Rows[0]["TenNhanVien"].ToString().Equals(""))
                {
                    //TenLaiXe = "Tên lái xe:\t" + dt.Rows[0]["TenNhanVien"].ToString();
                    //Phone = "Sđt:\t" + dt.Rows[0]["DiDong"].ToString();
                    loaixe = dt.Rows[0]["TenLoaiXe"].ToString() + " ";
                    socho  = dt.Rows[0]["SoCho"].ToString();
                    gara   = "\r\nGara: \t\t" + dt.Rows[0]["Name"].ToString();
                }

                BienSoXe = dt.Rows[0]["BienKiemSoat"].ToString();
                loaixe   = dt.Rows[0]["TenLoaiXe"].ToString() + " ";
                socho    = dt.Rows[0]["SoCho"].ToString();
                gara     = "\r\nGara: \t\t" + dt.Rows[0]["Name"].ToString();

                #region Thời điểm kd
                DateTime det  = DateTime.MinValue;
                var      tdkd = string.Empty;
                //txtThoiDiemKD.Visible = true;
                tdkd += string.Format("Tên lX:\t {0}", dt.Rows[0]["TenNhanVien"]);
                tdkd += string.Format("\r\nSDT:\t  {0}", dt.Rows[0]["DiDong"]);
                if (DateTime.TryParse(dt.Rows[0]["ThoiDiemBao"].ToString(), out det) && det > DateTime.MinValue)
                {
                    tdkd += string.Format("\r\nRa KD:         {0:HH:mm dd/MM/yyyy}", dt.Rows[0]["ThoiDiemBao"]);
                }

                #endregion

                string strDiemDo = "";
                var    getInfoKD = lienlac.GetInfoKD(SoHieuXe);

                if (getInfoKD != null && getInfoKD.Rows.Count > 0)
                {
                    DiemDoKhaiBao = dt.Rows[0]["DiemDo"] == DBNull.Value ? 0 : int.Parse(dt.Rows[0]["DiemDo"].ToString());
                    //txtDiemDo.Visible = true;
                    //txtDiemDo.Text = "Điểm đỗ:      " + getInfoKD.Rows[0]["ViTriDiemBao"].ToString()
                    //                        + "\r\nThời điểm:  " + ((DateTime)getInfoKD.Rows[0]["ThoiDiemBao"]).ToString("HH:mm dd/MM/yyyy");
                    strDiemDo = "Điểm đỗ:      " + getInfoKD.Rows[0]["ViTriDiemBao"].ToString()
                                + "\r\nThời điểm:  " + ((DateTime)getInfoKD.Rows[0]["ThoiDiemBao"]).ToString("HH:mm dd/MM/yyyy");
                }
                var getTrangThai = lienlac.GetTrangThaiBySoXe(SoHieuXe);
                if (getTrangThai != null && getTrangThai.Rows.Count > 0)
                {
                    //txtDiemDo.Text = txtDiemDo.Text + "\r\nTrạng thái:   " + getTrangThai.Rows[0]["TrangThai"];
                    strDiemDo += "\r\nTrạng thái:   " + getTrangThai.Rows[0]["TrangThai"];
                    if (getTrangThai.Rows[0]["LyDoVe"] != DBNull.Value && string.IsNullOrEmpty(getTrangThai.Rows[0]["LyDoVe"].ToString()))
                    {
                        strDiemDo += "\r\nLý do về:     " + getTrangThai.Rows[0]["LyDoVe"];
                        //txtDiemDo.Text = txtDiemDo.Text + "\r\nLý do về:     " + getTrangThai.Rows[0]["LyDoVe"];
                    }
                }

                txtThoiDiemKD.Text = tdkd + "\r\n" + strDiemDo;
            }
            else
            {
                BienSoXe = xeonline.BienSoXe;
                var strXeKhongKD = string.Empty;
                //kiểm tra xem có xin nghỉ ko đi kinh doanh không - nếu có thì hiển hị lý do nghỉ
                var nghi = lienlac.GetVehicleNotWorkingBySoXe(SoHieuXe);
                if (nghi != null && nghi.Rows.Count > 0)
                {
                    strXeKhongKD += string.Format("\r\nLý do nghỉ: {0}", nghi.Rows[0]["ReasonName"]);
                }
                txtThoiDiemKD.Text = strXeKhongKD;
            }
            DataTable dtVungDh = (new VungDieuHanh()).VDHById(xeonline.VungID);
            if (dtVungDh != null && dtVungDh.Rows.Count > 0)
            {
                vdh       = dtVungDh.Rows[0]["NameVungDH"].ToString();
                DiemDoGPS = int.Parse(dtVungDh.Rows[0]["Id"].ToString());
            }
            else
            {
                vdh       = "Không xác định";
                DiemDoGPS = 0;
            }

            DateTime  hientai     = CommonBL.GetTimeServer();
            DataTable dtCheckAnCa = lienlac.CheckAnCa(SoHieuXe);

            if (dtCheckAnCa.Rows.Count > 0)
            {
                switch (int.Parse(dtCheckAnCa.Rows[0]["TrangThaiLaiXeBao"].ToString()))
                {
                case 6:
                    TrangThaiLaiXe = "ăn ca";
                    break;

                case 7:
                    TrangThaiLaiXe = "rời xe";
                    break;

                case 11:
                    TrangThaiLaiXe = "mất liên lạc";
                    break;
                }
                ThoiDiemCB = DateTime.Parse(dtCheckAnCa.Rows[0]["ThoiDiemBao"].ToString());
                var tongtime     = (hientai - ThoiDiemCB);
                var SoPhut       = 0;
                var strSoPhutBao = "";
                int.TryParse(dtCheckAnCa.Rows[0]["SoPhutNghi"].ToString(), out SoPhut);
                if (SoPhut > 0)
                {
                    strSoPhutBao = " " + SoPhut + " phút";
                }
                if (TrangThaiLaiXe != "")
                {
                    TrangThaiLaiXe = ((dt.Rows.Count == 1 && dt.Rows[0]["IsHoatDong"].ToString().Contains("1"))
                        ? ""
                        : "Báo " + TrangThaiLaiXe + strSoPhutBao + "\r\nThời điểm: " + ThoiDiemCB.ToString("HH:mm dd/MM/yyyy"));
                    //txtCanhBao.Visible = true;
                    txtCanhBao.Text = TrangThaiLaiXe
                                      + (TrangThaiLaiXe == "" ? "" : "\r\nTổng thời gian: " + tongtime.Hours + " giờ " + tongtime.Minutes + " phút");
                }
            }

            //txtAddress.BackColor = Color.FromArgb(250, 246, 237);
            txtInfoHeader.ForeColor = Color.Red;
            txtInfoHeader.TextAlign = HorizontalAlignment.Center;
            txtInfoHeader.Font      = new Font(txtInfoHeader.Font, FontStyle.Bold);
            txtInfoHeader.Height    = 26;
            txtInfoHeader.Width     = 437;
            txtInfoHeader.Text      = "   Hiện trạng xe: " + SoHieuXe + "-" + BienSoXe;
            txtInfoHeader.ReadOnly  = true;

            txtVitri.Text = "Vị trí: " + address;

            txtInfoXe.Text = "Loại xe: \t\t" + loaixe + socho + " chỗ"
                             + "\r\nNgày/giờ: \t" + xeonline.TGGPS.ToString("HH:mm dd/MM/yyyy");

            //if (!string.IsNullOrEmpty(TenLaiXe))
            //{
            //    txtInfoXe.Text += "\r\n" + TenLaiXe;
            //}
            //if (!string.IsNullOrEmpty(Phone))
            //{
            //    txtInfoXe.Text += "\r\n" + Phone;
            //}
            string strInfoXe = "Loại xe: \t\t" + loaixe + socho + " chỗ"
                               + "\r\nNgày/giờ:  \t" + xeonline.TGGPS.ToString("HH:mm dd/MM/yyyy");
            if (TenLaiXe != null && TenLaiXe != "")
            {
                strInfoXe += "\r\n" + TenLaiXe;
            }
            if (Phone != null && Phone != "")
            {
                strInfoXe += "\r\n" + Phone;
            }

            strInfoXe += "\r\nVận tốc GPS/Cơ: \t" + xeonline.VGPS + "/" + xeonline.VCo + " Km/h";
            if (gara != "")
            {
                strInfoXe += gara;
            }
            if (DieuHoa != "")
            {
                strInfoXe += "\r\nĐiều hòa: \t" + DieuHoa;
            }
            if (DungXeNoMay != "")
            {
                strInfoXe += DungXeNoMay;
            }
            if (may != "")
            {
                strInfoXe += "\r\nMáy: \t\t" + may;
            }
            if (TrangThaiXe != "")
            {
                strInfoXe += "\r\nTrạng thái xe: \t" + TrangThaiXe;
            }
            if (vdh != "")
            {
                strInfoXe += "\r\nĐiểm đỗ:\t\t" + vdh;
            }
            if (DaDung != "")
            {
                strInfoXe += DaDung;
            }

            txtInfoXe.Text = strInfoXe;
            #endregion
            #region Doanh thu xe
            string strDoanhThuXe = "";
            var    info          = System.Globalization.CultureInfo.GetCultureInfo("vi-VN");

            var objTongCuoc = new Taxi.Services.WCFServices.TongCuoc_Ca();
            if (Global.HasGPS)
            {
                objTongCuoc = WCFService_Common.GetTongCuoc(BienSoXe, false);
            }
            if (objTongCuoc != null)
            {
                double kmCoKhach         = objTongCuoc.kmCoKhachField;
                double kmRong            = objTongCuoc.kmRongField;
                string strKmCoKhach_Rong = "";
                if (xeonline.KmWithPassenger > 0)
                {
                    kmCoKhach            = kmCoKhach - xeonline.KmWithPassenger;
                    xeonline.WaitingTime = xeonline.WaitingTime > 0 ? xeonline.WaitingTime : 0;
                }
                kmRong            = kmRong + xeonline.EmptyKm;
                strKmCoKhach_Rong = String.Format("{0} km/{1} km", kmCoKhach, kmRong);

                strDoanhThuXe = String.Format("Tổng cuốc:\t{0}", objTongCuoc.tongCuocKhachField);
                if (kmCoKhach > 0)
                {
                    strDoanhThuXe += String.Format("\r\nKm CK/Rỗng:\t{0}", strKmCoKhach_Rong);
                }

                strDoanhThuXe += String.Format(info, "\r\nTổng doanh thu:\t{0:c0}", objTongCuoc.tongTienField);
            }

            if ((xeonline.Trangthai & 3) > 0)
            {
                strDoanhThuXe += String.Format(info, "\r\nTiền cuốc ht:\t{0:c0}", xeonline.Money);
                strDoanhThuXe += String.Format("\r\nThời gian chờ:\t{0} phút", xeonline.FreeWatingTime);
                strDoanhThuXe += String.Format("\r\nKm cuốc đang chạy: {0} km", xeonline.KmWithPassenger);
            }
            txtDoanhThu.Text = strDoanhThuXe;

            #endregion
            #region Thông tin cuốc hàng

            var cuochang = "";
            if (Global.TaxiOperation_Module == TaxiOperation_Module.DieuXeTai ||
                Global.TaxiOperation_Module == TaxiOperation_Module.Luong)
            {
                var db = new TaxiOperation_Truck().GetTruckBySoXe(SoHieuXe.Trim());
                if (db != null)
                {
                    cuochang += string.Format("ĐC đón:    {0}", db.DiaChiDon);
                    cuochang += string.Format("\r\nĐiện thoại:{0}", db.SoDT);
                    cuochang += string.Format("\r\nTG Điều:   {0:HH:mm dd/MM}", db.TGDieuXe);
                    if (db.TGGap != null)
                    {
                        cuochang += string.Format("\r\nTG Gặp KH: {0:HH:mm dd/MM}", db.TGGap);
                    }
                    if (!String.IsNullOrEmpty(db.DiaChiTra))
                    {
                        cuochang += string.Format("\r\nĐC Trả:   {0}", db.DiaChiTra);
                    }
                }
                txtCuocHang.Text      = cuochang;
                txtCuocHang.ForeColor = Color.Black;
                txtCuocHang.Font      = new Font(txtCuocHang.Font.FontFamily, txtCuocHang.Font.Size, FontStyle.Bold);
            }
            #endregion
            pnMarker.Controls.Add(txtInfoHeader);
            pnMarker.BackColor = Color.White;

            #endregion -------------------End-------------------------------
        }
Beispiel #32
0
        /// <summary>
        /// 删除事件--从数据库中删除
        /// </summary>
        /// <param name="studentBM"></param>
        /// 创 建 人:HNAS Framework 4.0 项目组
        /// 创建日期:2012/3/15 17:21:33
        /// 修 改 人:
        /// 修改日期:
        protected void DelBM(StudentBM studentBM)
        {
            // 从数据库中删除(默认删除方法:根据主键删除,记录日志,不验证实体)
            CallResult<bool> cr = new CommonBL().Delete(studentBM);//直接使用BL基类方法//自定义删除参考ClassDA.cs

            AlertMsn.PopMsn(cr.Message);
            if (!cr.HasError || cr.Result)
            {
                //删除成功重新绑定数据
                this.AspNetPager1.CurrentPageIndex = 1;
                BindData(this.AspNetPager1.CurrentPageIndex, AspNetPager1.PageSize);
            }
           
        }
        public IHttpActionResult DateCheck([FromBody] BaseModel baseModel)
        {
            CommonBL commonBL = new CommonBL();

            return(Ok(commonBL.Date_Checking(baseModel.param1)));
        }
        public IHttpActionResult ByteLengthCheck([FromBody] BaseModel baseModel)
        {
            CommonBL commonBL = new CommonBL();

            return(Ok(commonBL.ByteLengthCheck(baseModel)));
        }
Beispiel #35
0
 /// <summary>
 /// Initializes a new instance of the <see cref="AccountController"/> class.
 /// AccountController.
 /// </summary>
 public AccountController()
 {
     this.commonBL   = new CommonBL();
     this.userDataBL = new UserDataBL();
 }
Beispiel #36
0
 private void TimXe(string soHieuXe)
 {
     try
     {
         if (SearchType.EditValue.To <int>() == 1)
         {
             T_XeOnline XeOnline = new T_XeOnline();
             XeOnline = new SyncServiceOnlineClient().GetXeOnlineBySHX(soHieuXe);
             if (XeOnline == null)
             {
                 new MessageBox.MessageBoxBA().Show(string.Format("Không tồn tại xe {0} trên hệ thống", soHieuXe),
                                                    "Thông Báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Error);
             }
             else
             {
                 if (XeOnline.TrangThaiKhac < 0)
                 {
                     new MessageBox.MessageBoxBA().Show(
                         string.Format("Xe {0} đã mất tín hiệu " + XeOnline.TrangThaiKhacText, soHieuXe),
                         "Thông Báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Error);
                 }
                 else
                 {
                     //PointLatLng point = new PointLatLng(XeOnline.ViDo, XeOnline.KinhDo);
                     string strDiaChi = string.Format("[{0}]:{1}", soHieuXe,
                                                      Taxi.Services.Service_Common.GetAddressByGeoBA((float)XeOnline.ViDo,
                                                                                                     (float)XeOnline.KinhDo));
                     int trangThai = 0; //xe tắt máy
                     if ((XeOnline.TrangThai & 3) > 0)
                     {
                         trangThai = 2; //xe co khach
                     }
                     else if ((XeOnline.TrangThai & 8) == 0)
                     {
                         trangThai = 1; //xe bật máy.
                     }
                     MainMap.AddMarkerXeG5(trangThai, XeOnline.KinhDo, XeOnline.ViDo, strDiaChi);
                     MainMap.Position = new PointLatLng(XeOnline.ViDo, XeOnline.KinhDo);
                 }
             }
         }
         else
         {
             string bienso = CommonBL.ConvertSangBienSo(soHieuXe);
             if (string.IsNullOrEmpty(bienso))
             {
                 new MessageBox.MessageBoxBA().Show(string.Format("Không tồn tại xe {0} trên danh sách xe hệ thống", soHieuXe),
                                                    "Thông Báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Error);
                 return;
             }
             var rs = Service_Common.ServiceG5.TryGet(p => p.GetVehicleOnlne(bienso));
             //if (Global.IsDebug)
             //    new MessageBox.MessageBox().Show(string.Format(bienso));
             if (rs.Success && rs.Value != null)
             {
                 string strDiaChi = string.Format("[{0}]:{1}", soHieuXe,
                                                  Service_Common.GetAddressByGeoBA((float)rs.Value.Lat, (float)rs.Value.Lng));
                 int trangThai = 0;                //xe tắt máy
                 if ((rs.Value.Status & 4096) > 0) //4096  sẵn sàng
                 {
                     trangThai = 1;                //xe sẵn sàng
                 }
                 else if ((rs.Value.Status & 8) == 0)
                 {
                     //     trangThai = 1; //xe bật máy.
                 }
                 //MainMap.MarkerCustomer
                 MainMap.AddMarkerXeG5(trangThai, (float)rs.Value.Lng, (float)rs.Value.Lat, strDiaChi);
                 MainMap.Position = new PointLatLng((float)rs.Value.Lat, (float)rs.Value.Lng);
             }
             else
             {
                 new MessageBox.MessageBoxBA().Show(string.Format("Không tìm thấy vị trí xe {0} trên hệ thống", soHieuXe),
                                                    "Thông Báo", Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Error);
             }
         }
     }
     catch
     (Exception ex)
     {
         new MessageBox.MessageBoxBA().Show("Lỗi, không tìm thấy xe", "Thông báo lỗi",
                                            Taxi.MessageBox.MessageBoxButtonsBA.OK, Taxi.MessageBox.MessageBoxIconBA.Error);
     }
 }
 private void btnSave_Click(object sender, EventArgs e)
 {
     try
     {
         if (!CheckValidate())
         {
             return;
         }
         T_DOITAC.Inst.UpdateNewAddress(MaDoiTac, txtDiaChiMoi.Text, TraceID, ThongTinDangNhap.USER_ID, CommonBL.GetTimeServer());
         new MessageBox.MessageBoxBA().Show("Duyệt địa chỉ mới thành công!", "Thông báo");
         IsSuccess = true;
         this.Close();
     }
     catch
     {
         new MessageBox.MessageBoxBA().Show("Có lỗi khi lưu dữ liệu!", "Thông báo");
     }
 }