Exemplo n.º 1
0
        public static SeltEntity ReLoadDetialInfo(SeltEntity seltEntity)
        {
            SeltDBEntity dbParm = (seltEntity.SeltDBEntity.Count > 0) ? seltEntity.SeltDBEntity[0] : new SeltDBEntity();
            OracleParameter[] parm ={
                                     new OracleParameter("UnitID",OracleType.VarChar)
                                };
            parm[0].Value = dbParm.SeltID;
            DataSet dsResult = DbManager.Query("Settlement", "t_lm_settlement_unit_detail_select", true, parm);

            if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
            {
                dsResult.Tables[0].Rows[0]["settlement_sales_nm"] = UserSearchDA.GetSalesName(dsResult.Tables[0].Rows[0]["settlement_sales"].ToString().Trim());
            }

            seltEntity.QueryResult = dsResult;

            OracleParameter[] lmparm ={
                                     new OracleParameter("UnitID",OracleType.VarChar)
                                };
            lmparm[0].Value = dbParm.SeltID;

            DataTable dtHotelList = DbManager.Query("Settlement", "t_lm_settlement_unit_detail_hotel_select", true, lmparm).Tables[0];

            for (int i = 0; i < dtHotelList.Rows.Count; i++)
            {
                dtHotelList.Rows[i]["ODTYPE"] = ((dtHotelList.Rows[i]["PRICECD"].ToString().Trim().Substring(0, 1) == "1") ? "预付 " : "") + ((dtHotelList.Rows[i]["PRICECD"].ToString().Trim().Substring(1, 1) == "1") ? "现付" : "");
            }

            seltEntity.SeltDBEntity[0].dtHotelList = dtHotelList;
            return seltEntity;
        }
Exemplo n.º 2
0
        public static SeltEntity SaveSettlementInfo(SeltEntity seltEntity)
        {
            seltEntity.LogMessages.MsgType = MessageType.INFO;
            seltEntity.LogMessages.Content = _nameSpaceClass + "SaveSettlementInfo";
            LoggerHelper.LogWriter(seltEntity.LogMessages);

            try
            {
                return SeltDA.SaveSettlementInfo(seltEntity);
            }
            catch (Exception ex)
            {
                seltEntity.LogMessages.MsgType = MessageType.ERROR;
                seltEntity.LogMessages.Content = _nameSpaceClass + "SaveSettlementInfo  Error: " + ex.Message;
                LoggerHelper.LogWriter(seltEntity.LogMessages);
                throw ex;
            }
        }
Exemplo n.º 3
0
        public static SeltEntity ReviewSelectCount(SeltEntity seltEntity)
        {
            seltEntity.LogMessages.MsgType = MessageType.INFO;
            seltEntity.LogMessages.Content = _nameSpaceClass + "ReviewSelectCount";
            LoggerHelper.LogWriter(seltEntity.LogMessages);

            try
            {
                return SeltDA.ReviewSelectCount(seltEntity);
            }
            catch (Exception ex)
            {
                seltEntity.LogMessages.MsgType = MessageType.ERROR;
                seltEntity.LogMessages.Content = _nameSpaceClass + "ReviewSelectCount  Error: " + ex.Message;
                LoggerHelper.LogWriter(seltEntity.LogMessages);
                throw ex;
            }
        }
Exemplo n.º 4
0
        public static SeltEntity ReviewSelect(SeltEntity seltEntity)
        {
            SeltDBEntity dbParm = (seltEntity.SeltDBEntity.Count > 0) ? seltEntity.SeltDBEntity[0] : new SeltDBEntity();
            OracleParameter[] parm ={
                                     new OracleParameter("UnitName",OracleType.VarChar),
                                    new OracleParameter("CityID",OracleType.VarChar),
                                    new OracleParameter("InvoiceName",OracleType.VarChar)
                                };
            if (String.IsNullOrEmpty(dbParm.UnitNm))
            {
                parm[0].Value = DBNull.Value;
            }
            else
            {
                parm[0].Value = dbParm.UnitNm;
            }

            if (String.IsNullOrEmpty(dbParm.CityID))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.CityID;
            }

            if (String.IsNullOrEmpty(dbParm.InvoiceNm))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.InvoiceNm;
            }

            seltEntity.QueryResult = DbManager.Query("Settlement", "t_lm_settlement_unit_select", parm, (seltEntity.PageCurrent - 1) * seltEntity.PageSize, seltEntity.PageSize, true);

            return seltEntity;
        }
Exemplo n.º 5
0
        public static SeltEntity SaveSettlementInfo(SeltEntity seltEntity)
        {
            SeltDBEntity dbParm = (seltEntity.SeltDBEntity.Count > 0) ? seltEntity.SeltDBEntity[0] : new SeltDBEntity();

            List<CommandInfo> cmdList = new List<CommandInfo>();
            CommandInfo cminfo = new CommandInfo();
            OracleParameter[] parm ={
                                    new OracleParameter("ID",OracleType.VarChar),
                                    new OracleParameter("UNIT_NAME",OracleType.VarChar),
                                    new OracleParameter("INVOICE_NAME",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_TERM",OracleType.VarChar),
                                    new OracleParameter("HOTEL_TAX",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_ADDRESS",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_PER",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_TEL",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_FAX",OracleType.VarChar),
                                    new OracleParameter("SETTLEMENT_SALES",OracleType.VarChar),
                                    new OracleParameter("BILL_ITEM",OracleType.VarChar),
                                    new OracleParameter("HOTEL_TAXNO",OracleType.VarChar),
                                    new OracleParameter("HOTEL_PAYNO",OracleType.VarChar),
                                    new OracleParameter("STATUS",OracleType.VarChar),
                                    new OracleParameter("CREATE_USER",OracleType.VarChar),
                                    new OracleParameter("TERM_STDT",OracleType.VarChar)
                                };

            string strSQL = "";
            if (String.IsNullOrEmpty(dbParm.SeltID))
            {
                parm[0].Value = getMaxIDfromSeq("T_LM_SETTLEMENT_UNIT_SEQ");
                strSQL = "t_lm_settlement_unit_insert";
            }
            else
            {
                parm[0].Value = dbParm.SeltID;
                strSQL = "t_lm_settlement_unit_update";
            }

            if (String.IsNullOrEmpty(dbParm.UnitNm))
            {
                parm[1].Value = DBNull.Value;
            }
            else
            {
                parm[1].Value = dbParm.UnitNm;
            }

            if (String.IsNullOrEmpty(dbParm.InvoiceNm))
            {
                parm[2].Value = DBNull.Value;
            }
            else
            {
                parm[2].Value = dbParm.InvoiceNm;
            }

            if (String.IsNullOrEmpty(dbParm.Term))
            {
                parm[3].Value = DBNull.Value;
            }
            else
            {
                parm[3].Value = dbParm.Term;
            }

            if (String.IsNullOrEmpty(dbParm.Tax))
            {
                parm[4].Value = DBNull.Value;
            }
            else
            {
                parm[4].Value = dbParm.Tax;
            }

            if (String.IsNullOrEmpty(dbParm.Address))
            {
                parm[5].Value = DBNull.Value;
            }
            else
            {
                parm[5].Value = dbParm.Address;
            }

            if (String.IsNullOrEmpty(dbParm.Per))
            {
                parm[6].Value = DBNull.Value;
            }
            else
            {
                parm[6].Value = dbParm.Per;
            }

            if (String.IsNullOrEmpty(dbParm.Tel))
            {
                parm[7].Value = DBNull.Value;
            }
            else
            {
                parm[7].Value = dbParm.Tel;
            }

            if (String.IsNullOrEmpty(dbParm.Fax))
            {
                parm[8].Value = DBNull.Value;
            }
            else
            {
                parm[8].Value = dbParm.Fax;
            }

            if (String.IsNullOrEmpty(dbParm.Sales))
            {
                parm[9].Value = DBNull.Value;
            }
            else
            {
                parm[9].Value = dbParm.Sales;
            }

            if (String.IsNullOrEmpty(dbParm.BillItem))
            {
                parm[10].Value = DBNull.Value;
            }
            else
            {
                parm[10].Value = dbParm.BillItem;
            }

            if (String.IsNullOrEmpty(dbParm.TaxNo))
            {
                parm[11].Value = DBNull.Value;
            }
            else
            {
                parm[11].Value = dbParm.TaxNo;
            }

            if (String.IsNullOrEmpty(dbParm.PayNo))
            {
                parm[12].Value = DBNull.Value;
            }
            else
            {
                parm[12].Value = dbParm.PayNo;
            }

            parm[13].Value = dbParm.Status;
            parm[14].Value = seltEntity.LogMessages.Username;
            parm[15].Value = dbParm.TermStDt;

            cminfo.CommandText = XmlSqlAnalyze.GotSqlTextFromXml("Settlement", strSQL);
            cminfo.Parameters = parm;
            cmdList.Add(cminfo);

            CommandInfo cmUpinfo = new CommandInfo();
            OracleParameter[] upparm ={
                                    new OracleParameter("UNIT_ID",OracleType.VarChar),
                                    new OracleParameter("CREATE_USER",OracleType.VarChar)
                                };

            upparm[0].Value = parm[0].Value;
            upparm[1].Value = seltEntity.LogMessages.Username;

            cmUpinfo.CommandText = XmlSqlAnalyze.GotSqlTextFromXml("Settlement", "t_lm_settlement_unit_hotel_update");
            cmUpinfo.Parameters = upparm;
            cmdList.Add(cmUpinfo);

            DataTable dtHotel = dbParm.dtHotelList;
            string strHotelSQL = XmlSqlAnalyze.GotSqlTextFromXml("Settlement", "t_lm_settlement_unit_hotel_save");
            for (int i = 0; i <= dtHotel.Rows.Count - 1; i++)
            {
                CommandInfo cmhinfo = new CommandInfo();
                cmhinfo.CommandText = strHotelSQL;
                OracleParameter[] lmParm ={
                                    new OracleParameter("UNIT_ID",OracleType.VarChar),
                                    new OracleParameter("HOTEL_ID",OracleType.VarChar),
                                    new OracleParameter("PRICE_CODE",OracleType.VarChar),
                                    new OracleParameter("VENDOR",OracleType.VarChar),
                                    new OracleParameter("STATUS",OracleType.VarChar),
                                    new OracleParameter("CREATE_USER",OracleType.VarChar)
                                };

                lmParm[0].Value = parm[0].Value;
                lmParm[1].Value = dtHotel.Rows[i]["HOTELID"].ToString();
                lmParm[2].Value = dtHotel.Rows[i]["PRICECD"].ToString();
                lmParm[3].Value = dtHotel.Rows[i]["VENDOR"].ToString();
                lmParm[4].Value = "1";
                lmParm[5].Value = seltEntity.LogMessages.Username;
                cmhinfo.Parameters = lmParm;
                cmdList.Add(cmhinfo);
            }

            DbHelperOra.ExecuteSqlTran(cmdList);
            seltEntity.Result = 1;

            return seltEntity;
        }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string strErrMsg = string.Empty;
        bool bFlag = true;

        if (String.IsNullOrEmpty(txt_UnitNm.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave1").ToString() + "&nbsp;";
            bFlag = false;
        }
        if (String.IsNullOrEmpty(txt_InvoiceNm.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave2").ToString() + "&nbsp;";
            bFlag = false;
        }
        if (String.IsNullOrEmpty(txt_tax.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave3").ToString() + "&nbsp;";
            bFlag = false;
        }
        else
        {
            if (!ChkBalVal(txt_tax.Text.Trim()))
            {
                strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave13").ToString() + "&nbsp;";
                bFlag = false;
            }
        }
        if (String.IsNullOrEmpty(txt_Per.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave4").ToString() + "&nbsp;";
            bFlag = false;
        }
        if (String.IsNullOrEmpty(txt_Tel.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave5").ToString() + "&nbsp;";
            bFlag = false;
        }
        if (String.IsNullOrEmpty(txt_fax.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave6").ToString() + "&nbsp;";
            bFlag = false;
        }

        if (String.IsNullOrEmpty(hidSales.Value.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave7").ToString() + "&nbsp;";
            bFlag = false;
        }
        else
        {
            if (!hidSales.Value.Trim().Contains("[") || !hidSales.Value.Trim().Contains("]"))
            {
                strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave14").ToString() + "&nbsp;";
                bFlag = false;
            }
        }

        if (String.IsNullOrEmpty(txt_address.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave8").ToString() + "&nbsp;";
            bFlag = false;
        }
        if (String.IsNullOrEmpty(txt_billItem.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave9").ToString() + "&nbsp;";
            bFlag = false;
        }
        if (String.IsNullOrEmpty(txt_taxno.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave10").ToString() + "&nbsp;";
            bFlag = false;
        }
        if (String.IsNullOrEmpty(txt_payno.Text.Trim()))
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave11").ToString() + "&nbsp;";
            bFlag = false;
        }
        if (gridViewHotelList.Rows.Count == 0)
        {
            strErrMsg = strErrMsg + GetLocalResourceObject("ErrorSave12").ToString() + "&nbsp;";
            bFlag = false;
        }

        if (!bFlag)
        {
            dvUnitMessageContent.InnerHtml = strErrMsg;
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "invokeOpenList();", true);
            return;
        }

        DataTable dtResult;
        dtResult = new DataTable();
        dtResult.Columns.Add("HOTELID");
        dtResult.Columns.Add("HOTELNM");
        dtResult.Columns.Add("ODTYPE");
        dtResult.Columns.Add("PRICECD");
        dtResult.Columns.Add("VENDOR");
        dtResult.Columns.Add("ACTYPE");
        string strHotelList = string.Empty;
        if (gridViewHotelList.Rows.Count > 0)
        {
            for (int i = 0; i < gridViewHotelList.Rows.Count; i++)
            {
                strHotelList = strHotelList + gridViewHotelList.DataKeys[i].Values[0].ToString() + ",";
                DataRow drRow = dtResult.NewRow();
                drRow["HOTELID"] = gridViewHotelList.DataKeys[i].Values[0].ToString();
                drRow["HOTELNM"] = gridViewHotelList.DataKeys[i].Values[1].ToString();
                drRow["ODTYPE"] = gridViewHotelList.DataKeys[i].Values[2].ToString();
                drRow["PRICECD"] = gridViewHotelList.DataKeys[i].Values[3].ToString();
                drRow["VENDOR"] = gridViewHotelList.DataKeys[i].Values[4].ToString();
                drRow["ACTYPE"] = gridViewHotelList.DataKeys[i].Values[5].ToString();

                dtResult.Rows.Add(drRow);
            }
        }
        strHotelList = strHotelList.TrimEnd(',');
        //check value
        _seltEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _seltEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _seltEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _seltEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _seltEntity.SeltDBEntity = new List<SeltDBEntity>();
        SeltDBEntity seltEntity = new SeltDBEntity();

        seltEntity.SeltID = hidUnitID.Value.Trim();
        seltEntity.UnitNm = txt_UnitNm.Text.Trim();
        seltEntity.InvoiceNm = txt_InvoiceNm.Text.Trim();
        seltEntity.Term = ddpterm.SelectedValue.Trim();
        seltEntity.TermStDt = ddptermStDt.SelectedValue.Trim();
        seltEntity.Tax = txt_tax.Text.Trim();
        seltEntity.Per = txt_Per.Text.Trim();
        seltEntity.Tel = txt_Tel.Text.Trim();
        seltEntity.Fax = txt_fax.Text.Trim();

        string salesID = hidSales.Value.Trim();
        seltEntity.Sales = (salesID.IndexOf(']') > 0) ? salesID.Substring(0, salesID.IndexOf(']')).Trim('[').Trim(']') : salesID;  //txt_sales.Text.Trim();
        seltEntity.Address = txt_address.Text.Trim();

        seltEntity.BillItem = txt_billItem.Text.Trim();
        seltEntity.TaxNo = txt_taxno.Text.Trim();
        seltEntity.PayNo = txt_payno.Text.Trim();
        seltEntity.Status = (rdbOnL.Checked) ? "1" : "0";

        seltEntity.dtHotelList = dtResult;
        _seltEntity.SeltDBEntity.Add(seltEntity);

        _seltEntity = SeltBP.SaveSettlementInfo(_seltEntity);

        int iResult = _seltEntity.Result;
        _commonEntity.LogMessages = _seltEntity.LogMessages;
        _commonEntity.CommonDBEntity = new List<CommonDBEntity>();
        CommonDBEntity commonDBEntity = new CommonDBEntity();

        commonDBEntity.Event_Type = "酒店结算单位-保存";
        commonDBEntity.Event_ID = seltEntity.UnitNm;
        string conTent = GetLocalResourceObject("EventSaveMessage").ToString();

        conTent = string.Format(conTent, seltEntity.UnitNm, seltEntity.InvoiceNm, seltEntity.Term, seltEntity.TermStDt, seltEntity.Tax, seltEntity.Per, seltEntity.Tel, seltEntity.Fax, seltEntity.Sales, seltEntity.Address, seltEntity.BillItem, seltEntity.TaxNo, seltEntity.PayNo, seltEntity.Status, strHotelList);
        commonDBEntity.Event_Content = conTent;

        if (iResult == 1)
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("CreateSuccess").ToString();
            MessageContent.InnerHtml = GetLocalResourceObject("CreateSuccess").ToString();

            AspNetPager1.AlwaysShow = true;
            AspNetPager1.CurrentPageIndex = 1;
            BindReviewUserListGrid();
        }
        else
        {
            commonDBEntity.Event_Result = GetLocalResourceObject("CreateError").ToString();
            dvUnitMessageContent.InnerHtml = GetLocalResourceObject("CreateError").ToString();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "invokeOpenList();", true);
        }

        _commonEntity.CommonDBEntity.Add(commonDBEntity);
        CommonBP.InsertEventHistory(_commonEntity);
    }
    protected void btnReLoad_Click(object sender, EventArgs e)
    {
        dvUnitMessageContent.InnerHtml = "";
        MessageContent.InnerHtml = "";
        if ("1".Equals(hidActionType.Value.Trim()))
        {
            txt_UnitNm.Text = "";
            txt_InvoiceNm.Text = "";
            ddpterm.SelectedIndex = 0;
            ddptermStDt.SelectedIndex = 0;
            txt_tax.Text = "";
            txt_Per.Text = "";
            txt_Tel.Text = "";
            txt_fax.Text = "";
            //txt_sales.Text = "";
            txt_address.Text = "";

            txt_billItem.Text = "";
            txt_taxno.Text = "";
            txt_payno.Text = "";
            rdbOnL.Checked = true;

            hidSales.Value = "";
            gridViewHotelList.DataSource = null;
            gridViewHotelList.DataBind();
            this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "invokeOpenList();", true);
            //ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "setScript", "invokeOpenList()", true);
            return;
        }

        _seltEntity.LogMessages = new HotelVp.Common.Logger.LogMessage();
        _seltEntity.LogMessages.Userid = UserSession.Current.UserAccount;
        _seltEntity.LogMessages.Username = UserSession.Current.UserDspName;
        _seltEntity.LogMessages.IpAddress = UserSession.Current.UserIP;

        _seltEntity.SeltDBEntity = new List<SeltDBEntity>();
        SeltDBEntity seltEntity = new SeltDBEntity();

        seltEntity.SeltID = hidUnitID.Value.Trim();
        _seltEntity.SeltDBEntity.Add(seltEntity);
        _seltEntity = SeltBP.ReLoadDetialInfo(_seltEntity);

        DataSet dsResult = _seltEntity.QueryResult;

        if (dsResult.Tables.Count > 0 && dsResult.Tables[0].Rows.Count > 0)
        {
            txt_UnitNm.Text = dsResult.Tables[0].Rows[0]["unit_name"].ToString().Trim();
            txt_InvoiceNm.Text = dsResult.Tables[0].Rows[0]["invoice_name"].ToString().Trim();
            ddpterm.SelectedValue = dsResult.Tables[0].Rows[0]["settlement_term"].ToString().Trim();
            ddptermStDt.SelectedValue = dsResult.Tables[0].Rows[0]["term_stdt"].ToString().Trim();
            txt_tax.Text = dsResult.Tables[0].Rows[0]["hotel_tax"].ToString().Trim();
            txt_Per.Text = dsResult.Tables[0].Rows[0]["settlement_per"].ToString().Trim();
            txt_Tel.Text = dsResult.Tables[0].Rows[0]["settlement_tel"].ToString().Trim();
            txt_fax.Text = dsResult.Tables[0].Rows[0]["settlement_fax"].ToString().Trim();
            //txt_sales.Text = dsResult.Tables[0].Rows[0]["settlement_sales"].ToString().Trim();
            txt_address.Text = dsResult.Tables[0].Rows[0]["settlement_address"].ToString().Trim();

            txt_billItem.Text = dsResult.Tables[0].Rows[0]["bill_item"].ToString().Trim();
            txt_taxno.Text = dsResult.Tables[0].Rows[0]["hotel_taxno"].ToString().Trim();
            txt_payno.Text = dsResult.Tables[0].Rows[0]["hotel_payno"].ToString().Trim();
            rdbOnL.Checked = (dsResult.Tables[0].Rows[0]["status"].ToString() == "1") ? true : false;

            hidSales.Value = dsResult.Tables[0].Rows[0]["settlement_sales_nm"].ToString().Trim();
        }

        DataTable dtResult = _seltEntity.SeltDBEntity[0].dtHotelList;

        gridViewHotelList.DataSource = dtResult;
        gridViewHotelList.DataKeyNames = new string[] { "HOTELID", "HOTELNM", "ODTYPE", "PRICECD", "VENDOR", "ACTYPE" };//主键
        gridViewHotelList.DataBind();
        this.Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "key", "invokeOpenList();", true);
        //ScriptManager.RegisterStartupScript(this.UpdatePanel3, this.GetType(), "setScript", "invokeOpenList()", true);
    }