Ejemplo n.º 1
0
        protected void uobuttonSave_Click(object sender, EventArgs e)
        {
            try
            {
                string strLogDescription;
                string strFunction;

                string strMessage = UserAccountBLL.AddUpdateRole(uotextboxRoleName.Text, uohiddenRoleId.Value, uotextboxRoleDesc.Text);
                AlertMessage(strMessage);

                if (Request.QueryString["rId"] == "0" || Request.QueryString["rId"] == null)
                {
                    //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                    strLogDescription = "User role added.";
                    strFunction       = "uobuttonSave_Click";

                    DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                    BLL.AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                          CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                }
                else
                {
                    //Insert log audit trail (Gabriel Oquialda - 17/11/2011)
                    strLogDescription = "User role updated.";
                    strFunction       = "uobuttonSave_Click";

                    DateTime dateNow = CommonFunctions.GetCurrentDateTime();

                    BLL.AuditTrailBLL.InsertLogAuditTrail(0, "", strLogDescription, strFunction, Path.GetFileName(Request.Path),
                                                          CommonFunctions.GetDateTimeGMT(dateNow), DateTime.Now, GlobalCode.Field2String(Session["UserName"]));
                }

                OpenParentPage();
            }
            catch (Exception ex)
            {
                AlertMessage(ex.Message);
            }
        }