Ejemplo n.º 1
0
        protected void lnkLine_Click(object sender, EventArgs e)
        {
            var Date = hdnfldVariable.Value;
            UserSelectionModel modeldata = new UserSelectionModel();

            modeldata = (UserSelectionModel)Session["UserSelectionModel"];
            LinkButton lnkLinee  = (LinkButton)sender;
            string     PlantCode = drpPlant.SelectedValue;
            string     Shift     = drpShift.SelectedItem.Text;

            string[]           tokens = Date.Split(' ');
            string             date   = tokens[0];
            UserSelectionModel model  = new UserSelectionModel();

            model.PlantCode = PlantCode;
            model.Line      = lnkLinee.Text;
            model.ShiftCode = drpShift.SelectedValue;
            model.ShiftDate = Date;
            Session["UserSelectionModel"] = model;
            if (GetAssignedOperatorType() == 0)
            {
                Response.Redirect("QualityCheck.aspx");
            }
            else
            {
                Response.Redirect("RunDetails.aspx");
            }
        }
Ejemplo n.º 2
0
        protected void GetData()
        {
            try
            {
                UserSelectionModel model = new UserSelectionModel();
                model = (UserSelectionModel)Session["UserSelectionModel"];
                var      x        = Session["UserID"];
                string   Shift    = drpShift.SelectedItem.Text;
                string[] tokens   = Shift.Split('/');
                string   date     = tokens[tokens.Length - 1];
                string   dateTime = DateTime.ParseExact(date.Trim().Replace("-", "/"), "dd/MM/yyyy", null).ToString("yyyy-MM-dd");
                //DateTime datetime = DateTime.Parse(date);
                //var FormatedDate = datetime.ToString("yyyy-MM-dd");
                SqlParameter[] param = new SqlParameter[]
                {
                    new SqlParameter("@OPR", "3"),
                    new SqlParameter("@PlantCode", drpPlant.SelectedValue),
                    new SqlParameter("@Shift", drpShift.SelectedValue),
                    new SqlParameter("@Date", dateTime),
                    new SqlParameter("@UserId", HttpContext.Current.Session["USERID"].ToString()),
                };

                DataTable Dt = new DataTable();
                Dt = DBClass.GetDatatable_WithParam(param, "DM_SP_GET_STOPPAGE_DATA");
                GrdStoppageReason.DataSource = Dt;
                GrdStoppageReason.DataBind();
            }
            catch (Exception ex)
            {
                _logger.Error(string.Concat("GetData::", ex.Message), ex);
            }
        }
Ejemplo n.º 3
0
        protected void GetData()
        {
            try
            {
                UserSelectionModel model = new UserSelectionModel();
                model = (UserSelectionModel)Session["UserSelectionModel"];
                string         Shift  = drpShift.SelectedItem.Text;
                string[]       tokens = Shift.Split('/');
                string         date   = tokens[tokens.Length - 1];
                SqlParameter[] param  = new SqlParameter[]
                {
                    new SqlParameter("@OPR", "3"),
                    new SqlParameter("@PlantCode", drpPlant.SelectedValue),
                    new SqlParameter("@Shift", drpShift.SelectedValue),
                    new SqlParameter("@Date", date),
                    new SqlParameter("@UserId", HttpContext.Current.Session["USERID"].ToString()),
                };

                DataTable Dt = new DataTable();
                Dt = DBClass.GetDatatable_WithParam(param, "DM_SP_GET_STOPPAGE_DATA");
                GrdStoppageReason.DataSource = Dt;
                GrdStoppageReason.DataBind();
            }
            catch (Exception ex)
            {
                _logger.Error(string.Concat("GetData::", ex.Message), ex);
            }
        }
Ejemplo n.º 4
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            try

            {
                if (ddlHour.SelectedValue.Equals("00") && ddlMinute.SelectedValue.Equals("00"))
                {
                    ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:alert('Time cannot be 00,Please select again Time hour/Minute')", true);
                }
                else
                {
                    UserSelectionModel model = new UserSelectionModel();
                    model = (UserSelectionModel)Session["UserSelectionModel"];
                    var            date      = model.ShiftDate.ToString().Substring(0, model.ShiftDate.IndexOf(' '));
                    DateTime       dateTime  = DateTime.ParseExact(date.Replace("-", "/"), "dd/MM/yyyy", null);
                    DateTime       dateTime1 = DateTime.Parse(lbldate.Text);
                    object         obj;
                    SqlParameter[] param = new SqlParameter[]
                    {
                        new SqlParameter("@OPR", 10),
                        new SqlParameter("@PlantCode", lblplantcode.Text),
                        new SqlParameter("@Line", lblline.Text),
                        new SqlParameter("@Date", dateTime1),
                        new SqlParameter("@ShiftCode", drpShift.SelectedValue),
                        new SqlParameter("@ParameterTime", ddlHour.SelectedItem.Text + ":" + ddlMinute.SelectedItem.Text),
                        new SqlParameter("@ParameterType", drpParameterType.SelectedValue),
                        new SqlParameter("@ParameterDesc", drpParameter.SelectedValue),
                        new SqlParameter("@Value", txtValue.Text.Trim()),
                        new SqlParameter("@Targ", txtTargValue.Text.Trim()),
                        new SqlParameter("@UOM", txtUOM.Text.Trim()),
                        new SqlParameter("@Comments", txtComments.Text.Trim()),
                        new SqlParameter("@CreatedBy", HttpContext.Current.Session["username"].ToString()),
                        new SqlParameter("@StationCode", ddlStation.SelectedValue)
                    };

                    obj = DBClass.ExecuteNonQuery_WithParam(param, "DM_SP_DML_DATA");

                    BindGrid();

                    if (obj != null && Convert.ToInt64(obj) != 0)
                    {
                        ClearFields();
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "script", "javascript:alert('Parameter added successfully')", true);
                    }
                }
            }
            catch (Exception ex)
            {
                _logger.Error(string.Concat("btnSubmit_Click::", ex.Message), ex);
            }
        }
Ejemplo n.º 5
0
        protected void btnclick_Click(object sender, EventArgs e)
        {
            if (Session["username"] != null)
            {
                UserSelectionModel model = new UserSelectionModel();
                model.PlantCode = "M016";
                model.Line      = "LINE 2";
                model.ShiftCode = "S2";
                model.ShiftDate = "2019-08-09";
                Session["UserSelectionModel"] = model;

                Response.Redirect("RunDetails.aspx", false);
            }
        }
Ejemplo n.º 6
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["UserSelectionModel"] != null)
         {
             UserSelectionModel model = new UserSelectionModel();
             model             = (UserSelectionModel)Session["UserSelectionModel"];
             lblplantcode.Text = model.PlantCode;
             lblline.Text      = model.Line;
             lblshift.Text     = model.ShiftCode;
             lbldate.Text      = model.ShiftDate;
             drpStatus_SelectedIndexChanged(null, null);
             //BindSchedulePO();
         }
         else
         {
             Response.Redirect("Login.aspx", false);
         }
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (Session["UserSelectionModel"] != null)
         {
             UserSelectionModel model = new UserSelectionModel();
             model             = (UserSelectionModel)Session["UserSelectionModel"];
             lblplantcode.Text = model.PlantCode;
             lblline.Text      = model.Line;
             lblshift.Text     = model.ShiftCode;
             lbldate.Text      = model.ShiftDate;
         }
         else
         {
             Response.Redirect("Login.aspx", false);
         }
         GetShift();
         BindProductionEntryGrid();
     }
 }
Ejemplo n.º 8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            ScriptManager scriptManager = ScriptManager.GetCurrent(this.Page);

            scriptManager.RegisterPostBackControl(this.btnExport);
            if (!IsPostBack)
            {
                if (Session["UserSelectionModel"] != null)
                {
                    UserSelectionModel model = new UserSelectionModel();
                    model             = (UserSelectionModel)Session["UserSelectionModel"];
                    lblplantcode.Text = model.PlantCode;
                    lblline.Text      = model.Line;
                    lblshift.Text     = model.ShiftCode;
                    lbldate.Text      = model.ShiftDate;
                    drpStatus_SelectedIndexChanged(null, null);
                }
                else
                {
                    Response.Redirect("Login.aspx", false);
                }
            }
        }
Ejemplo n.º 9
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["UserSelectionModel"] != null)
                {
                    UserSelectionModel model = new UserSelectionModel();
                    model             = (UserSelectionModel)Session["UserSelectionModel"];
                    lblplantcode.Text = model.PlantCode;
                    lblline.Text      = model.Line;
                    lblshift.Text     = model.ShiftCode;
                    lbldate.Text      = model.ShiftDate;

                    txtDate.Text = lbldate.Text;
                    GetShiftHeader();
                    GetShift();
                    GetStation();
                    GetDuration();
                    BindStoppagesReason();
                    //BindTimeControl(drpTime);
                }
            }
        }
Ejemplo n.º 10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Session["UserSelectionModel"] != null)
                {
                    UserSelectionModel model = new UserSelectionModel();
                    model             = (UserSelectionModel)Session["UserSelectionModel"];
                    lblplantcode.Text = model.PlantCode;
                    lblline.Text      = model.Line;

                    if (model.ShiftCode.Equals("S4"))
                    {
                        lblshiftnew.Text = "S1";
                    }
                    else if (model.ShiftCode.Equals("S5"))
                    {
                        lblshiftnew.Text = "S2";
                    }
                    else if (model.ShiftCode.Equals("S6"))
                    {
                        lblshiftnew.Text = "S3";
                    }
                    else
                    {
                        lblshiftnew.Text = model.ShiftCode;
                    }
                    lblshift.Text = model.ShiftCode;
                    var      date     = model.ShiftDate.ToString().Substring(0, model.ShiftDate.IndexOf(' '));
                    DateTime dateTime = DateTime.ParseExact(date.Replace("-", "/"), "dd/MM/yyyy", null);
                    //lbldate.Text = dateTime.ToString("yyyy-MM-dd"); ;
                    labeldate = dateTime.ToString("yyyy-MM-dd");
                    if (lblshift.Text.Equals("S3") || lblshift.Text.Equals("S6"))
                    {
                        if (Session["CountryId"].ToString().Trim() == "1" && DateTime.Now.Hour <= 6)
                        {
                            lbldate.Text = dateTime.AddDays(-1).ToShortDateString();
                        }
                        else if (Session["CountryId"].ToString().Trim() == "2" && ((DateTime.Now.Hour <= 7 && DateTime.Now.Minute <= 30) || (DateTime.Now.Hour == 23) || (DateTime.Now.Hour >= 22 && DateTime.Now.Minute >= 30)))
                        {
                            lbldate.Text = dateTime.AddDays(-1).ToShortDateString();
                        }
                        else
                        {
                            lbldate.Text = dateTime.ToShortDateString();
                        }
                        //lbldate.Text = dateTime.AddDays(-1).ToShortDateString();
                    }
                    else
                    {
                        // DateTime shiftDay = Convert.ToDateTime(model.ShiftDate);
                        lbldate.Text = dateTime.ToShortDateString();
                    }
                    //lbldate.Text = model.ShiftDate;
                    txtComments.Attributes.Add("maxlength", txtComments.MaxLength.ToString());

                    txtDate.Text = Convert.ToDateTime(lbldate.Text).ToString("yyyy-MM-dd");//lbldate.Text;
                    GetShiftHeader();
                    GetShift();
                    GetDuration();
                    BindParameterType();
                    BindGrid();
                    GetStation();
                }
            }
        }