Exemplo n.º 1
0
        public static LicensePetitionType11Request ConcreateLicensePetitionType11Request(DataRow row)
        {
            LicensePetitionType11Request licenseRequest11 = new LicensePetitionType11Request()
            {
                ID_CARD_NO        = row["id_card_no"].ToString(),
                LICENSE_TYPE_CODE = row["license_type_code"].ToString(),
                COMP_CODE         = row["COMP_CODE"].ToString(),
                RECEIPT_DATE      = Convert.ToDateTime(row["receipt_date"]),
                RECEIPT_NO        = row["receipt_no"].ToString(),
                PAYMENT_NO        = row["payment_no"].ToString(),
                SEQ_NO            = row["SEQ_NO"].ToString(),
                UPLOAD_GROUP_NO   = row["UPLOAD_GROUP_NO"].ToString(),
                TESTING_NO        = row["testing_no"].ToString()
            };

            return(licenseRequest11);
        }
Exemplo n.º 2
0
        public static LicensePetitionType11Request ConcreateLicensePetitionType11Request(AG_IAS_SUBPAYMENT_D_T subDetail)
        {
            LicensePetitionType11Request licenseRequest11 = new LicensePetitionType11Request()
            {
                ID_CARD_NO        = subDetail.ID_CARD_NO,             // row["id_card_no"].ToString(),
                LICENSE_TYPE_CODE = subDetail.LICENSE_TYPE_CODE,      // row["license_type_code"].ToString(),
                COMP_CODE         = subDetail.COMPANY_CODE,           // row["COMP_CODE"].ToString(),
                RECEIPT_DATE      = (DateTime)subDetail.RECEIPT_DATE, // Convert.ToDateTime(row["receipt_date"]),
                RECEIPT_NO        = subDetail.RECEIPT_NO,             // row["receipt_no"].ToString(),
                PAYMENT_NO        = subDetail.PAYMENT_NO,             // row["payment_no"].ToString(),
                SEQ_NO            = subDetail.SEQ_NO,                 // row["SEQ_NO"].ToString(),
                UPLOAD_GROUP_NO   = subDetail.UPLOAD_GROUP_NO,        // row["UPLOAD_GROUP_NO"].ToString(),
                TESTING_NO        = subDetail.TESTING_NO,             // row["testing_no"].ToString()
            };

            return(licenseRequest11);
        }
Exemplo n.º 3
0
        public static void LicensePetitionType(IAS.DAL.Interfaces.IIASPersonEntities ctx, OracleConnection Connection, LicensePetitionType11Request licenseRequest)
        {
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("th-TH");
            String LicenseNo = GenLicenseNumber.AG_LICENSE_RUNNING(ctx, (DateTime)licenseRequest.RECEIPT_DATE, licenseRequest.LICENSE_TYPE_CODE); // Convert.ToDateTime(dt.Rows[i]["receipt_date"]), dt.Rows[i]["license_type_code"].ToString());


            var License = new DAL.AG_LICENSE_T
            {
                LICENSE_NO        = LicenseNo,
                LICENSE_DATE      = licenseRequest.RECEIPT_DATE,
                EXPIRE_DATE       = licenseRequest.EXPIRATION_DATE,
                LICENSE_TYPE_CODE = licenseRequest.LICENSE_TYPE_CODE,
                NEW_LICENSE_NO    = null,
                LICENSE_ACTOR     = null,
                DATE_LICENSE_ACT  = licenseRequest.RECEIPT_DATE,
                REMARK            = null,
                UNIT_LINK_RENEW   = null,
                START_UL_DATE     = null,
                EXPIRE_UL_DATE    = null,
                UNIT_LINK_STATUS  = null
            };

            ctx.AG_LICENSE_T.AddObject(License);

            //Check Null
            AG_IAS_LICENSE_D entLicenseD = ctx.AG_IAS_LICENSE_D.FirstOrDefault(a => a.SEQ_NO == licenseRequest.SEQ_NO && a.UPLOAD_GROUP_NO == licenseRequest.UPLOAD_GROUP_NO);

            if (entLicenseD != null)
            {
                entLicenseD.LICENSE_NO          = LicenseNo;
                entLicenseD.LICENSE_DATE        = DateTime.Now;
                entLicenseD.LICENSE_EXPIRE_DATE = licenseRequest.EXPIRATION_DATE;
            }

            //Check Null
            AG_IAS_SUBPAYMENT_D_T entSubpaymentD = ctx.AG_IAS_SUBPAYMENT_D_T.FirstOrDefault(a => a.SEQ_NO == licenseRequest.SEQ_NO && a.UPLOAD_GROUP_NO == licenseRequest.UPLOAD_GROUP_NO);

            if (entSubpaymentD != null)
            {
                entSubpaymentD.LICENSE_NO = LicenseNo;
            }


            OracleCommand objCmd = new OracleCommand()
            {
                Connection  = Connection,
                CommandText = "IAS_UPDATE_11",
                CommandType = CommandType.StoredProcedure
            };

            objCmd.Parameters.Add("P_id_card_no", OracleDbType.Varchar2).Value        = SetValue(licenseRequest.ID_CARD_NO);
            objCmd.Parameters.Add("P_license_type_code", OracleDbType.Varchar2).Value = SetValue(licenseRequest.LICENSE_TYPE_CODE);
            objCmd.Parameters.Add("P_license_no", OracleDbType.Varchar2).Value        = SetValue(LicenseNo);
            objCmd.Parameters.Add("COMP_CODE", OracleDbType.Varchar2).Value           = SetValue(licenseRequest.COMP_CODE);
            objCmd.Parameters.Add("P_RECEIPT_DATE", OracleDbType.Date).Value          = licenseRequest.RECEIPT_DATE;
            objCmd.Parameters.Add("P_REQUEST_NO", OracleDbType.Varchar2).Value        = SetValue(entLicenseD.REQUEST_NO);
            objCmd.Parameters.Add("P_PAYMENT_NO", OracleDbType.Varchar2).Value        = SetValue(licenseRequest.PAYMENT_NO);
            objCmd.Parameters.Add("P_testing_no", OracleDbType.Varchar2).Value        = SetValue(licenseRequest.TESTING_NO);
            objCmd.Parameters.Add("P_RECEIPT_NO", OracleDbType.Varchar2).Value        = SetValue(licenseRequest.RECEIPT_NO);
            objCmd.ExecuteNonQuery();
        }