Beispiel #1
0
 public void ShowMessage(string Message)
 {
     lblMessage.Text   = Message;
     lblCaption.Text   = "";
     tdCaption.Visible = false;
     MPE.Show();
 }
Beispiel #2
0
 public void ShowMessage(string Message, string Caption)
 {
     lblMessage.Text   = Message;
     lblCaption.Text   = Caption;
     tdCaption.Visible = true;
     MPE.Show();
 }
Beispiel #3
0
        public static void TryGiveJob(Pawn pawn, Job __result)
        {
            if (__result == null || pawn == null)
            {
                return;
            }
            if (!pawn.Spawned)
            {
                return;
            }
            if (__result.def != JobDefOf.Ingest)
            {
                return;
            }
            if (!__result.CanBeginNow(pawn))
            {
                return;
            }
            if (!Settings.EdibleBingesEnabled)
            {
                return;
            }
            if ((Find.TickManager.TicksGame - Snapshot) < 60)
            {
                return;
            }


            MPE.Debug(string.Format("{0} ticks passed since last food binge.", Find.TickManager.TicksGame - Snapshot));
            MPE.Info(string.Format("Pawn {0} is on a food binge; pausing the game...", pawn.LabelDefinite()));

            Find.TickManager.Pause();
            Snapshot = Find.TickManager.TicksGame;
        }
Beispiel #4
0
 protected void btn_submit_Click(object sender, EventArgs e)
 {
     if (txt_desc.Text.Trim() != "")
     {
         try
         {
             //
             SqlParameter[] param = new SqlParameter[] {
                 new SqlParameter("@userid", (((UserDetails)Session[clsConstant.TOKEN]).UserID).ToString().ToUpper()),
                 new SqlParameter("@msg", txt_desc.Text)
                 //(((UserDetails)Session[clsConstant.TOKEN]).UserID).ToString())
             };
             clsFeedBack feed = new clsFeedBack();
             feed.InserFeedBack(param);
             SendMail();
             Response.Write("<script>alert('Your feedback is submitted sucessfully')</script>");
             MPE.Hide();
             txt_desc.Text = "";
         }
         catch { MPE.Hide(); txt_desc.Text = ""; }
     }
     else
     {
         Response.Write("<script>alert('Please enter feedback message')</script>");
     }
 }
 private void panelu()
 {
     if (Session.IsNewSession)
     {
         MPE.Hide();
     }
     else
     {
         MPE.Show();
     }
 }
Beispiel #6
0
    /// <summary>
    /// method
    /// shows the parent dialog and this control's dialog
    /// </summary>
    public void ShowMPE()
    {
        if (ParentMPE != null)
        {
            ParentMPE.Show();
        }

        if (MPE != null)
        {
            Visible = true;
            MPE.Show();
        }
    }
Beispiel #7
0
    protected void gvNotificaciones_SelectedIndexChanged(object sender, EventArgs e)
    {
        string strScript = "";

        Class.Notificaciones objNotificacion = new Class.Notificaciones();
        int intNumeroNotificaciones          = 0;

        try
        {
            // Marco la notificacion como leida:
            objNotificacion.IdNotificacion = Convert.ToInt32(this.gvNotificaciones.SelectedRow.Cells[0].Text);
            objNotificacion.IdUsuario      = Convert.ToInt32(Session["userIDInj"].ToString());
            objNotificacion.AltaNotificacionLeida();
            if (objNotificacion.ErrorNumber != 0)
            {
                strScript = "Error Notificaciones!AltaNotificacionLeida:\\n" + objNotificacion.ErrorMessage.Replace("'", "").Replace("\n", "\\n").Replace("\r", "\\n").Replace(Convert.ToString((char)10), "\\n").Replace(Convert.ToString((char)13), "\\n");
                return;
            }

            // Abro el popup de la notificación seleccionada:
            this.pnlMasterPopupNot.Visible = true;
            MPE.Show();
            //this.txtDepartamento.Text = this.gvNotificaciones.SelectedRow.Cells[2].Text.Replace("&nbsp;", "");
            //this.txtRol.Text = this.gvNotificaciones.SelectedRow.Cells[3].Text.Replace("&nbsp;", "");
            //this.txtUsuario.Text = this.gvNotificaciones.SelectedRow.Cells[4].Text.Replace("&nbsp;", "");
            //this.txtEsParaTodos.Text = this.gvNotificaciones.SelectedRow.Cells[5].Text.Replace("&nbsp;", "");
            this.txtMensaje.InnerHtml = this.gvNotificaciones.SelectedRow.Cells[6].Text.Replace("&nbsp;", "");

            // Actualizo el dataset:
            this.dstNotificaciones.DataBind();
            this.gvNotificaciones.DataBind();

            // Actualizo el contador de notificaciones:
            objNotificacion.IdUsuario        = Convert.ToInt32(Session["idUsuario"].ToString());
            intNumeroNotificaciones          = objNotificacion.ObtenerNumeroDeNotifcaciones();
            Session["NumeroNotificaciones"]  = intNumeroNotificaciones.ToString();
            this.lblCountNotificaciones.Text = intNumeroNotificaciones.ToString();
        }
        catch (Exception ex)
        {
            strScript = "Error: " + ex.Message.ToString().Replace("'", "").Replace("\n", "\\n").Replace("\r", "\\n").Replace(Convert.ToString((char)10), "\\n").Replace(Convert.ToString((char)13), "\\n");
        }
        finally
        {
            if (strScript != "")
            {
                strScript = "<script language='javascript'> alert('" + strScript + "');</script>";
                System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "Error", strScript, false);
            }
        }
    }
Beispiel #8
0
    /// <summary>
    /// method
    /// displays the parent dialog
    /// only call this when you do not want to show this control's dialog
    /// </summary>
    public void ShowParentMPE()
    {
        if (ParentMPE != null)
        {
            ParentMPE.Show();
        }

        if (MPE != null)
        {
            MPE.Hide();
        }

        Visible = false;
    }
Beispiel #9
0
    protected void gvList_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int         index = Convert.ToInt32(e.CommandArgument);
        GridViewRow row   = gvList.Rows[index];

        claimId.Text = row.Cells[0].Text;
        type.Text    = row.Cells[1].Text;

        date.Text   = row.Cells[2].Text;
        amount.Text = row.Cells[3].Text;
        status.Text = row.Cells[4].Text;

        empname.Text = row.Cells[5].Text;
        appname.Text = row.Cells[6].Text;
        SqlConnection con2 = new SqlConnection(cs);

        con2.Open();
        SqlCommand    cmd      = new SqlCommand("select ERSClaimUserRemarks,ERSBillImage,ERSClaimApproverRemarks from ERSClaim where ERSClaimID = '" + claimId.Text + "'", con2);
        SqlDataReader myReader = cmd.ExecuteReader();

        if (myReader.Read())
        {
            userrm.Text = myReader["ERSClaimUserRemarks"].ToString();
            apprm.Text  = myReader["ERSClaimApproverRemarks"].ToString();
            byte[] imagedata = (byte[])myReader["ERSBillImage"];
            string img       = Convert.ToBase64String(imagedata, 0, imagedata.Length);
            Image1.ImageUrl = "data:image/png;base64," + img;
            Image2.ImageUrl = "data:image/png;base64," + img;
            myReader.Close();

            con2.Close();
        }
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        con2.Close();



        if (e.CommandName == "Edit_Click")
        {
            MPE.Enabled         = true;
            updatePanel.Visible = true;
            MPE.Show();
        }
    }
Beispiel #10
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int         index = Convert.ToInt32(e.CommandArgument);
        GridViewRow row   = GridView1.Rows[index];

        EmployeeID2.Text  = row.Cells[0].Text;
        EmployeeName.Text = row.Cells[1].Text;

        EmployeeMailID.Text = row.Cells[2].Text;
        Employeeid          = EmployeeID2.Text;
        select();
        if (e.CommandName == "Edit_Click")
        {
            MPE.Enabled         = true;
            updatePanel.Visible = true;
            MPE.Show();
        }
    }
Beispiel #11
0
        private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
            try
            {
                var source = await Reader.GetChapterVoiceAsync(Reader.CurrentChapter, false, new Windows.Media.SpeechSynthesis.SpeechSynthesizer());

                _playSource = source;
                var player = new MediaPlayer();
                player.Source      = source;
                player.MediaEnded += MediaPlayer_Ended;
                MPE.SetMediaPlayer(player);
                player.Play();
                SpeechContainer.Visibility = Visibility.Visible;
                MPE.Visibility             = Visibility.Visible;
            }
            catch (Exception ex)
            {
                await new MessageDialog(ex.Message).ShowAsync();
            }
        }
Beispiel #12
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int         index = Convert.ToInt32(e.CommandArgument);
        GridViewRow row   = GridView1.Rows[index];

        designation.Text = row.Cells[0].Text;
        medical.Text     = row.Cells[1].Text;

        travelout.Text = row.Cells[2].Text;
        misc.Text      = row.Cells[3].Text;
        randm.Text     = row.Cells[4].Text;

        local.Text = row.Cells[5].Text;



        if (e.CommandName == "Edit_Click")
        {
            MPE.Enabled         = true;
            updatePanel.Visible = true;
            MPE.Show();
        }
    }
Beispiel #13
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int         index = Convert.ToInt32(e.CommandArgument);
        GridViewRow row   = GridView1.Rows[index];

        approverid.Text   = row.Cells[0].Text;
        Approvername.Text = row.Cells[1].Text;

        Approvermailid.Text = row.Cells[2].Text;
        ApproverRole.Text   = row.Cells[3].Text;
        Approverlevel.Text  = row.Cells[4].Text;

        if (e.CommandName == "Edit_Click")
        {
            MPE.Enabled         = true;
            updatePanel.Visible = true;
            MPE.Show();
        }
        if (e.CommandName == "Delete_Click")
        {
            Delete_Claim();
        }
    }
Beispiel #14
0
        public static void PostStart(MentalState_SadisticRageTantrum __instance)
        {
            if (!Settings.SadisticRageEnabled)
            {
                return;
            }
            if (__instance == null)
            {
                return;
            }
            if (__instance.target == null || __instance.pawn == null)
            {
                return;
            }
            if (!__instance.pawn.Spawned)
            {
                return;
            }
            if (!(__instance.pawn.MentalState is MentalState_SadisticRageTantrum))
            {
                return;
            }
            if (__instance.Age > 150)
            {
                return;
            }
            if (MPE.Cache.SadisticRage.Contains(__instance.pawn.GetUniqueLoadID()))
            {
                return;
            }


            MPE.Info(string.Format("Pawn {0} is on a sadistic rage; pausing the game...", __instance.pawn.LabelDefinite()));

            MPE.Cache.SadisticRage.Add(__instance.pawn.GetUniqueLoadID());
            Find.TickManager.Pause();
        }
Beispiel #15
0
 protected void btnclose_Click(object sender, ImageClickEventArgs e)
 {
     MPE.Hide();
 }
Beispiel #16
0
 protected void btnfeeback_Click(object sender, ImageClickEventArgs e)
 {
     MPE.Show();
 }
Beispiel #17
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        try
        {
            int         index = Convert.ToInt32(e.CommandArgument);
            GridViewRow row   = GridView1.Rows[index];
            claimId.Text     = row.Cells[0].Text;
            claimtype.Text   = row.Cells[1].Text;
            type1            = claimtype.Text;
            applieddate.Text = row.Cells[2].Text;
            claimstatus.Text = row.Cells[3].Text;
            Label8.Text      = row.Cells[4].Text;
            if (Employee.Text != null)
            {
                //SqlConnection con1 = new SqlConnection(@"Data Source=HI-PC\SQLEXPRESS; Database =ERSDB;Integrated Security=true");
                SqlConnection con1 = new SqlConnection(constring);
                con1.Open();
                DataTable      dt25 = new DataTable();
                DataRow        dr25;
                int            i     = 0;
                SqlDataAdapter sda25 = new SqlDataAdapter("select ERSEmployeeID from ERSClaim where ERSClaimID = '" + claimId.Text + "'", con1);
                sda25.Fill(dt25);
                if (dt25.Rows.Count > 0)
                {
                    dr25        = dt25.Rows[i];
                    employee123 = Convert.ToString(dr25[0]);
                    select(type1);
                }

                SqlCommand    cmd1      = new SqlCommand("select EmployeeName from Employee where EmployeeID = '" + employee123 + "'", con1);
                SqlDataReader myReader1 = cmd1.ExecuteReader();
                if (myReader1.Read())
                {
                    Employee.Text = myReader1["EmployeeName"].ToString();
                    myReader1.Close();
                }

                SqlDataAdapter da1 = new SqlDataAdapter(cmd1);
                con1.Close();
            }
            SqlConnection con2 = new SqlConnection(constring);
            con2.Open();
            SqlCommand    cmd      = new SqlCommand("select ERSClaimStatus,ERSBillImage,ERSDescription from ERSClaim where ERSClaimID = '" + claimId.Text + "'", con2);
            SqlDataReader myReader = cmd.ExecuteReader();
            if (myReader.Read())
            {
                claimstatus.Text = myReader["ERSClaimStatus"].ToString();
                Label3.Text      = myReader["ERSDescription"].ToString();
                byte[] imagedata = (byte[])myReader["ERSBillImage"];
                string img       = Convert.ToBase64String(imagedata, 0, imagedata.Length);
                Image1.ImageUrl = "data:image/png;base64," + img;
                Image2.ImageUrl = "data:image/png;base64," + img;
                myReader.Close();
                con2.Close();
            }
            SqlDataAdapter da = new SqlDataAdapter(cmd);
            con2.Close();
            //Logic to Disable FOrwarded to Next Approver Option in DropDownlist for Level 3 Approver

            if (Session["SessionEmployeeID"].ToString() == "SNPL-HYD-1107")
            {
                //this.ActionDropDown.Items.FindByValue("1").Enabled = false;
                ActionDropDown.Items.Remove("Forward to Next Level");
            }
            if (Session["SessionEmployeeID"].ToString() == "SNPL-HYD-2016")
            {
                string claimid3 = claimId.Text;
                // AppRemarks.Text = "Level1 Remarks";
                premarks.Visible             = true;
                LevelApproverRemarks.Visible = true;
                AppRemarks.Visible           = true;
                AssignDetails(claimid3);
                // lreason.Text = "Remarks";
            }
            else if (Session["SessionEmployeeID"].ToString() == "SNPL-HYD-1107")
            {
                string claimid3 = claimId.Text;
                // AppRemarks.Text = "Level2 Remarks";
                premarks.Visible             = true;
                LevelApproverRemarks.Visible = true;
                // AppRemarks.Visible = true;
                AssignDetails(claimid3);
            }
            if (claimstatus.Text == "Pending")
            {
                ActionDropDown.Visible   = true;
                dropdownaction.Visible   = true;
                remarks.Visible          = true;
                remarks.Text             = string.Empty;
                remarks.ReadOnly         = false;
                cprocessdate.Visible     = false;
                ClaimProcessDate.Visible = false;
                Submit.Visible           = true;
                remarks.BorderStyle      = BorderStyle.Solid;
                remarks.BorderColor      = System.Drawing.Color.LightGray;
                remarks.BackColor        = System.Drawing.Color.White;
            }
            else if (claimstatus.Text == "Approved")
            {
                remarks.BorderStyle = BorderStyle.None;
                remarks.BorderColor = System.Drawing.Color.WhiteSmoke;
                remarks.BackColor   = System.Drawing.Color.WhiteSmoke;
                SqlConnection apprcon = new SqlConnection(constring);
                apprcon.Open();
                int            i    = 0;
                DataTable      dt12 = new DataTable();
                DataRow        dr12;
                SqlDataAdapter sda12 = new SqlDataAdapter("select ERSClaimApproverRemarks,ERSClaimProcessDate from ERSClaim where ERSClaimID = '" + claimId.Text + "'and ERSApproverID='" + Session["SessionEmployeeID"] + "'", apprcon);
                sda12.Fill(dt12);
                if (dt12.Rows.Count > 0)
                {
                    dr12 = dt12.Rows[i];
                    // ActionDropDown.DataTextField = Convert.ToString(dr12[0]);
                    remarks.Text          = Convert.ToString(dr12[0]);
                    ClaimProcessDate.Text = Convert.ToString(dr12[1]);
                    string s = ClaimProcessDate.Text;
                    if (String.IsNullOrEmpty(s))
                    {
                        ClaimProcessDate.Text = s;
                    }
                    else
                    {
                        string r = s.Remove(s.Length - 11);
                        ClaimProcessDate.Text = r;
                    }
                }
                ActionDropDown.Visible   = false;
                dropdownaction.Visible   = false;
                ClaimProcessDate.Visible = true;
                cprocessdate.Visible     = true;
                remarks.Visible          = true;
                remarks.ReadOnly         = true;
                Submit.Visible           = false;
                apprcon.Close();
            }
            else if (claimstatus.Text == "Rejected")
            {
                SqlConnection rejcon = new SqlConnection(constring);
                rejcon.Open();
                int            i    = 0;
                DataTable      dt12 = new DataTable();
                DataRow        dr12;
                SqlDataAdapter sda12 = new SqlDataAdapter("select ERSClaimApproverRemarks,ERSClaimProcessDate from ERSClaim where ERSClaimID = '" + claimId.Text + "'and ERSApproverID='" + Session["SessionEmployeeID"] + "'", rejcon);
                sda12.Fill(dt12);
                if (dt12.Rows.Count > 0)
                {
                    dr12 = dt12.Rows[i];
                    //ctionDropDown.DataTextField = Convert.ToString(dr12[0]);
                    remarks.Text          = Convert.ToString(dr12[0]);
                    ClaimProcessDate.Text = Convert.ToString(dr12[1]);
                }
                // laction.Visible = false;
                ActionDropDown.Visible = false;
                dropdownaction.Visible = false;
                //ActionDropDown.Enabled = false;
                // lreason.Visible = true;
                ClaimProcessDate.Visible = true;
                cprocessdate.Visible     = true;
                remarks.Visible          = true;
                remarks.ReadOnly         = true;
                Submit.Visible           = false;
                remarks.BorderColor      = System.Drawing.Color.Transparent;
                remarks.BorderStyle      = BorderStyle.None;
                remarks.BorderColor      = System.Drawing.Color.WhiteSmoke;
                remarks.BackColor        = System.Drawing.Color.WhiteSmoke;
                rejcon.Close();
            }
            if (claimstatus.Text == "Need Clarification")
            {
                // drop.Visible = true;
                //down.Visible = true;
                // laction.Visible = true;
                ActionDropDown.Visible = true;
                dropdownaction.Visible = true;
                // lreason.Visible = true;
                remarks.Visible          = true;
                remarks.Text             = string.Empty;
                remarks.ReadOnly         = false;
                cprocessdate.Visible     = false;
                ClaimProcessDate.Visible = false;
                Submit.Visible           = true;

                remarks.BorderStyle = BorderStyle.Solid;
                remarks.BorderColor = System.Drawing.Color.LightGray;
                remarks.BackColor   = System.Drawing.Color.White;
            }
            if (e.CommandName == "Edit_Click")
            {
                MPE.Enabled         = true;
                updatePanel.Visible = true;
                MPE.Show();
            }
        }
        catch (Exception ex)
        {
            throw ex;
            //Response.Write(ex.Message);
        }
    }
Beispiel #18
0
    protected void update_Click(object sender, EventArgs e)
    {
        SqlConnection con1 = new SqlConnection(cs);

        //SqlConnection con = new SqlConnection(cs);
        con1.Open();
        SqlCommand    cmd1     = new SqlCommand("Select ERSGrossPay from ERSAdvancePay where ERSAdvanceID='" + advanceid.Text + "'", con1);
        SqlDataReader myReader = cmd1.ExecuteReader();

        //RangeValidator2.MaximumValue = advancegrosspay.Text;
        if (myReader.Read())
        {
            Label7.Text = myReader["ERSGrossPay"].ToString();

            myReader.Close();
            // con.Close();
        }
        cmd1.ExecuteNonQuery();
        con1.Close();
        try
        {
            double c = Convert.ToDouble(txtAmount.Text);
            double d = Convert.ToDouble(AdvAmount.Text);
            if (d <= c)
            {
                //SqlConnection con = new SqlConnection(@"Data Source =SNPL-4007 ; Database = ERSDB ; Integrated Security = True;");
                SqlConnection con = new SqlConnection(cs);
                con.Open();
                SqlCommand cmd = new SqlCommand("update ERSAdvancePay set ERSAdvanceReason=@var1,ERSAdvanceAmount=@var2 where ERSAdvanceID=@var3", con);
                cmd.Parameters.AddWithValue("@var1", advreason.Text);
                cmd.Parameters.AddWithValue("@var2", AdvAmount.Text);
                cmd.Parameters.AddWithValue("@var3", advanceid.Text);
                cmd.ExecuteNonQuery();
                con.Close();
                alertmod.Style.Add("background-color", "#d7ecc6");
                alert.Style.Add("background-color", "#d7ecc6");
                Label5.ForeColor = System.Drawing.ColorTranslator.FromHtml("green");
                Label6.ForeColor = System.Drawing.ColorTranslator.FromHtml("black");
                Label5.Text      = "Success!";
                Label6.Text      = "Advnacepay Details has been Updated";
                alert.Visible    = true;
                //  ClientScript.RegisterStartupScript(GetType(), "alert", "alert('Details  Updated ');", true);
                BindGrid();
            }
            else
            {
                if (Page.IsPostBack)
                {
                    MPE.Show();
                    Label3.Visible = true;
                    Label3.Text    = "Amount should less than (or) equal to Grosspay";
                    AdvAmount.Focus();
                }

                //  MPE.Show();
            }
        }

        catch (Exception ex)
        {
            Response.Write(ex.Message);
        }
    }
Beispiel #19
0
 private void Hide()
 {
     lblMessage.Text = "";
     lblCaption.Text = "";
     MPE.Hide();
 }
Beispiel #20
0
    protected void grid1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int         index = Convert.ToInt32(e.CommandArgument);
        GridViewRow row   = GridView1.Rows[index];

        claimID.Text     = row.Cells[0].Text;
        claimtype.Text   = row.Cells[1].Text;
        claimdate.Text   = row.Cells[2].Text;
        claimStatus.Text = row.Cells[3].Text;
        // claimAmount.Text = row.Cells[4].Text;
        appname.Text = row.Cells[5].Text;

        SqlConnection con = new SqlConnection(cs);

        con.Open();
        SqlCommand    cmd      = new SqlCommand("select ERSClaimStatus,ERSClaimProcessDate,ERSClaimApproverRemarks,ERSBillAmount from ERSClaim where ERSClaimID = '" + claimID.Text + "'", con);
        SqlDataReader myReader = cmd.ExecuteReader();

        if (myReader.Read())
        {
            ClaimProcessDate.Text = myReader["ERSClaimProcessDate"].ToString();
            ApproverRemarks.Text  = myReader["ERSClaimApproverRemarks"].ToString();
            claimStatus.Text      = myReader["ERSClaimStatus"].ToString();
            claimAmount.Text      = myReader["ERSBillAmount"].ToString();
            myReader.Close();
            con.Close();
        }
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        select();
        if (claimStatus.Text == "Approved" || claimStatus.Text == "Rejected" || claimStatus.Text == "Need Clarification")
        {
            appremarks.Visible       = true;
            ApproverRemarks.Visible  = true;
            ClaimProcessDate.Visible = true;
            cpdate.Visible           = true;
            claimAmount.ReadOnly     = true;
            UserRemarks.ReadOnly     = true;
            update.Visible           = false;
            claimAmount.BorderColor  = System.Drawing.Color.WhiteSmoke;
            claimAmount.BorderStyle  = BorderStyle.None;
            UserRemarks.BorderColor  = System.Drawing.Color.WhiteSmoke;
            UserRemarks.BorderStyle  = BorderStyle.None;
            UserRemarks.BackColor    = System.Drawing.Color.WhiteSmoke;
            claimAmount.BackColor    = System.Drawing.Color.WhiteSmoke;
        }
        else
        {
            cpdate.Visible           = false;
            ClaimProcessDate.Visible = false;
            ApproverRemarks.Visible  = false;
            appremarks.Visible       = false;
            ClaimProcessDate.Visible = false;
            claimAmount.ReadOnly     = false;
            UserRemarks.ReadOnly     = false;
            update.Visible           = true;
            claimAmount.BorderColor  = System.Drawing.Color.LightGray;
            claimAmount.BorderStyle  = BorderStyle.Solid;

            UserRemarks.BorderColor = System.Drawing.Color.Gray;
            UserRemarks.BorderStyle = BorderStyle.Solid;
            UserRemarks.BackColor   = System.Drawing.Color.White;
            claimAmount.BackColor   = System.Drawing.Color.White;
        }
        if (e.CommandName == "Edit_Click")
        {
            MPE.Enabled          = true;
            UpdatePannel.Visible = true;
            MPE.Show();
        }
        if (e.CommandName == "Delete_Click")
        {
            Delete_Claim();
        }
    }
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int         index = Convert.ToInt32(e.CommandArgument);
        GridViewRow row   = GridView1.Rows[index];

        AdvanceID.Text     = row.Cells[1].Text;
        advancepayid.Text  = AdvanceID.Text;
        advanceamount.Text = row.Cells[2].Text;
        status.Text        = row.Cells[3].Text;
        advancereason.Text = row.Cells[4].Text;
        empname.Text       = row.Cells[5].Text;
        //SqlConnection con = new SqlConnection(@"Data Source=HI-PC\SQLEXPRESS; Database =ERSDB;Integrated Security=true");
        SqlConnection con = new SqlConnection(constring);

        con.Open();
        SqlCommand    cmd      = new SqlCommand("select ERSAdvanceApproverRemarks,ERSApplyDate,ERSAdvanceRequestProcessDate,ERSAdavanceRequestStatus from ERSAdvancePay where ERSAdvanceID = '" + AdvanceID.Text + "'", con);
        SqlDataReader myReader = cmd.ExecuteReader();

        if (myReader.Read())
        {
            processdate.Text        = myReader["ERSAdvanceRequestProcessDate"].ToString();
            advanceapplydate.Text   = myReader["ERSApplyDate"].ToString();
            AdvanceRemarks.Text     = myReader["ERSAdvanceApproverRemarks"].ToString();
            AdvanceclaimStatus.Text = myReader["ERSAdavanceRequestStatus"].ToString();
            myReader.Close();
            con.Close();
        }
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        //Code to hide "Forward To Next Level" for ApproverID "SNPL1107"

        if (Session["SessionEmployeeID"].ToString() == "SNPL-HYD-1107")
        {
            //this.ActionDropDown.Items.FindByValue("1").Enabled = false;
            ActionDropDown.Items.Remove("Forward to Next Level");
        }

        if (AdvanceclaimStatus.Text == "Approved" || AdvanceclaimStatus.Text == "Rejected")
        {
            AdvanceclaimStatus.Text    = row.Cells[2].Text;
            ActionDropDown.Visible     = false;
            processdate.Visible        = true;
            aprocessdate.Visible       = true;
            aaction.Visible            = false;
            Submit.Visible             = false;
            AdvanceRemarks.ReadOnly    = true;
            aremarks.Visible           = true;
            AdvanceRemarks.BorderStyle = BorderStyle.None;
            AdvanceRemarks.BorderColor = System.Drawing.Color.WhiteSmoke;
            AdvanceRemarks.BackColor   = System.Drawing.Color.WhiteSmoke;

            //claimAmount.ReadOnly = true;
            //UserRemarks.ReadOnly = true;
            //ClaimUpdate.Visible = false;
        }
        else
        {
            processdate.Visible        = false;
            aprocessdate.Visible       = false;
            ActionDropDown.Visible     = true;
            aaction.Visible            = true;
            Submit.Visible             = true;
            AdvanceRemarks.ReadOnly    = false;
            aremarks.Visible           = true;
            AdvanceRemarks.BorderStyle = BorderStyle.Solid;
            AdvanceRemarks.BorderColor = System.Drawing.Color.LightGray;
            AdvanceRemarks.BackColor   = System.Drawing.Color.White;
        }
        if (e.CommandName == "Edit_Click")
        {
            MPE.Enabled         = true;
            UpdatePanel.Visible = true;
            MPE.Show();
        }
    }
Beispiel #22
0
    protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int         index = Convert.ToInt32(e.CommandArgument);
        GridViewRow row   = GridView1.Rows[index];

        advanceid.Text       = row.Cells[0].Text;
        advreason.Text       = row.Cells[1].Text;
        advancegrosspay.Text = row.Cells[2].Text;
        //  AdvAmount.Text = row.Cells[3].Text;
        advancestatus.Text = row.Cells[4].Text;
        SqlConnection con = new SqlConnection(cs);

        con.Open();
        SqlCommand    cmd      = new SqlCommand("select ERSAdavanceRequestStatus,ERSApplyDate,ERSAdvanceAmount,ERSAdvanceApproverRemarks from ERSAdvancePay where ERSAdvanceID = '" + advanceid.Text + "'", con);
        SqlDataReader myReader = cmd.ExecuteReader();

        if (myReader.Read())
        {
            advancestatus.Text = myReader["ERSAdavanceRequestStatus"].ToString();
            AdvAmount.Text     = myReader["ERSAdvanceAmount"].ToString();
            myReader.Close();
            con.Close();
        }
        SqlDataAdapter da = new SqlDataAdapter(cmd);

        Select();

        if (advancestatus.Text == "Approved" || advancestatus.Text == "Rejected")
        {
            // AdvanceStatus.Text = this.GridView1.SelectedRow.Cells[4].Text.ToString();
            advreason.ReadOnly = true;
            // AdvanceReason.Visible = false;
            advanceapplydate.Visible = true;
            advancestatus.Visible    = true;
            // delete.Visible = false;
            AdvAmount.ReadOnly      = true;
            update.Visible          = false;
            advancegrosspay.Visible = true;
            advanceremarks.Visible  = true;
            advremarks.Visible      = true;
        }
        else
        {
            advreason.ReadOnly = false;
            AdvAmount.Visible  = true;
            // AdvanceReason.Visible = false;
            advanceremarks.Visible   = false;
            advanceapplydate.Visible = true;
            AdvAmount.ReadOnly       = false;
            update.Visible           = true;
            advancegrosspay.Visible  = true;
            //delete.Visible = true;
            advanceremarks.Visible = false;
            advremarks.Visible     = false;
        }
        if (e.CommandName == "Edit_Click")
        {
            MPE.Enabled         = true;
            UpdatePanel.Visible = true;
            MPE.Show();
        }
        if (e.CommandName == "Delete_Click")
        {
            Delete_Advancepay();
        }
    }