Ejemplo n.º 1
0
 protected void Clear(object sender, EventArgs e)
 {
     txtRoomNo.Text                = "";
     btnSave.Text                  = "Save";
     ddlGuestName.SelectedIndex    = 0;
     DivServiceDesk.Visible        = false;
     divCaptionServiceDesk.Visible = false;
     divTotalCheckOutPrice.Visible = false;
     GrdGuestList.DataSource       = null;
     GrdGuestList.DataBind();
     GrdServiceDesk.DataSource = null;
     GrdServiceDesk.DataBind();
     lbltaxableamt.Text  = "";
     lbltaxAmt1.Text     = "";
     lbltaxAmt2.Text     = "";
     lbltaxAmt3.Text     = "";
     lblTaxName1.Text    = "";
     lblTaxName2.Text    = "";
     lblTaxName3.Text    = "";
     lblTaxRate1.Text    = "";
     lblTaxRate2.Text    = "";
     lblTaxRate3.Text    = "";
     lblGrandTotal.Text  = "";
     lblDisocuntAmt.Text = "";
     lblDiscountPer.Text = "";
 }
Ejemplo n.º 2
0
        private void ServiceDeskDetail()
        {
            try
            {
                Decimal   Amount     = 0;
                Decimal   ItemPrice  = 0;
                Decimal   TotalPrice = 0;
                int       i          = 0;
                DataTable dt         = new DataTable();
                objML_Visitors.Name   = ddlGuestName.SelectedValue != "" ? ddlGuestName.SelectedValue : null;
                objML_Visitors.RoomNo = txtRoomNo.Text != "" ? txtRoomNo.Text : null;
                dt = objBL_Visitors.BL_Select_Service_Desk_Detail(objML_Visitors);
                if (dt.Rows.Count > 0)
                {
                    GrdServiceDesk.DataSource = dt;
                    GrdServiceDesk.DataBind();
                    for (i = 0; i <= dt.Rows.Count - 1; i++)
                    {
                        Amount    = Convert.ToDecimal(dt.Rows[i]["ItemPrice"]);
                        ItemPrice = ItemPrice + Amount;
                    }

                    DivServiceDesk.Visible        = true;
                    divCaptionServiceDesk.Visible = true;
                }
                else
                {
                    DivServiceDesk.Visible        = false;
                    divCaptionServiceDesk.Visible = false;
                    divTotalCheckOutPrice.Visible = false;
                }
                // taxable AMount and Service Desk Amount
                TotalPrice             = Convert.ToDecimal(lbltaxableamt.Text);
                TotalPrice             = TotalPrice + ItemPrice;
                lblServiceDeskAmt.Text = Convert.ToString(ItemPrice);
                lblTotalAmount.Text    = Convert.ToString(TotalPrice);
                // End

                // Grand Total After Discount
                decimal GrandTotal = TotalPrice - Convert.ToDecimal(lblDisocuntAmt.Text);
                lblGrandTotal.Text = Convert.ToString(GrandTotal);
                // ENd
                DivGuestDetail.Visible        = true;
                divTotalCheckOutPrice.Visible = true;
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('" + ex.Message.ToString() + "')", true);
            }
        }
Ejemplo n.º 3
0
        protected void Serach(object sender, EventArgs e)
        {
            try
            {
                con.Open();
                SqlTransaction trans     = con.BeginTransaction(IsolationLevel.ReadCommitted);
                DataTable      dt        = new DataTable();
                string         qry       = "";
                string         GuestName = "";
                if (ddlGuestName.SelectedValue == "Choose a Guest Name...")
                {
                    GuestName = "";
                }
                else
                {
                    GuestName = ddlGuestName.SelectedValue;
                }
                qry = " select ROW_NUMBER() OVER(ORDER BY SPCN_Service_Desk_Master.ServiceID ASC) AS RowNo,SPCN_Service_Desk_Master.*,spcn_check_in.GuestName,SPCN_Hotel_Item_Master.ItemName from SPCN_Service_Desk_Master left join spcn_check_in on spcn_check_in.VisitorID=SPCN_Service_Desk_Master.GuestName inner join SPCN_Hotel_Item_Master on SPCN_Hotel_Item_Master.ItemID=SPCN_Service_Desk_Master.ItemID where 2=2 and (SPCN_Service_Desk_Master.GuestName='" + ddlGuestName.SelectedValue + "'  or isnull('" + GuestName + "','')='') and (SPCN_Service_Desk_Master.ModifyDate>=convert(datetime,'" + txtfromdate.Text + "',103)) and (SPCN_Service_Desk_Master.ModifyDate>=convert(datetime,'" + txtfromdate.Text + "',103)) ";
                SqlCommand cmd = new SqlCommand();
                dt = clsDBFuncationality.GetDataTable(qry);
                //cmd = new SqlCommand(qry, con);
                //cmd.Transaction = trans;
                //cmd.Clone();
                //SqlDataReader dr = cmd.ExecuteReader();

                //while (dr.Read())
                //{
                //    dt.Load(dr);
                //}

                if (dt.Rows.Count > 0)
                {
                    GrdServiceDesk.DataSource = dt;
                    GrdServiceDesk.DataBind();
                    lblMsg.Text = "";
                }
                else
                {
                    lblMsg.Text = "No Records Found";
                    GrdServiceDesk.DataSource = "";
                    GrdServiceDesk.DataBind();
                }
            }
            catch (Exception ex)
            {
                ScriptManager.RegisterStartupScript(this, this.GetType(), "message", "alert('" + ex.Message.ToString() + "')", true);
            }
        }
Ejemplo n.º 4
0
        protected void PrintAllPages(object sender, EventArgs e)
        {
            GrdServiceDesk.AllowPaging = false;

            GrdServiceDesk.DataBind();

            StringWriter sw = new StringWriter();

            HtmlTextWriter hw = new HtmlTextWriter(sw);

            GrdServiceDesk.RenderControl(hw);

            string gridHTML = sw.ToString().Replace("\"", "'")

                              .Replace(System.Environment.NewLine, "");

            StringBuilder sb = new StringBuilder();

            sb.Append("<script type = 'text/javascript'>");

            sb.Append("window.onload = new function(){");

            sb.Append("var printWin = window.open('', '', 'left=0");

            sb.Append(",top=0,width=1000,height=600,status=0');");

            sb.Append("printWin.document.write(\"");

            sb.Append(gridHTML);

            sb.Append("\");");

            sb.Append("printWin.document.close();");

            sb.Append("printWin.focus();");

            sb.Append("printWin.print();");

            sb.Append("printWin.close();};");

            sb.Append("</script>");

            ClientScript.RegisterStartupScript(this.GetType(), "GridPrint", sb.ToString());

            GrdServiceDesk.AllowPaging = true;

            GrdServiceDesk.DataBind();
        }