예제 #1
0
        public Tuple <string, int> SaveFromSAP(List <tbl_LeaveQuotaSAP> tbl_User)
        {
            try
            {
                DALBase obj = new DALBase(_config);
                List <Tuple <string, OracleDbType, int, object, ParameterDirection> > LstTupParameters = new List <Tuple <string, OracleDbType, int, object, ParameterDirection> >();
                foreach (var l in tbl_User)
                {
                    obj.TupleForOracleParameter(LstTupParameters, ConstantsVariables.P_EMPID, OracleDbType.NVarchar2, 50, Convert.ToString(l.EMPLOYEEID), ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, ConstantsVariables.P_LEAVEID, OracleDbType.NVarchar2, 50, Convert.ToString(l.LEAVECODE), ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, ConstantsVariables.P_LEAVECATEGORY, OracleDbType.NVarchar2, 1000, Convert.ToString(l.LEAVECATEGORY), ParameterDirection.Input);
                    string startdate = Convert.ToDateTime(l.STARTDATE).ToString("dd/MM/yyyy");
                    string endate    = Convert.ToDateTime(l.ENDDATE).ToString("dd/MM/yyyy");
                    obj.TupleForOracleParameter(LstTupParameters, "P_STARTDATE", OracleDbType.NVarchar2, 120, Convert.ToString(startdate), ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, "P_ENDDATE", OracleDbType.NVarchar2, 120, Convert.ToString(endate), ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, "P_QUOTA", OracleDbType.Double, 100, l.QUOTA, ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, ConstantsVariables.P_BALANCELEAVE, OracleDbType.Double, 100, l.BALANCELEAVE, ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, ConstantsVariables.P_APPROVERID, OracleDbType.NVarchar2, 50, Convert.ToString(l.APPROVERID), ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, ConstantsVariables.P_APPROVERNAME, OracleDbType.NVarchar2, 50, Convert.ToString(l.APPROVERNAME), ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, ConstantsVariables.P_TOTALLEAVE, OracleDbType.Double, 50, l.CARRYFRWD, ParameterDirection.Input);
                    obj.TupleForOracleParameter(LstTupParameters, "P_RETURNVALUE", OracleDbType.Int32, 1, null, ParameterDirection.Output);
                }
                Tuple <string, int> Returnstr = obj.savedataFSAP("BCL_SAVELEAVEQUOTASAP", LstTupParameters);
                return(Returnstr);
            }
            catch (Exception ex)
            {
                Tuple <string, int> returndata = new Tuple <string, int>("Failed", 1);
                return(returndata);

                throw;
            }
        }