コード例 #1
0
        public DataTable GetJobCardSP(JobCardModel ObjLGD)
        {
            try
            {
                CommonSPHel comhel = new CommonSPHel();
                cmd = new OracleCommand();
                cmd.InitialLONGFetchSize = 1000;
                cmd.CommandType          = CommandType.StoredProcedure;
                cmd.CommandText          = "PR_GET_GSWS_PRRD_JOB_CARD_DTLS";
                cmd.Parameters.Add("P_TYPE", OracleDbType.Varchar2, 10).Value            = ObjLGD.P_TYPE;
                cmd.Parameters.Add("P_JC_ID", OracleDbType.Varchar2, 100).Value          = ObjLGD.P_JC_ID;
                cmd.Parameters.Add("P_MANDAL_ID", OracleDbType.Varchar2, 10).Value       = ObjLGD.P_LGD_MANDAL_CODE;
                cmd.Parameters.Add("P_GP_ID", OracleDbType.Varchar2, 10).Value           = ObjLGD.P_GP_ID;
                cmd.Parameters.Add("P_SACHIVALAYAM_ID", OracleDbType.Varchar2, 50).Value = ObjLGD.P_SACHIVALAYAM_ID;
                cmd.Parameters.Add("P_UID_NO", OracleDbType.Varchar2, 50).Value          = ObjLGD.P_UID_NO;
                cmd.Parameters.Add("P_USER_ID", OracleDbType.Varchar2, 10).Value         = ObjLGD.P_USER_ID;
                cmd.Parameters.Add("P_STATUS", OracleDbType.Varchar2, 10).Value          = ObjLGD.P_STATUS;

                cmd.Parameters.Add("P_CUR", OracleDbType.RefCursor).Direction = ParameterDirection.Output;
                DataTable dtLogin = comhel.GetgswsDataAdapter(cmd);
                if (dtLogin != null)
                {
                    return(dtLogin);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                string mappath   = HttpContext.Current.Server.MapPath("JobCardExceptions");
                Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "Error Getting GetJobCardSP:" + ex.Message.ToString()));
                throw ex;
            }
        }
コード例 #2
0
        public DataTable CreateJobCard_SP(List <JobCardModel> Objitem)
        {
            // Start a local transaction
            OracleTransaction transaction;
            ConnectionHelper  _conHe = new ConnectionHelper();
            OracleConnection  con    = new OracleConnection(_conHe.Congsws);

            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }

            transaction = con.BeginTransaction(IsolationLevel.ReadCommitted);
            DataTable dtLogin = null;

            try
            {
                foreach (var Obj in Objitem)
                {
                    CommonSPHel comhel = new CommonSPHel();
                    cmd                      = new OracleCommand();
                    cmd.Transaction          = transaction;
                    cmd.InitialLONGFetchSize = 1000;
                    cmd.CommandType          = CommandType.StoredProcedure;
                    cmd.CommandText          = "PR_INS_GSWS_PRRD_JOB_CARD_DTLS";
                    cmd.Parameters.Add("P_TYPE", OracleDbType.Varchar2, 10).Value                      = Obj.P_TYPE;
                    cmd.Parameters.Add("P_JC_ID", OracleDbType.Varchar2, 500).Value                    = Obj.P_JC_ID;
                    cmd.Parameters.Add("P_LGD_DISTRICT_CODE", OracleDbType.Varchar2, 10).Value         = Obj.P_LGD_DISTRICT_CODE;
                    cmd.Parameters.Add("P_LGD_MANDAL_CODE", OracleDbType.Varchar2, 50).Value           = Obj.P_LGD_MANDAL_CODE;
                    cmd.Parameters.Add("P_GP_ID", OracleDbType.Varchar2, 50).Value                     = Obj.P_GP_ID;
                    cmd.Parameters.Add("P_GP_NAME", OracleDbType.Varchar2, 50).Value                   = Obj.P_GP_NAME;
                    cmd.Parameters.Add("P_HB_CODE", OracleDbType.Varchar2, 10).Value                   = Obj.P_HB_CODE;
                    cmd.Parameters.Add("P_HB_NAME", OracleDbType.Varchar2, 10).Value                   = Obj.P_HB_NAME;
                    cmd.Parameters.Add("P_REGD_DATE", OracleDbType.Date, 50).Value                     = Obj.P_REGD_DATE;
                    cmd.Parameters.Add("P_APPLICATION_NUMBER", OracleDbType.Varchar2, 50).Value        = Obj.P_APPLICATION_NUMBER;
                    cmd.Parameters.Add("P_GP_SECRETARY_NAME", OracleDbType.Varchar2, 10).Value         = Obj.P_GP_SECRETARY_NAME;
                    cmd.Parameters.Add("P_CASTE", OracleDbType.Varchar2, 50).Value                     = Obj.P_CASTE;
                    cmd.Parameters.Add("P_ADDRESS", OracleDbType.Varchar2, 50).Value                   = Obj.P_ADDRESS;
                    cmd.Parameters.Add("P_ADDRESS_TEL", OracleDbType.Varchar2, 10).Value               = Obj.P_ADDRESS_TEL;
                    cmd.Parameters.Add("P_RATIONCARD_NO", OracleDbType.Varchar2, 50).Value             = Obj.P_RATIONCARD_NO;
                    cmd.Parameters.Add("P_BPL_NO", OracleDbType.Varchar2, 50).Value                    = Obj.P_BPL_NO;
                    cmd.Parameters.Add("P_KHATA_NO", OracleDbType.Varchar2, 10).Value                  = Obj.P_KHATA_NO;
                    cmd.Parameters.Add("P_LAND_OWNER", OracleDbType.Varchar2, 50).Value                = Obj.P_LAND_OWNER;
                    cmd.Parameters.Add("P_LAND_OWNER_ACRES", OracleDbType.Varchar2, 50).Value          = Obj.P_LAND_OWNER_ACRES;
                    cmd.Parameters.Add("P_ASSIGNED_LAND_BENEFICIARY", OracleDbType.Varchar2, 10).Value = Obj.P_ASSIGNED_LAND_BENEFICIARY;
                    cmd.Parameters.Add("P_IAY_BENEFICIARY", OracleDbType.Varchar2, 50).Value           = Obj.P_IAY_BENEFICIARY;
                    cmd.Parameters.Add("P_MEMBER_NAME", OracleDbType.Varchar2, 50).Value               = Obj.P_MEMBER_NAME;
                    cmd.Parameters.Add("P_MEMBER_NAME_TEL", OracleDbType.Varchar2, 50).Value           = Obj.P_MEMBER_NAME_TEL;
                    cmd.Parameters.Add("P_SUR_NAME", OracleDbType.Varchar2, 50).Value                  = Obj.P_SUR_NAME;
                    cmd.Parameters.Add("P_SUR_NAME_TEL", OracleDbType.Varchar2, 50).Value              = Obj.P_SUR_NAME_TEL;
                    cmd.Parameters.Add("P_FAMILY_HEAD", OracleDbType.Varchar2, 10).Value               = Obj.P_FAMILY_HEAD;
                    cmd.Parameters.Add("P_RELATION_HOF", OracleDbType.Varchar2, 50).Value              = Obj.P_RELATION_HOF;
                    cmd.Parameters.Add("P_GENDER", OracleDbType.Varchar2, 50).Value                    = Obj.P_GENDER;
                    cmd.Parameters.Add("P_AGE", OracleDbType.Varchar2, 10).Value                 = Obj.P_AGE;
                    cmd.Parameters.Add("P_HIV", OracleDbType.Varchar2, 50).Value                 = Obj.P_HIV;
                    cmd.Parameters.Add("P_DISABLED", OracleDbType.Varchar2, 50).Value            = Obj.P_DISABLED;
                    cmd.Parameters.Add("P_SHG_MEMBER", OracleDbType.Varchar2, 10).Value          = Obj.P_SHG_MEMBER;
                    cmd.Parameters.Add("P_SHG_ID", OracleDbType.Varchar2, 50).Value              = Obj.P_SHG_ID;
                    cmd.Parameters.Add("P_SHG_NAME", OracleDbType.Varchar2, 50).Value            = Obj.P_SHG_NAME;
                    cmd.Parameters.Add("P_PERMANENT_JOB_CARD", OracleDbType.Varchar2, 10).Value  = Obj.P_PERMANENT_JOB_CARD;
                    cmd.Parameters.Add("P_MPHSS_ID", OracleDbType.Varchar2, 50).Value            = Obj.P_MPHSS_ID;
                    cmd.Parameters.Add("P_PAYING_AGENCY_TYPE", OracleDbType.Varchar2, 50).Value  = Obj.P_PAYING_AGENCY_TYPE;
                    cmd.Parameters.Add("P_PAYING_AGENCY_NAME", OracleDbType.Varchar2, 100).Value = Obj.P_PAYING_AGENCY_NAME;
                    cmd.Parameters.Add("P_BRANCH_NAME", OracleDbType.Varchar2, 50).Value         = Obj.P_BRANCH_NAME;
                    cmd.Parameters.Add("P_IFSC_CODE", OracleDbType.Varchar2, 50).Value           = Obj.P_IFSC_CODE;
                    cmd.Parameters.Add("P_BANK_ACC_NO", OracleDbType.Varchar2, 50).Value         = Obj.P_BANK_ACC_NO;
                    cmd.Parameters.Add("P_BANK_ACC_NAME ", OracleDbType.Varchar2, 50).Value      = Obj.P_BANK_ACC_NAME;
                    cmd.Parameters.Add("P_VOTER_ID", OracleDbType.Varchar2, 50).Value            = Obj.P_VOTER_ID;
                    cmd.Parameters.Add("P_UID_NO", OracleDbType.Varchar2, 50).Value              = Obj.P_UID_NO;
                    cmd.Parameters.Add("P_MOBILE_NO", OracleDbType.Varchar2, 50).Value           = Obj.P_MOBILE_NO;
                    cmd.Parameters.Add("P_USER_ID", OracleDbType.Varchar2, 20).Value             = Obj.P_USER_ID;
                    cmd.Parameters.Add("P_SACHIVALAYAM_ID", OracleDbType.Varchar2, 10).Value     = Obj.P_SACHIVALAYAM_ID;
                    cmd.Parameters.Add("P_STATUS", OracleDbType.Varchar2, 10).Value              = null;
                    cmd.Parameters.Add("P_PENSION_NUMBER", OracleDbType.Varchar2, 30).Value      = Obj.P_PENSION_NUMBER;
                    cmd.Parameters.Add("P_SMARTCARD_NUMBER", OracleDbType.Varchar2, 30).Value    = null;
                    cmd.Parameters.Add("P_UID_PATH", OracleDbType.Varchar2, 300).Value           = Obj.P_UID_PATH;
                    cmd.Parameters.Add("P_PASSBOOK_PATH", OracleDbType.Varchar2, 300).Value      = Obj.P_PASSBOOK_PATH;
                    cmd.Parameters.Add("P_F1_PATH", OracleDbType.Varchar2, 300).Value            = Obj.P_F1_PATH;
                    cmd.Parameters.Add("P_CUR", OracleDbType.RefCursor).Direction                = ParameterDirection.Output;
                    dtLogin = comhel.GetgswsDataAdapter(cmd);
                }
                transaction.Commit();

                if (dtLogin != null)
                {
                    return(dtLogin);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception ex)
            {
                transaction.Rollback();
                string mappath   = HttpContext.Current.Server.MapPath("JobCardExceptions");
                Task   WriteTask = Task.Factory.StartNew(() => new Logdatafile().Write_Log_Exception(mappath, "Error CreateJobCard_SP Saving jobcard into db" + ex.Message.ToString()));
                throw ex;

                throw ex;
            }
        }