Beispiel #1
0
        /// <summary>
        /// 获取查询信息
        /// </summary>
        /// <returns></returns>
        MBill GetChaXunInfo()
        {
            MBill info = new MBill();

            info.CompanyId = CurrentUserCompanyID;
            info.TourCode  = Utils.GetQueryStringValue("txt_teamNumber");
            decimal billAmount = Utils.GetDecimal(Utils.GetQueryStringValue("billAmount"), -1);

            if (billAmount > 0)
            {
                info.BillAmount = billAmount;
            }
            info.SellerId   = txt_Seller.SellsID = Utils.GetQueryStringValue(txt_Seller.SellsIDClient);
            info.SellerName = txt_Seller.SellsName = Utils.GetQueryStringValue(txt_Seller.SellsNameClient);
            info.CustomerId = Utils.GetQueryStringValue(CustomerUnitSelect1.ClientNameKHBH);
            info.Customer   = Utils.GetQueryStringValue(CustomerUnitSelect1.ClientNameKHMC);
            info.BillTimeS  = Utils.GetQueryStringValue("billTimeS");
            info.BillTimeE  = Utils.GetQueryStringValue("billTimeE");

            return(info);
        }
Beispiel #2
0
        /// <summary>
        /// 获取参数并验证
        /// </summary>
        /// <param name="model">赋值实体</param>
        /// <param name="msg">验证提示语</param>
        /// <returns></returns>
        private string UpdateModel()
        {
            BFinance bll   = new BFinance();
            MBill    model = new MBill();
            string   msg   = string.Empty;

            #region 表单验证
            if (Utils.GetFormValue("doType") == "Update" && Utils.GetFormValue("Id").Trim() == "")
            {
                msg = "无法修改该数据!<br/>";
            }

            if (Utils.GetDateTimeNullable(Utils.GetFormValue("openInvoiceDate")) == null)
            {
                msg += "请输入开票时间!<br/>";
            }

            if (Utils.GetDecimal(Utils.GetFormValue("openInvoiceMoney")) == 0)
            {
                msg += "请输入开票金额!";
            }

            if (msg != "")
            {
                return(msg);
            }
            #endregion

            #region 实体赋值
            model.Id       = Utils.GetInt(Utils.GetFormValue("Id"), 0);
            model.TourId   = Utils.GetFormValue("TourId");
            model.TourCode = Utils.GetFormValue("TourCode");
            if (model.TourCode.Length <= 0)
            {
                MTourBaseInfo tourModel = new BTour().GetTourInfo(model.TourId);
                if (tourModel != null)
                {
                    model.TourCode = tourModel.TourCode;
                }
            }
            //订单编号
            model.OrderId = Utils.GetFormValue("OrderId");
            //开票单位Id
            model.CustomerId = Utils.GetFormValue("CustomerId");
            //开票单位
            model.Customer = Utils.GetFormValue("Customer");
            //销售员
            model.SellerName = Server.UrlDecode(Utils.GetFormValue("SellerName"));
            model.SellerId   = Utils.GetFormValue("SellerId");
            //开票人
            model.DealerId = SiteUserInfo.UserId;
            model.Dealer   = SiteUserInfo.Name;
            //操作员名称
            model.Operator   = SiteUserInfo.Name;
            model.OperatorId = SiteUserInfo.UserId;
            //客户单位联系电话
            model.ContactName  = Server.UrlDecode(Utils.GetFormValue("Contact"));
            model.ContactPhone = Utils.GetFormValue("Phone");
            //操作时间
            model.IssueTime = DateTime.Now;
            //操作员部门编号
            model.DeptId = SiteUserInfo.DeptId;
            //系统公司
            model.CompanyId = CurrentUserCompanyID;
            //开票时间
            model.BillTime = Utils.GetDateTime(Utils.GetFormValue("openInvoiceDate"));
            //开票金额
            model.BillAmount = Utils.GetDecimal(Utils.GetFormValue("openInvoiceMoney"));
            model.Remark     = Utils.GetFormValue("openInvoiceRemar");
            #endregion

            if (!bll.AddOrUpdBill(model))
            {
                msg = "开票失败!";
            }
            return(msg);
        }