Exemplo n.º 1
0
        public void LOG
            (string objtype, string action, int objID, string detail1, string detail2)
        {
            IEventLog engine       = new IEventLog(HELPERS.NewOdbcConn_FORCE());
            int       babylogentry =
                engine.NewEventLog
                    (DateTime.Now, this.idUser, this.strIPaddr,
                    action, objtype);

            engine.SetEventLog
                (babylogentry,
                DateTime.Now, this.idUser, this.strIPaddr,
                action, objID, detail1, detail2, objtype);
        }
Exemplo n.º 2
0
	 private void UpdateBusRoleLinksINCR
		(string mode, string newbroles, int IDsubpr, int IDws, Array IDSwsentrow,
		 Array ARRmultiselOldEditStat,
		 Array ARRmultiselOldBroleList,
		 int idUser, string strIPaddr)
	 {
		for (int i=0; i < IDSwsentrow.Length; i++) {
		  string _IDwserow = IDSwsentrow.GetValue(i) as string;
		  int IDwserow = int.Parse(_IDwserow);
 
		  string[] _newones = newbroles.Split(' ');
		  foreach (string newone in _newones)
			 {
				if (newone == "")
				  continue;

				int IDbrole = HELPERS.FindBusRoleByAbbrev(newone, IDsubpr);

				bool chgWasPerformed = false;

				switch (mode)
				  {
				  case "ADD":
					 chgWasPerformed =
						HELPERS.RecordLinkFromBusRoleToEntitlementVector(
																					HELPERS.NewOdbcConn(), IDbrole, IDwserow, IDws);
					 break;

				  case "DEL":
					 chgWasPerformed
						=
						HELPERS.DestroyLinkFromBusRoleToWSEntitVector
						(
						 HELPERS.NewOdbcConn(),
						 IDbrole,
						 IDwserow,
						 IDws);
						 
					 break;

				  default:
					 throw new Exception("Invalid mode parameter sent to UpdateBusRoleLinksINCR");
				  }

				if (chgWasPerformed)
				  {
					 HELPERS.RunSql
						("UPDATE t_RBSR_AUFW_u_WorkspaceEntitlement " +
						 "SET c_u_EditStatus = c_u_EditStatus | 8 " +
						 "WHERE c_id = " + IDwserow);
					 IEventLog LOG = new IEventLog(HELPERS.NewOdbcConn());
					 int oldEditStatus = Int32.Parse(ARRmultiselOldEditStat.GetValue(i).ToString());
					 if ( 0 == (oldEditStatus & 8)) {
						string oldbroles = ARRmultiselOldBroleList.GetValue(i) as string;
						int IDlog = LOG.NewEventLog(
															 DateTime.Now, idUser,
															 strIPaddr,
															 "OrigWSRoles");
						LOG.SetEventLog(IDlog,
											 DateTime.Now, idUser,
											 strIPaddr, "OrigWSRoles",
											 IDwserow,
											 oldbroles);
					 }
				  }

			 }
		}
            
	 }
Exemplo n.º 3
0
        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/html";

            AFWACsession session = context.Session["AFWACSESSION"] as AFWACsession;

            string action                  = context.Request.Params["action"];
            string csvfolder               = context.Request.Params["csvfolder"];
            string csvfilename             = context.Request.Params["csvfilename"];
            int    startat                 = int.Parse(context.Request.Params["startat"]);
            int    count                   = int.Parse(context.Request.Params["count"]);
            string howToHandleNonRegTCodes = context.Request.Params["handlenonregtc"];   // Will be either WARN or ERR


            context.Response.Write("<p>Processing a set of " + count.ToString() + " records starting at record #" + startat.ToString() + "...\n<pre>\n");
            context.Response.Flush();

            Queue RETmsgs = new Queue();

            DataTable dt = HELPERS.LoadCsv(csvfolder, csvfilename);

            System.Data.Odbc.OdbcConnection conn =

                new System.Data.Odbc.OdbcConnection(
                    ConfigurationManager.AppSettings["DBconnstr"]);

            conn.Open();

            IEventLog LOGGER = new IEventLog(conn);

            DateTime NOW = DateTime.Now;



            if (action == "initiate")
            {
                // This is the filename on the original client side, the one
                // that would be recognized by the end user who initiated the upload.
                string origfilename = context.Request.Params["origfilename"];
                int    baby         = LOGGER.NewEventLog(NOW, session.idUser, session.strIPaddr, "UpSAPEnts", "");
                LOGGER.SetEventLog(baby, NOW, session.idUser, session.strIPaddr, "UpSAPEnts", 0, "Start", "Name of file uploaded to RAF server: " + origfilename, "");
                context.Response.Write("<script>window.location.href='UploadSAPEntitlementsViaChain.ashx?handlenonregtc=" + howToHandleNonRegTCodes + "&action=cont&now=" + NOW.Ticks.ToString() + "&startat=0"
                                       + "&count=" + count + "&csvfolder=" + HttpUtility.UrlEncode(csvfolder) + "&csvfilename=" + HttpUtility.UrlEncode(csvfilename) + "';</script>\n");
                context.Response.Flush();
                return;
            }
            else
            {
                NOW = new DateTime(long.Parse(context.Request.Params["now"]));
            }


            if (action == "summary")
            {
                context.Response.Write("\n</pre><H3>Upload has completed.</H3>\n");
                context.Response.Write("<P>Complete set of messages is shown below.  Please review carefully.<hr/><pre>\n");
                returnListEventLog[] ret = LOGGER.ListEventLog_ForSpecificTimestamp(NOW, null);
                foreach (returnListEventLog amsg in ret)
                {
                    switch (amsg.Detail1)
                    {
                    case "Start":
                        continue;

                    case "Completion":
                        continue;

                    case "Warning":
                        context.Response.Write("Warning: " + amsg.Detail2 + "\n");
                        break;

                    case "Error":
                        context.Response.Write("ERROR: " + amsg.Detail2 + "\n");
                        break;
                    }
                }
                context.Response.Write("\n</pre>");
                context.Response.Write("<hr/>To return to the RAF screen, <a href='../HOME.aspx'>click here</a>.\n");
                return;
            }



            bool processingCompleted = SAP_HELPERS.ImportSAPAuthFrameworkFromCSV
                                           (dt, session.idUser, session.idSubprocess, conn, RETmsgs,
                                           session.idWorkspace_SAP, startat, count, howToHandleNonRegTCodes);

            if (RETmsgs.Count > 0)
            {
                foreach (object objMsg in RETmsgs.ToArray())
                {
                    context.Response.Write("\n" + objMsg.ToString());
                    int baby = LOGGER.NewEventLog(NOW, session.idUser, session.strIPaddr, "UpSAPEnts", "");
                    LOGGER.SetEventLog(baby, NOW, session.idUser, session.strIPaddr, "UpSAPEnts", 0, "Warning", objMsg.ToString(), "");
                }
            }

            if (processingCompleted)
            {
                int baby = LOGGER.NewEventLog(NOW, session.idUser, session.strIPaddr, "UpSAPEnts", "");
                LOGGER.SetEventLog(baby, NOW, session.idUser, session.strIPaddr, "UpSAPEnts", 0, "Completion", "", "");
                context.Response.Write("<script>window.location.href='UploadSAPEntitlementsViaChain.ashx?action=summary&now=" + context.Request.Params["now"] + "&startat="
                                       + (startat.ToString()) + "&count=" + count + "&csvfolder=" + HttpUtility.UrlEncode(csvfolder) + "&csvfilename=" + HttpUtility.UrlEncode(csvfilename) + "';</script>\n");
            }
            else
            {
                context.Response.Write("\n</pre><hr/>This process will <u>automatically</u> proceed to the next set of records.  Any messages shown above were logged and the entire set of messages will be re-displayed when this upload has completed.  Thank you for your patience.  DO NOT CLOSE THIS WINDOW and DO NOT HIT F5 and DO NOT HIT 'BACK'.\n");
                startat += count;
                context.Response.Write("<script>window.location.href='UploadSAPEntitlementsViaChain.ashx?action=cont&handlenonregtc=" + howToHandleNonRegTCodes + "&now=" + context.Request.Params["now"] + "&startat="
                                       + (startat.ToString()) + "&count=" + count + "&csvfolder=" + HttpUtility.UrlEncode(csvfolder) + "&csvfilename=" + HttpUtility.UrlEncode(csvfilename) + "';</script>\n");
            }
        }