Esempio n. 1
0
        public static bool AddLeaveTippaniDetail
        (
            List <ATTGeneralTippaniSummary> lst,
            object tran,
            int tippaniSubjectID,
            TippaniSubject subject,
            int tippaniID
        )
        {
            string SP;
            List <OracleParameter> paramArray;

            try
            {
                foreach (ATTGeneralTippaniDetail detail in lst)
                {
                    if (detail.Action != "N")
                    {
                        SP         = DLLGeneralTippaniDetail.GetLeaveLevelSP(detail.LeaveLevel, detail.Action);
                        paramArray = DLLGeneralTippaniDetail.GetLeaveLevelSpParameter(detail, tippaniID);

                        SqlHelper.ExecuteNonQuery(tran as OracleTransaction, CommandType.StoredProcedure, SP, paramArray.ToArray());

                        paramArray.Clear();
                    }
                }
                return(true);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
        public static bool UpdateChannelPersonDecisionAndAddProcess(ATTGeneralTippaniProcess process, List <ATTGeneralTippaniProcess> lst, List <ATTGeneralTippaniAttachment> lstAttachment, TippaniSubject subject, List <ATTGeneralTippaniSummary> lstRec)
        {
            string SP = "SP_UPD_CHNL_PERSON_DECISION";

            List <OracleParameter> paramArray = new List <OracleParameter>();

            paramArray.Add(Utilities.GetOraParam("P_ORG_ID", process.OrgID, OracleDbType.Int64, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_TIPPANI_ID", process.TippaniID, OracleDbType.Int64, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_TIPPANI_PRC_ID", process.TippaniProcessID, OracleDbType.Int64, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_NOTE", process.Note, OracleDbType.Varchar2, ParameterDirection.Input));
            paramArray.Add(Utilities.GetOraParam("P_STATUS", process.Status, OracleDbType.Int64, ParameterDirection.Input));

            GetConnection     DBConn = new GetConnection();
            OracleConnection  Conn   = DBConn.GetDbConn(Module.OAS);
            OracleTransaction Tran   = Conn.BeginTransaction();

            try
            {
                if (process != null)
                {
                    if (lstRec.Count > 0)
                    {
                        DLLGeneralTippaniDetail.AddLeaveTippaniDetail(lstRec, Tran, (int)subject, subject, 0);
                    }

                    SqlHelper.ExecuteNonQuery(Tran, CommandType.StoredProcedure, SP, paramArray.ToArray());

                    if (lst.Count > 0)
                    {
                        DLLGeneralTippaniProcess.AddGeneralTippaniProcessDetail(lst, Tran, (int)subject, subject, process.TippaniID);
                    }

                    if (lstAttachment.Count > 0)
                    {
                        DLLGeneralTippaniAttachment.AddAttachment(lstAttachment, Tran, (int)subject, subject, process.TippaniID, process.TippaniProcessID);
                    }
                }

                Tran.Commit();
                return(true);
            }
            catch (Exception ex)
            {
                Tran.Rollback();
                throw ex;
            }
            finally
            {
                Tran.Dispose();
                DBConn.CloseDbConn();
            }
        }