protected void Realized_Click(object sender, EventArgs e)
    {
        try
        { string UG;
          string USERID = TxtUserId.Text.ToUpper();
          UG = LG.GetUserGroup(Session["BRCD"].ToString(), USERID.ToString());

          if (UG != "1")
          {
              int RC = LG.RealizedUser(USERID.ToString(), Session["BRCD"].ToString());
              if (RC > 0)
              {
                  TxtUserId.Text = "";
                  WebMsgBox.Show(USERID.ToString() + " User released successfully ...!!", this.Page);
                  CLM.LOGDETAILS("Insert", Session["BRCD"].ToString(), Session["MID"].ToString(), "Released_User _" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString());
                  return;
              }
              else
              {
                  TxtUserId.Text = "";
                  WebMsgBox.Show(USERID.ToString() + " is inavlid login Code ...!!", this.Page);
                  return;
              }
          }
          else
          {
              TxtUserId.Text = "";
              WebMsgBox.Show(USERID.ToString() + " User modifictaion is restricted, Operation Terminated ...!!", this.Page);
              return;
          } }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
    public int ForceLogout(string BRCD, string UGRP, string LC)
    {
        int TT = 0;

        try
        {
            if (UGRP != "1")
            {
                int Res = LG.RealizedUser(HttpContext.Current.Session["LOGINCODE"].ToString(), HttpContext.Current.Session["BRCD"].ToString());
                if (Res > 0)
                {
                    TT = 1;
                }
            }
            else
            {
                TT = 1;
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
        return(TT);
    }
Пример #3
0
    protected void DayBegin_Click(object sender, EventArgs e)
    {
        try
        {
            string NextDay = ViewState["EntryDate"].ToString();

            //Check user is admin or not
            //string ADM = DO.checkAdmin(Session["BRCD"].ToString(), Session["LOGINCODE"].ToString());
            //if (ADM != null && ADM != "")
            //{
            //Check how many user currently login
            Result = DO.CheckLoginUser(GrdDayOpen, txtBrCode.Text.Trim().ToString(), Session["MID"].ToString());

            if (Result > 0)
            {
                DivUserLog.Visible = true;
                lblMessage.Text    = "User Login for Branch.. Please Logout this user";
                ModalPopup.Show(this.Page);
                return;
            }
            if (DO.CheckAdminAccess(Convert.ToString(Session["BRCD"]), Convert.ToString(Session["UGRP"])) == 1)
            {
                WebMsgBox.Show("Branch Handover Can Be Done Only By Admin Or Manager ID", this.Page);
                return;
            }
            else
            {
                //Commented By Amol as per darade sir instruction On 2017-03-16
                //  Check Branch Current Status

                //Uncommented by Abhihsek As per Requirement
                //string STR = DO.GetPara_DAYOPEN();
                //if (STR != "N")
                //{
                Result = DO.CheckDayStatus(txtBrCode.Text.Trim().ToString(), ViewState["EntryDate"].ToString());

                if (Result == 1)
                {
                    lblMessage.Text = "Branch Handover Not Completed For " + NextDay + "...!!";
                    ModalPopup.Show(this.Page);
                    return;
                }
                else if (Result == 2)
                {
                    lblMessage.Text = "Day Closed Not Completed For " + NextDay + "...!!";
                    ModalPopup.Show(this.Page);
                    return;
                }
                else if (Result == 3)
                {
                    NextDay = conn.AddMonthDay(NextDay, "1", "D");
A:
                    string Holdy = conn.sExecuteScalar("SELECT COUNT(*) FROM AVS1026 WHERE HOLIDAYDATE = '" + conn.ConvertDate(NextDay) + "' AND STATUS = 1 ");
                    if (Holdy != "0")
                    {
                        NextDay = conn.AddMonthDay(NextDay, "1", "D");
                        goto A;
                    }

                    int RM = DO.DayOpnLstProc(txtBrCode.Text.Trim().ToString(), NextDay, Session["MID"].ToString(), Session["LOGINCODE"].ToString());
                    if (RM > 0)
                    {
                        FL = "Insert";
                        string Res = CLM.LOGDETAILS(FL, txtBrCode.Text.Trim().ToString(), Session["MID"].ToString(), "Day_Open _" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString());
                        LG.RealizedUser(HttpContext.Current.Session["LOGINCODE"].ToString(), HttpContext.Current.Session["BRCD"].ToString());

                        Response.Redirect("FrmLogin.aspx", false);
                        lblMessage.Text = "Day Open Successfully Complete..!";
                        ModalPopup.Show(this.Page);
                        return;
                    }
                }
                //}
                //else
                //{
                //    Result = DO.CheckDayStatus(txtBrCode.Text.Trim().ToString(), ViewState["EntryDate"].ToString());

                //    if (Result == 1)
                //    {
                //        lblMessage.Text = "Branch Handover Not Completed For " + NextDay + "...!!";
                //        ModalPopup.Show(this.Page);
                //        return;
                //    }
                //    else if (Result == 2)
                //    {
                //        lblMessage.Text = "Day Closed Not Completed For " + NextDay + "...!!";
                //        ModalPopup.Show(this.Page);
                //        return;
                //    }
                //    else if (Result == 3)
                //    {
                //    NextDay = conn.AddMonthDay(NextDay, "1", "D");
                //A:
                //    string Holdy = conn.sExecuteScalar("SELECT COUNT(*) FROM AVS1026 WHERE HOLIDAYDATE = '" + conn.ConvertDate(NextDay) + "' AND STATUS = 1 ");
                //    if (Holdy != "0")
                //    {
                //        NextDay = conn.AddMonthDay(NextDay, "1", "D");
                //        goto A;
                //    }

                //    int RM = DO.DayOpnLstProc(txtBrCode.Text.Trim().ToString(), NextDay, Session["MID"].ToString(), Session["LOGINCODE"].ToString());
                //    if (RM > 0)
                //    {
                //        FL = "Insert";
                //        string Res = CLM.LOGDETAILS(FL, txtBrCode.Text.Trim().ToString(), Session["MID"].ToString(), "Day_Open _" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString());

                //        if (Session["UGRP"].ToString() != "1")
                //            LG.RealizedUser(HttpContext.Current.Session["LOGINCODE"].ToString(), HttpContext.Current.Session["BRCD"].ToString());

                //        Response.Redirect("FrmLogin.aspx", false);
                //        lblMessage.Text = "Day Open Successfully Complete..!";
                //        ModalPopup.Show(this.Page);
                //        return;
                //    }
                //   }
                //}
            }
            //}
            //else
            //{
            //    lblMessage.Text = "User Is Not Admin.. Please Login Admin User...!!";
            //    ModalPopup.Show(this.Page);
            //    return;
            //}
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }
Пример #4
0
    protected void btnDayClose_Click(object sender, EventArgs e)
    {
        try
        {
            if (txtBrCode.Text.ToString() == "")
            {
                ddlBrName.Focus();
                WebMsgBox.Show("Select branch first ...!!", this.Page);
                return;
            }
            else if (txtWorkDate.Text.ToString() == "")
            {
                btnDayClose.Focus();
                WebMsgBox.Show("Something wrong working date not show ...!!", this.Page);
                return;
            }
            else if (txtOpenDate.Text.ToString() == "")
            {
                btnDayClose.Focus();
                WebMsgBox.Show("Something wrong next open date not show ...!!", this.Page);
                return;
            }
            else
            {
                //Check how many user currently login
                output = act.CheckLoginUser(GrdBranchH, txtBrCode.Text.Trim().ToString(), Session["MID"].ToString());
                if (output > 0)
                {
                    btnDayClose.Focus();
                    WebMsgBox.Show("User is login ...!! Please logout all user ...!!", this.Page);
                    return;
                }
                else
                {
                    //Check Branch Current Status
                    output = act.CheckDayStatus(txtBrCode.Text.ToString(), ViewState["EntryDate"].ToString());
                    if (output == 1)
                    {
                        ddlBrName.Focus();
                        WebMsgBox.Show("Branch handover not completed ...!!", this.Page);
                        return;
                    }
                    else if (output == 2)
                    {
                        output = act.DayCloseActivity(txtBrCode.Text.ToString(), ViewState["EntryDate"].ToString(), Session["LOGINCODE"].ToString(), Session["MID"].ToString());

                        if (output > 0)
                        {
                            WebMsgBox.Show("Day close successfully complete ...!!", this.Page);
                            SendSMS(txtBrCode.Text.ToString(), ViewState["EntryDate"].ToString());
                            LG.RealizedUser(HttpContext.Current.Session["LOGINCODE"].ToString(), HttpContext.Current.Session["BRCD"].ToString());
                            CLM.LOGDETAILS("Insert", txtBrCode.Text.Trim().ToString(), Session["MID"].ToString(), "Day_Close _" + Session["LOGINCODE"].ToString() + "", "00", Session["MID"].ToString());
                            Response.Redirect("FrmLogin.aspx", false);
                            return;
                        }
                    }
                    else if (output == 3)
                    {
                        ddlBrName.Focus();
                        WebMsgBox.Show("Day Closed Already Done ...!!", this.Page);
                        return;
                    }
                }
            }
        }
        catch (Exception Ex)
        {
            ExceptionLogging.SendErrorToText(Ex);
        }
    }