예제 #1
0
        public static LicensePetitionType18Request ConcreateLicensePetitionType18Request(DataRow row)
        {
            LicensePetitionType18Request licenseRequest18 = new LicensePetitionType18Request()
            {
                UPLOAD_GROUP_NO   = row["UPLOAD_GROUP_NO"].ToString(),
                SEQ_NO            = row["SEQ_NO"].ToString(),
                LICENSE_TYPE_CODE = row["license_type_code"].ToString(),
                ID_CARD_NO        = row["id_card_no"].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(),
            };

            return(licenseRequest18);
        }
예제 #2
0
        public static LicensePetitionType18Request ConcreateLicensePetitionType18Request(AG_IAS_SUBPAYMENT_D_T subDetail)
        {
            LicensePetitionType18Request licenseRequest = new LicensePetitionType18Request()
            {
                UPLOAD_GROUP_NO   = subDetail.UPLOAD_GROUP_NO,        // row["UPLOAD_GROUP_NO"].ToString(),
                SEQ_NO            = subDetail.SEQ_NO,                 // row["SEQ_NO"].ToString(),
                LICENSE_TYPE_CODE = subDetail.LICENSE_TYPE_CODE,      // row["license_type_code"].ToString(),
                ID_CARD_NO        = subDetail.ID_CARD_NO,             // row["id_card_no"].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(),
            };

            return(licenseRequest);
        }
예제 #3
0
        public static void LicensePetitionType(IAS.DAL.Interfaces.IIASPersonEntities ctx, OracleConnection Connection, LicensePetitionType18Request licenseRequest)
        {
            Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("th-TH");
            String LicenseNo = GenLicenseNumber.AG_LICENSE_RUNNING(ctx, licenseRequest.RECEIPT_DATE, licenseRequest.LICENSE_TYPE_CODE);


            var License = new DAL.AG_LICENSE_T
            {
                LICENSE_NO        = LicenseNo.ToString(),
                LICENSE_DATE      = licenseRequest.RECEIPT_DATE,    // Convert.ToDateTime(ReceiveDate),
                EXPIRE_DATE       = licenseRequest.EXPIRATION_DATE, //  Convert.ToDateTime(Convert.ToString(expireDate)),
                LICENSE_TYPE_CODE = licenseRequest.LICENSE_TYPE_CODE,
                NEW_LICENSE_NO    = null,
                LICENSE_ACTOR     = null,
                DATE_LICENSE_ACT  = licenseRequest.RECEIPT_DATE, // Convert.ToDateTime(ReceiveDate),
                REMARK            = null,
                UNIT_LINK_RENEW   = null,
                START_UL_DATE     = null,
                EXPIRE_UL_DATE    = null,
                UNIT_LINK_STATUS  = null
            };

            ctx.AG_LICENSE_T.AddObject(License);

            var entLicenseD = ctx.AG_IAS_LICENSE_D.FirstOrDefault(a => a.SEQ_NO == licenseRequest.SEQ_NO &&
                                                                  a.UPLOAD_GROUP_NO == licenseRequest.UPLOAD_GROUP_NO);

            entLicenseD.LICENSE_NO          = LicenseNo;
            entLicenseD.LICENSE_DATE        = DateTime.Now;
            entLicenseD.LICENSE_EXPIRE_DATE = licenseRequest.EXPIRATION_DATE; // Convert.ToDateTime(Convert.ToString(expireDate));
            var entSubpaymentD = ctx.AG_IAS_SUBPAYMENT_D_T.FirstOrDefault(a => a.SEQ_NO == licenseRequest.SEQ_NO &&
                                                                          a.UPLOAD_GROUP_NO == licenseRequest.UPLOAD_GROUP_NO);

            entSubpaymentD.OLD_LICENSE_NO = entSubpaymentD.LICENSE_NO;
            entSubpaymentD.LICENSE_NO     = LicenseNo;

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

            objCmd.Parameters.Add("P_ID_CARD_NO", OracleDbType.Varchar2).Value = licenseRequest.ID_CARD_NO;   // IdCard;
            objCmd.Parameters.Add("P_LICENSE_NO", OracleDbType.Varchar2).Value = LicenseNo;
            objCmd.Parameters.Add("P_COMP_CODE", OracleDbType.Varchar2).Value  = licenseRequest.COMP_CODE;    // ComCode;
            objCmd.Parameters.Add("P_RECEIPT_DATE", OracleDbType.Date).Value   = licenseRequest.RECEIPT_DATE; // Convert.ToDateTime(ReceiveDate);
            objCmd.Parameters.Add("P_REQUEST_NO", OracleDbType.Varchar2).Value = licenseRequest.RECEIPT_NO;   // requestNo;
            objCmd.Parameters.Add("P_PAYMENT_NO", OracleDbType.Varchar2).Value = licenseRequest.PAYMENT_NO;   // payment_no;
            objCmd.Parameters.Add("P_RECEIPT_NO", OracleDbType.Varchar2).Value = licenseRequest.RECEIPT_NO;   // receiptNo;

            objCmd.ExecuteNonQuery();
        }