Пример #1
0
        public static LicensePetitionType15Request ConcreateLicensePetitionType15Request(DataRow row)
        {
            LicensePetitionType15Request licenseRequest15 = new LicensePetitionType15Request()
            {
                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(licenseRequest15);
        }
Пример #2
0
        public static LicensePetitionType15Request ConcreateLicensePetitionType15Request(AG_IAS_SUBPAYMENT_D_T subDetail)
        {
            LicensePetitionType15Request licenseRequest = new LicensePetitionType15Request()
            {
                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, LicensePetitionType15Request 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,
                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, // licenseT,
                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);

            //string OldLicense = entSubpaymentD.LICENSE_NO.ToString();
            entSubpaymentD.OLD_LICENSE_NO = entSubpaymentD.LICENSE_NO;
            entSubpaymentD.LICENSE_NO     = LicenseNo;

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

            objCmd.Parameters.Add("P_ID_CARD_NO", OracleDbType.Varchar2).Value        = licenseRequest.ID_CARD_NO;
            objCmd.Parameters.Add("P_LICENSE_TYPE_CODE", OracleDbType.Varchar2).Value = licenseRequest.LICENSE_TYPE_CODE;
            objCmd.Parameters.Add("P_LICENSE_NO", OracleDbType.Varchar2).Value        = LicenseNo;
            objCmd.Parameters.Add("P_COMP_CODE", OracleDbType.Varchar2).Value         = licenseRequest.COMP_CODE;
            objCmd.Parameters.Add("P_RECEIPT_DATE", OracleDbType.Date).Value          = licenseRequest.RECEIPT_DATE;
            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();
        }