public static STD_WKFACTIVITYSTS GetItemByCode(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, string CODE)
        {
            STD_WKFACTIVITYSTS   objReturn = null;
            STD_WKFACTIVITYSTSDB objDB     = new STD_WKFACTIVITYSTSDB();

            objReturn = objDB.GetItemByCode(CURRENT_USER, CURRENT_REGISTRY_ID, CODE);

            return(objReturn);
        }
        public static Int32 Save(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, STD_WKFACTIVITYSTS objSave)
        {
            Int32 objReturn            = 0;
            STD_WKFACTIVITYSTSDB objDB = new STD_WKFACTIVITYSTSDB();

            objReturn = objDB.Save(CURRENT_USER, CURRENT_REGISTRY_ID, objSave);

            return(objReturn);
        }
        public STD_WKFACTIVITYSTS ParseReaderCustom(DataRow row)
        {
            STD_WKFACTIVITYSTS objReturn = new STD_WKFACTIVITYSTS
            {
                CODE             = (string)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_CODE")),
                CREATED          = (DateTime)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_CREATED")),
                CREATEDBY        = (string)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_CREATEDBY")),
                DESCRIPTION_TEXT = (string)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_DESCRIPTION_TEXT")),
                ID            = (Int32)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_ID")),
                INACTIVE_DATE = (DateTime?)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_INACTIVE_DATE")),
                INACTIVE_FLAG = (bool)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_INACTIVE_FLAG")),
                NAME          = (string)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_NAME")),
                SORT_ORDER    = (Int32)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_SORT_ORDER")),
                UPDATED       = (DateTime)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_UPDATED")),
                UPDATEDBY     = (string)GetNullableObject(row.Field <object>("STD_WKFACTIVITYSTS_UPDATEDBY"))
            };

            return(objReturn);
        }
예제 #4
0
        protected void BtnStart_Click(object sender, EventArgs e)
        {
            ServiceInterfaceManager.LogInformation("POSTBACK_EVENT", String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);

            try
            {
                STD_WKFACTIVITYSTS status = ServiceInterfaceManager.STD_WKFACTIVITYSTS_GET_BY_CODE(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, "IN PROGRESS");
                if (status != null && ServiceInterfaceManager.WKF_CASE_ACTIVITY_UPDATE_STATUS(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId, UserSession.CurrentActivityId, status.ID))
                {
                    lblResult.Text = "This Activity has started.<br /><br />";
                    LoadForm();
                }
                else
                {
                    lblResult.Text = "An unexpected error occurred, please try again.<br /><br />";
                }
            }
            catch (Exception ex)
            {
                ServiceInterfaceManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);
                throw ex;
            }
        }
        public STD_WKFACTIVITYSTS GetItemByCode(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, string CODE)
        {
            STD_WKFACTIVITYSTS objReturn = null;

            SqlConnection  sConn    = null;
            SqlCommand     sCmd     = null;
            SqlDataAdapter sAdapter = null;
            DataSet        objTemp  = null;

            try
            {
                sConn = new SqlConnection(SqlConnectionString);

                sConn.Open();

                sCmd = new SqlCommand("CRS.usp_STD_WKFACTIVITYSTS_getitemByCode", sConn);
                sCmd.CommandTimeout = SqlCommandTimeout;
                sCmd.CommandType    = CommandType.StoredProcedure;
                sCmd.Parameters.AddWithValue("@CURRENT_USER", CURRENT_USER);
                sCmd.Parameters.AddWithValue("@CURRENT_REGISTRY_ID", CURRENT_REGISTRY_ID);
                sCmd.Parameters.AddWithValue("@CODE", CODE);

                objTemp  = new DataSet();
                sAdapter = new SqlDataAdapter(sCmd);

                LogDetails logDetails = new LogDetails(String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID);
                sAdapter.Fill(objTemp);
                LogManager.LogTiming(logDetails);
                CheckDataSet(objTemp);

                if (objTemp != null && objTemp.Tables.Count > 0 && objTemp.Tables[0].Rows.Count > 0)
                {
                    objReturn = ParseReader(objTemp.Tables[0].Rows[0]);
                }

                sConn.Close();
            }
            catch (Exception ex)
            {
                LogManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID);
                throw ex;
            }
            finally
            {
                if (sAdapter != null)
                {
                    sAdapter.Dispose();
                    sAdapter = null;
                }
                if (sCmd != null)
                {
                    sCmd.Dispose();
                    sCmd = null;
                }
                if (sConn != null)
                {
                    if (sConn.State != ConnectionState.Closed)
                    {
                        sConn.Close();
                    }
                    sConn.Dispose();
                    sConn = null;
                }
            }

            return(objReturn);
        }
        public Int32 Save(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, STD_WKFACTIVITYSTS objSave)
        {
            Int32 objReturn = 0;

            SqlConnection sConn = null;
            SqlCommand    sCmd  = null;
            SqlParameter  p     = null;

            try
            {
                sConn = new SqlConnection(SqlConnectionString);

                sConn.Open();

                sCmd = new SqlCommand("CRS.usp_STD_WKFACTIVITYSTS_save", sConn);
                sCmd.CommandTimeout = SqlCommandTimeout;
                sCmd.CommandType    = CommandType.StoredProcedure;
                sCmd.Parameters.AddWithValue("@CURRENT_USER", CURRENT_USER);
                sCmd.Parameters.AddWithValue("@CURRENT_REGISTRY_ID", CURRENT_REGISTRY_ID);

                p           = new SqlParameter("@CODE", SqlDbType.VarChar, 50);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.CODE);
                p           = new SqlParameter("@CREATED", SqlDbType.DateTime, 8);
                p.Precision = 23;
                p.Scale     = 3;
                AddParameter(ref sCmd, ref p, objSave.CREATED);
                p           = new SqlParameter("@CREATEDBY", SqlDbType.VarChar, 30);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.CREATEDBY);
                p           = new SqlParameter("@DESCRIPTION_TEXT", SqlDbType.VarChar, 500);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.DESCRIPTION_TEXT);
                p           = new SqlParameter("@ID", SqlDbType.Int, 4);
                p.Direction = ParameterDirection.InputOutput;
                p.Precision = 10;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.ID);
                p           = new SqlParameter("@INACTIVE_DATE", SqlDbType.DateTime, 8);
                p.Precision = 23;
                p.Scale     = 3;
                AddParameter(ref sCmd, ref p, objSave.INACTIVE_DATE);
                p           = new SqlParameter("@INACTIVE_FLAG", SqlDbType.Bit, 1);
                p.Precision = 1;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.INACTIVE_FLAG);
                p           = new SqlParameter("@NAME", SqlDbType.VarChar, 100);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.NAME);
                p           = new SqlParameter("@SORT_ORDER", SqlDbType.Int, 4);
                p.Precision = 10;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.SORT_ORDER);
                p           = new SqlParameter("@UPDATED", SqlDbType.DateTime, 8);
                p.Precision = 23;
                p.Scale     = 3;
                AddParameter(ref sCmd, ref p, objSave.UPDATED);
                p           = new SqlParameter("@UPDATEDBY", SqlDbType.VarChar, 30);
                p.Precision = 0;
                p.Scale     = 0;
                AddParameter(ref sCmd, ref p, objSave.UPDATEDBY);

                LogDetails logDetails = new LogDetails(String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID);
                int        cnt        = sCmd.ExecuteNonQuery();
                LogManager.LogTiming(logDetails);

                objReturn = (Int32)sCmd.Parameters["@ID"].Value;

                sConn.Close();
            }
            catch (Exception ex)
            {
                LogManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), CURRENT_USER, CURRENT_REGISTRY_ID);
                throw ex;
            }
            finally
            {
                if (sCmd != null)
                {
                    sCmd.Dispose();
                    sCmd = null;
                }
                if (sConn != null)
                {
                    if (sConn.State != ConnectionState.Closed)
                    {
                        sConn.Close();
                    }
                    sConn.Dispose();
                    sConn = null;
                }
            }

            return(objReturn);
        }
 public static Boolean Delete(string CURRENT_USER, Int32 CURRENT_REGISTRY_ID, STD_WKFACTIVITYSTS objDelete)
 {
     return(Delete(CURRENT_USER, CURRENT_REGISTRY_ID, objDelete.ID));
 }