コード例 #1
0
 protected void lnk_Edit_Command(object sender, CommandEventArgs e)
 {
     try
     {
         //int I_ID = Convert.ToInt32(e.CommandArgument);
         rmp_MainPage.SelectedIndex         = 1;
         btn_Save.Visible                   = false;
         btn_Update.Visible                 = true;
         btn_Cancel.Visible                 = true;
         Session["I_ID"]                    = Convert.ToString(e.CommandArgument);
         obj_smhr_announcement              = new SMHR_ANNOUNCEMENT();
         obj_smhr_announcement.ANNCE_ID     = Convert.ToInt32(e.CommandArgument);
         obj_smhr_announcement.ANNCE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
         obj_smhr_announcement.OPERATION    = operation.Edit;
         DataTable dt_Edit = BLL.get_Announcement(obj_smhr_announcement);
         if (dt_Edit.Rows.Count > 0)
         {
             txt_Title.Text              = Convert.ToString(dt_Edit.Rows[0]["ANNCE_TITLE"]);
             txt_Description.Text        = Convert.ToString(dt_Edit.Rows[0]["ANNCE_MESSAGE"]);
             rdp_ExpiryDate.SelectedDate = Convert.ToDateTime(dt_Edit.Rows[0]["ANNCE_EXP_DATE"]);
         }
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Announcements", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
コード例 #2
0
 public void loadGrid()
 {
     try
     {
         obj_smhr_announcement              = new SMHR_ANNOUNCEMENT();
         obj_smhr_announcement.OPERATION    = operation.Select;
         obj_smhr_announcement.ANNCE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
         DataTable dt_loadGrid = BLL.get_Announcement(obj_smhr_announcement);
         rg_Main.DataSource = dt_loadGrid;
     }
     catch (Exception ex)
     {
         SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Announcements", ex.StackTrace, DateTime.Now);
         Response.Redirect("~/Frm_ErrorPage.aspx");
     }
 }
コード例 #3
0
    protected void btn_Save_Click(object sender, EventArgs e)
    {
        try
        {
            obj_smhr_announcement                = new SMHR_ANNOUNCEMENT();
            obj_smhr_announcement.ANNCE_TITLE    = Convert.ToString(txt_Title.Text.Replace("'", "''"));
            obj_smhr_announcement.ANNCE_MESSAGE  = Convert.ToString(txt_Description.Text.Replace("'", "''"));
            obj_smhr_announcement.ANNCE_EXP_DATE = Convert.ToDateTime(rdp_ExpiryDate.SelectedDate);
            obj_smhr_announcement.ANNCE_ORG_ID   = Convert.ToInt32(Session["ORG_ID"]);
            switch (((Button)sender).ID.ToUpper())
            {
            case "BTN_SAVE":

                obj_smhr_announcement.ANNCE_CREATEDBY   = Convert.ToInt32(Session["USER_ID"]);
                obj_smhr_announcement.ANNCE_CREATEDDATE = Convert.ToDateTime(DateTime.Now);
                obj_smhr_announcement.OPERATION         = operation.Insert;
                if (BLL.set_Announcement(obj_smhr_announcement))
                {
                    BLL.ShowMessage(this, "Information Saved Successfully");
                }
                break;

            case "BTN_UPDATE":
                obj_smhr_announcement.ANNCE_LASTMDFBY   = Convert.ToInt32(Session["USER_ID"]);
                obj_smhr_announcement.ANNCE_LASTMDFDATE = Convert.ToDateTime(DateTime.Now);
                obj_smhr_announcement.ANNCE_ID          = Convert.ToInt32(Session["I_ID"]);
                obj_smhr_announcement.OPERATION         = operation.Update;
                if (BLL.set_Announcement(obj_smhr_announcement))
                {
                    BLL.ShowMessage(this, "Information Updated Successfully");
                }
                break;

            default:
                break;
            }
            rmp_MainPage.SelectedIndex = 0;
            loadGrid();
            rg_Main.DataBind();
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Announcements", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }
コード例 #4
0
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {
            if (Convert.ToString(Request.QueryString["ctrl"]) == "SS")
            {
                BLL.ShowMessage(this, "You dont have enough priveleges to access this screen");
                return;
            }
            getDoj();
            ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(), "function pageLoad(){   }", true);
            if (!Page.IsPostBack)
            {
            }

            if (!Page.IsPostBack)
            {
                Session["DASHBOARD"] = "true";
            }
            if (Convert.ToString(Session["EMP_ID"]) == "")
            {
                Response.Redirect("Login.aspx", false);
            }
            if (!Page.IsPostBack)
            {
                lbl_Birthday.Text = DateTime.Now.ToLongDateString().ToUpper();
                getBirthday();
            }


            //#region Displaying Employee Information
            //_obj_smhr_employee = new SMHR_EMPLOYEE();
            //_obj_smhr_employee.OPERATION = operation.Select;
            //_obj_smhr_employee.EMP_ID = Convert.ToInt32(Session["EMP_ID"]);
            //_obj_smhr_employee.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            //DataTable dt_Details = BLL.get_Employee(_obj_smhr_employee);
            //if (dt_Details.Rows.Count > 0)
            //{
            //    if (Convert.ToString(dt_Details.Rows[0]["EMP_PICTURE"]) != string.Empty)
            //    {
            //        ViewState["fileLocation"] = dt_Details.Rows[0]["EMP_PICTURE"];
            //        EMP_IMAGE.ImageUrl = Convert.ToString(dt_Details.Rows[0]["EMP_PICTURE"]);
            //    }
            //    else
            //    {
            //        //EMP_IMAGE.Visible = false;
            //        EMP_IMAGE.ImageUrl = Convert.ToString("~/Images/nophoto.jpg");
            //    }
            //}

            //_obj_smhr_Dashboard = new SMHR_DAHSBOARD();
            //_obj_smhr_Dashboard.OPERATION = operation.Select_Emp;
            //_obj_smhr_Dashboard.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
            //_obj_smhr_Dashboard.SMHR_DASHBOARD_LOGIN_ID = Convert.ToInt32(Session["EMP_ID"]);
            //DataTable dt_getEMP_ID = BLL.get_EMP_ID(_obj_smhr_Dashboard);
            //if (dt_getEMP_ID.Rows.Count != 0)
            //{
            //    lbl_empcode.Text = Convert.ToString(dt_getEMP_ID.Rows[0][0]);
            //    lbl_EmpName.Text = Convert.ToString(dt_getEMP_ID.Rows[0][1]);
            //    lbl_EmpDesignation.Text = Convert.ToString(dt_getEMP_ID.Rows[0][2]);
            //    lbl_EmpDepartment.Text = Convert.ToString(dt_getEMP_ID.Rows[0][3]);
            //}
            //#endregion

            #region Notification-Text
            Table     tbl = new Table();
            TableRow  row;
            TableCell cell;
            System.Web.UI.WebControls.Image img;
            string str_Scroll = string.Empty;
            _obj_smhr_Announcement              = new SMHR_ANNOUNCEMENT();
            _obj_smhr_Announcement.OPERATION    = operation.Select;
            _obj_smhr_Announcement.ANNCE_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
            DataTable dt_Scroll = BLL.get_Announcement(_obj_smhr_Announcement);
            if (dt_Scroll.Rows.Count > 0)
            {
                for (int I_dtCount = 0; I_dtCount < dt_Scroll.Rows.Count; I_dtCount++)
                {
                    img       = new System.Web.UI.WebControls.Image();
                    row       = new TableRow();
                    cell      = new TableCell();
                    cell.Text = Convert.ToString((I_dtCount) + 1) + ")" + " " + Convert.ToString(dt_Scroll.Rows[I_dtCount]["ANNCE_MESSAGE"]) + '\n';
                    row.Controls.Add(cell);
                    cell = new TableCell();
                    cell.Controls.Add(img);
                    img.ImageUrl = Convert.ToString("~/Images/new_animation.gif");
                    row.Controls.Add(cell);
                    tbl.Rows.Add(row);
                    pnl_Notification.Controls.Add(tbl);
                }
                //for (int I_dtCount = 0; I_dtCount < dt_Scroll.Rows.Count; I_dtCount++)
                //{
                //    str_Scroll = str_Scroll + Convert.ToString((I_dtCount)+1) +")" +  " " + Convert.ToString(dt_Scroll.Rows[I_dtCount]["ANNCE_MESSAGE"]) + '\n';
                //}
                //txt_Notification.Text = str_Scroll;
            }
            #endregion
            if (!Page.IsPostBack)
            {
                Session["DASHBOARD"] = "true";
                if (Session["PendingKra"] != null)
                {
                    //pms_kraform _obj_kra = new pms_kraform();
                    //_obj_kra.KRA_MODE = 9;
                    //_obj_kra.KRA_ORG_ID = Convert.ToInt32(Session["ORG_ID"]);
                    //_obj_kra.LOGIN_ID = Convert.ToInt32(Session["USER_ID"]);
                    //DataTable dt = Pms_Bll.get_kra(_obj_kra);
                    //if (dt.Rows.Count > 0)
                    //{
                    //    SMHR_LOGININFO _obj_Smhr_LoginInfo = new SMHR_LOGININFO();
                    //    _obj_Smhr_LoginInfo.OPERATION = operation.Empty1;
                    //    _obj_Smhr_LoginInfo.LOGIN_USERNAME = Convert.ToString(Session["USERNAME"]).Trim();
                    //    _obj_Smhr_LoginInfo.ORGANISATION_ID = Convert.ToInt32(Session["ORG_ID"]);
                    //    _obj_Smhr_LoginInfo.LOGIN_PASS_CODE = Convert.ToString("KRA Approval");
                    //    DataTable dtformdtls = BLL.get_LoginInfo(_obj_Smhr_LoginInfo);
                    //    if (dtformdtls.Rows.Count > 0)
                    //    {
                    //        if (((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == true)) ||
                    //            ((Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_READ"]) == true) && (Convert.ToBoolean(dtformdtls.Rows[0]["TYPSEC_WRITE"]) == false)))
                    //        {
                    //            ScriptManager.RegisterStartupScript(this, this.GetType(), Guid.NewGuid().ToString(),
                    //            "function pageLoad(){  ShowPop(); }", true);
                    //        }
                    //    }
                    //}
                    Session.Remove("PendingKra");
                }
            }
        }
        catch (Exception ex)
        {
            SMHR.BLL.Error_Log(Session["USER_ID"].ToString(), ex.TargetSite.ToString(), ex.Message.Replace("'", "''"), "frm_Dashboradmngr", ex.StackTrace, DateTime.Now);
            Response.Redirect("~/Frm_ErrorPage.aspx");
        }
    }