using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class RepairingPage : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["UserTypeID"] == null)
        {
            Response.Redirect("Default.aspx?ID=" + DateTime.Now.Ticks.ToString());
        }
        else
        {
            if (int.Parse(Session["UserTypeID"].ToString()) != 1)
            {
                Response.Redirect("Default.aspx?ID=" + DateTime.Now.Ticks.ToString());
            }
            else
            {
                if (!IsPostBack)
                {
                    Class_xtblTamiratBaz ClsTmrBz = new Class_xtblTamiratBaz(Decimal.Parse(Request.QueryString["TamirID"].ToString()));
                    ClsTmrBz.UDF_ReternInfoCar();
                    Txt_InfoCar.Text = ClsTmrBz.Str_InformationOfCars;
                    ClsTmrBz.UDF_ReternNote();
                    Txt_Note.Text = ClsTmrBz.Str_InformatinNote;

                }
            }
        }
    }
    protected void Btn_Save_Click(object sender, EventArgs e)
    {
        Class_tblDarkhastTamir ClsTmr = new Class_tblDarkhastTamir(Decimal.Parse(Request.QueryString["TamirID"].ToString()), Txt_Date.Text.Trim(), Txt_Time.Text.Trim());
        ClsTmr.UDF_UpDate();
        Lbl_Message.Visible = true;
        Lbl_Message.Text = "تاریخ و ساعت انجام تعمیر مشخص گردید";
        Response.Redirect("AnjamTamir.aspx?ID=" + DateTime.Now.Ticks.ToString());
    }
}