Ejemplo n.º 1
0
        /// <summary>
        /// This method is used for setting the Session variable for userId
        /// and also check accessing priviledges for particular user.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            string uid = "";

            DBOperations.DBUtil dbobj = new DBOperations.DBUtil(System.Configuration.ConfigurationSettings.AppSettings["Servosms"], true);
            try
            {
                uid = (Session["User_Name"].ToString());
            }
            catch (Exception ex)
            {
                CreateLogFiles.ErrorLog("Form:Addtandance_Registor,Method:Page_load Exception :" + ex.Message + "  userid " + uid);
                Response.Redirect("../../Sysitem/ErrorPage.aspx", false);
                return;
            }

            if (!IsPostBack)
            {
                txtdate.Text = GenUtil.str2DDMMYYYY(System.DateTime.Now.ToShortDateString());


                panEmp.Visible = false;
                #region Check Privileges
                int    i;
                string View_flag = "0", Add_Flag = "0", Edit_Flag = "0", Del_Flag = "0";
                string Module    = "2";
                string SubModule = "1";
                string[,] Priv = (string[, ])Session["Privileges"];
                for (i = 0; i < Priv.GetLength(0); i++)
                {
                    if (Priv[i, 0] == Module && Priv[i, 1] == SubModule)
                    {
                        View_flag = Priv[i, 2];
                        Add_Flag  = Priv[i, 3];
                        Edit_Flag = Priv[i, 4];
                        Del_Flag  = Priv[i, 5];
                        break;
                    }
                }
                if (View_flag == "0")
                {
                    //string msg="UnAthourized Visit to Attandance Register Page";
                    Response.Redirect("../../Sysitem/AccessDeny.aspx", false);
                    return;
                }
                if (Add_Flag == "0")
                {
                    Btnsave.Enabled = false;
                }
                #endregion
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// This method is used for setting the Session variable for userId and
 /// after that filling the required dropdowns with database values
 /// and also check accessing priviledges for particular user
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 protected void Page_Load(object sender, System.EventArgs e)
 {
     // Put user code to initialize the page here
     try
     {
         string pass;
         pass = (Session["User_Name"].ToString());
     }
     catch
     {
         Response.Redirect("../../Sysitem/ErrorPage.aspx", false);
         return;
     }
     if (!IsPostBack)
     {
         DBOperations.DBUtil dbobj = new DBOperations.DBUtil(System.Configuration.ConfigurationSettings.AppSettings["Servosms"], true);
         #region Check Privileges
         int    i;
         string View_flag = "0", Add_Flag = "0", Edit_Flag = "0", Del_Flag = "0";
         string Module    = "4";
         string SubModule = "2";
         string[,] Priv = (string[, ])Session["Privileges"];
         for (i = 0; i < Priv.GetLength(0); i++)
         {
             if (Priv[i, 0] == Module && Priv[i, 1] == SubModule)
             {
                 View_flag = Priv[i, 2];
                 Add_Flag  = Priv[i, 3];
                 Edit_Flag = Priv[i, 4];
                 Del_Flag  = Priv[i, 5];
                 break;
             }
         }
         if (Add_Flag == "0" && Edit_Flag == "0" && View_flag == "0")
         {
             //string msg="UnAthourized Visit to Price Updation Page";
             //	dbobj.LogActivity(msg,Session["User_Name"].ToString());
             Response.Redirect("../../Sysitem/AccessDeny.aspx", false);
         }
         //if(Add_Flag =="0" && Edit_Flag == "0")
         //	Btnsubmit1.Enabled = false;
         #endregion
     }
     getdbHsnValues();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// This method is used for setting the Session variable for userId
        /// and also check accessing priviledges for particular user
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
            string uid = "";

            DBOperations.DBUtil dbobj = new DBOperations.DBUtil(System.Configuration.ConfigurationSettings.AppSettings["Servosms"], true);
            try
            {
                uid = (Session["User_Name"].ToString());
            }
            catch (Exception ex)
            {
                CreateLogFiles.ErrorLog("Form:Leave_Assignment.aspx.cs,Method:Page_load Exception " + ex.Message + "  userid " + uid);
                Response.Redirect("../../Sysitem/ErrorPage.aspx", false);
                return;
            }
            if (!IsPostBack)
            {
                #region Check Privileges
                int    i;
                string View_flag = "0", Add_Flag = "0", Edit_Flag = "0", Del_Flag = "0";
                string Module    = "2";
                string SubModule = "4";
                string[,] Priv = (string[, ])Session["Privileges"];
                for (i = 0; i < Priv.GetLength(0); i++)
                {
                    if (Priv[i, 0] == Module && Priv[i, 1] == SubModule)
                    {
                        View_flag = Priv[i, 2];
                        Add_Flag  = Priv[i, 3];
                        Edit_Flag = Priv[i, 4];
                        Del_Flag  = Priv[i, 5];
                        break;
                    }
                }
                if (View_flag == "0")
                {
                    Response.Redirect("../../Sysitem/AccessDeny.aspx", false);
                }
                #endregion
            }
        }