Exemplo n.º 1
0
        public string InsertRequestLog(DAL_M_VendorDD vmvendorDD, DAL.Models.DAL_M_SourceIPInfo ipInfo)
        {
            try
            {
                using (SqlConnection con = DBconnection.Open())
                {
                    SqlCommand sqlComm = new SqlCommand("InsertRequestLog", con);
                    sqlComm.Parameters.AddWithValue("@VEND_CUST_CD", vmvendorDD.Vendorname);
                    sqlComm.Parameters.AddWithValue("@ConfirmationNum", vmvendorDD.Confirmation);
                    sqlComm.Parameters.AddWithValue("@Source_ip", ipInfo.Source_IP);
                    sqlComm.Parameters.AddWithValue("@Source_device", ipInfo.Source_Device);
                    sqlComm.Parameters.AddWithValue("@User_agent", vmvendorDD.User_agent);  //  this is used for entered by
                    sqlComm.Parameters.AddWithValue("@Host_headers", ipInfo.Source_Host_Headers);
                    sqlComm.Parameters.AddWithValue("@Source_Location", ipInfo.Source_Location);
                    sqlComm.CommandType = CommandType.StoredProcedure;
                    sqlComm.ExecuteNonQuery();
                    logw.LogWrite("Inserted RequestLog");

                    con.Close();
                }
            }
            catch (Exception ex)
            {
                LogManager.log.Error("Error in InsertRequestLog.  Message: " + ex.Message);
                logw.LogWrite("Error in InsertRequestLog.  Message:" + ex.Message);
                return(string.Empty);
            }
            return("SUCCESS");
        }
Exemplo n.º 2
0
        public Tuple <string, string> SubmitAttachmentFile(DAL_M_VendorDD vmvendorDD)
        {
            try
            {
                DataSet ds = new DataSet("Vendor");
                using (SqlConnection con = DBconnection.Open())
                {
                    SqlCommand sqlComm = new SqlCommand("SubmitVendorAttachment", con);
                    // Srini - 6/1/21 Enhancement #73
                    if (string.IsNullOrEmpty(vmvendorDD.VendorAttachmentFileName) == false)
                    {
                        sqlComm.Parameters.AddWithValue("@ConfirmationNum", vmvendorDD.Confirmation);
                        sqlComm.Parameters.AddWithValue("@TypeID", getDocumentTypeID(vmvendorDD.VendorAttachmentFileName));
                        sqlComm.Parameters.AddWithValue("@AttachmentFileName", vmvendorDD.VendorAttachmentFileName);
                        sqlComm.Parameters.AddWithValue("@LastUpdatedUser", "");
                        sqlComm.Parameters.AddWithValue("@LastUpdateDateTime", DateTime.Now);

                        sqlComm.CommandType = CommandType.StoredProcedure;
                        sqlComm.ExecuteNonQuery();
                    }


                    //VCM Document
                    int type_id = 5;  // VCM Request Submission Receipt
                    sqlComm.Parameters.Clear();
                    sqlComm.Parameters.AddWithValue("@ConfirmationNum", vmvendorDD.Confirmation);
                    sqlComm.Parameters.AddWithValue("@TypeID", type_id);
                    sqlComm.Parameters.AddWithValue("@AttachmentFileName", vmvendorDD.VendorReportFileName);
                    sqlComm.Parameters.AddWithValue("@LastUpdatedUser", "");
                    sqlComm.Parameters.AddWithValue("@LastUpdateDateTime", DateTime.Now);

                    sqlComm.CommandType = CommandType.StoredProcedure;
                    sqlComm.ExecuteNonQuery();


                    //if there is second attachment,  when submit from DDMS
                    if ((vmvendorDD.AttachmentFileName_ddwetform != null) && (!string.IsNullOrEmpty(vmvendorDD.AttachmentFileName_ddwetform.Trim())))
                    {
                        int        dtypeid           = 6;
                        SqlCommand sqlComm_ddwetform = new SqlCommand("SubmitVendorAttachment", con);
                        sqlComm_ddwetform.Parameters.AddWithValue("@ConfirmationNum", vmvendorDD.Confirmation);
                        sqlComm_ddwetform.Parameters.AddWithValue("@TypeID", dtypeid);
                        sqlComm_ddwetform.Parameters.AddWithValue("@AttachmentFileName", vmvendorDD.AttachmentFileName_ddwetform);
                        sqlComm_ddwetform.Parameters.AddWithValue("@LastUpdatedUser", "");
                        sqlComm_ddwetform.Parameters.AddWithValue("@LastUpdateDateTime", DateTime.Now);

                        sqlComm_ddwetform.CommandType = CommandType.StoredProcedure;
                        sqlComm_ddwetform.ExecuteNonQuery();
                    }
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                LogManager.log.Error("Error in SubmitAttachmentFile.  Message: " + ex.Message);
                logw.LogWrite("Error in SubmitAttachmentFile. " + ex.Message);
                return(null);
            }
            return(new Tuple <string, string>("SUCCESS", "true"));
        }
Exemplo n.º 3
0
        public Tuple <string, string> InsertVendorReportFileName(DAL_M_VendorDD vmvendorDD)
        {
            try
            {
                DataSet ds = new DataSet("Vendor");
                using (SqlConnection con = DBconnection.Open())
                {
                    int        type_id = 5; // VCM Request Submission Receipt
                    SqlCommand sqlComm = new SqlCommand("SubmitVendorAttachment", con);
                    sqlComm.Parameters.AddWithValue("@ConfirmationNum", vmvendorDD.Confirmation);
                    sqlComm.Parameters.AddWithValue("@TypeID", type_id);
                    sqlComm.Parameters.AddWithValue("@AttachmentFileName", vmvendorDD.VendorReportFileName);
                    sqlComm.Parameters.AddWithValue("@LastUpdatedUser", "");
                    sqlComm.Parameters.AddWithValue("@LastUpdateDateTime", DateTime.Now);

                    sqlComm.CommandType = CommandType.StoredProcedure;
                    sqlComm.ExecuteNonQuery();

                    con.Close();
                }
            }
            catch (Exception ex)
            {
                LogManager.log.Error("Error in InsertVendorReportFileName.  Message: " + ex.Message);
                logw.LogWrite("Error in InsertVendorReportFileName. " + ex.Message);
                return(new Tuple <string, string>("error --" + ex.Message, "false"));
            }
            return(new Tuple <string, string>("SUCCESS", "true"));
        }
Exemplo n.º 4
0
        public Tuple <string, string> SubmitVendor(DAL_M_VendorDD vmvendorDD)
        {
            try
            {
                DataTable reqDetails = CreateTable();
                if (vmvendorDD.LocationAddressList == null)
                {
                    foreach (string locid in vmvendorDD.LocationIDs)
                    {
                        reqDetails.Rows.Add(vmvendorDD.Confirmation, vmvendorDD.Vendorname, locid, 1, "", "", "", "", "");
                    }
                }
                else
                {
                    foreach (DAL_M_LocationAddress loc in vmvendorDD.LocationAddressList)
                    {
                        reqDetails.Rows.Add(vmvendorDD.Confirmation, vmvendorDD.Vendorname, loc.LocationID, 1, loc.Address1, loc.Address2, loc.City, loc.State, loc.ZipCode);
                    }
                }
                DataSet ds = new DataSet("Vendor");
                using (SqlConnection con = DBconnection.Open())
                {
                    {
                        SqlCommand sqlComm = new SqlCommand("SubmitVendorDetails", con);
                        sqlComm.Parameters.AddWithValue("@VEND_CUST_CD", vmvendorDD.Vendorname);
                        sqlComm.Parameters.AddWithValue("@ConfirmationNum", vmvendorDD.Confirmation);//vmvendorDD.Confirmation)
                        sqlComm.Parameters.AddWithValue("@RequestDate", vmvendorDD.SubmitDateTime);

                        sqlComm.Parameters.AddWithValue("@Status", 5);  //  5 pending
                        sqlComm.Parameters.AddWithValue("@DDNotifyEmail", vmvendorDD.DDNotifyEmail);
                        sqlComm.Parameters.AddWithValue("@AccountType", vmvendorDD.AccountType);
                        sqlComm.Parameters.AddWithValue("@NameOnBankAccount", vmvendorDD.NameOnBankAccount);
                        sqlComm.Parameters.AddWithValue("@AccountNumber", vmvendorDD.BankAccountNumber);

                        sqlComm.Parameters.AddWithValue("@RoutingNumber", vmvendorDD.BankRoutingNo);
                        sqlComm.Parameters.AddWithValue("@FinInstName", vmvendorDD.FinancialIns);
                        sqlComm.Parameters.AddWithValue("@AuthorizedName", vmvendorDD.Signername);
                        sqlComm.Parameters.AddWithValue("@AuthorizedTitle", vmvendorDD.Signertitle);

                        sqlComm.Parameters.AddWithValue("@AuthorizedPhone", vmvendorDD.Signerphone);
                        sqlComm.Parameters.AddWithValue("@AuthorizedPhoneExt", "");
                        sqlComm.Parameters.AddWithValue("@AuthorizedEmail", vmvendorDD.Signeremail);
                        sqlComm.Parameters.AddWithValue("@LastUpdateDateTime", vmvendorDD.SubmitDateTime);
                        sqlComm.Parameters.AddWithValue("@RequestType", vmvendorDD.RequestType);
                        sqlComm.Parameters.AddWithValue("@TableTypeRequestDetail", reqDetails);

                        sqlComm.Parameters.AddWithValue("@SubmitFromWhere", vmvendorDD.SubmitFromWhere);
                        sqlComm.Parameters.AddWithValue("@PayeeName", vmvendorDD.Payeename);
                        sqlComm.Parameters.AddWithValue("@FirstName", vmvendorDD.FirstName);
                        sqlComm.Parameters.AddWithValue("@MiddleName", vmvendorDD.MiddleName);
                        sqlComm.Parameters.AddWithValue("@LastName", vmvendorDD.LastName);
                        sqlComm.Parameters.AddWithValue("@CompanyName", vmvendorDD.CompanyName);
                        sqlComm.Parameters.AddWithValue("@AliasDBA", vmvendorDD.AliasDBAName);
                        sqlComm.Parameters.AddWithValue("@TaxpayerID", vmvendorDD.Ssn);
                        sqlComm.Parameters.AddWithValue("@CaseNo", vmvendorDD.CaseNo);
                        sqlComm.Parameters.AddWithValue("@PhoneNumber", vmvendorDD.PhoneNumber);
                        sqlComm.Parameters.AddWithValue("@DepartmentName", vmvendorDD.DepartmentName);
                        sqlComm.Parameters.AddWithValue("@DepartmentContactName", vmvendorDD.DepartmentContactName);
                        sqlComm.Parameters.AddWithValue("@DepartmentEmail", vmvendorDD.DepartmentEmail);
                        sqlComm.Parameters.AddWithValue("@DepartmentContactNo", vmvendorDD.DepartmentContactNo);

                        sqlComm.CommandType = CommandType.StoredProcedure;
                        sqlComm.ExecuteNonQuery();
                    }
                    con.Close();
                }
            }
            catch (Exception ex)
            {
                LogManager.log.Error("Error in SubmitVendor.  Message: " + ex.Message);
                logw.LogWrite("Error in Vendor DAL SubmitVendor. FileName: " + vmvendorDD.Confirmation + ".  " + ex.Message);

                return(null);
            }
            return(new Tuple <string, string>("SUCCESS", "true"));
        }