Beispiel #1
0
    private void UploadFile(string fullPath)
    {
        chsi.dat.payFileImports fi = new chsi.dat.payFileImports();

        if (this.ddFileType.SelectedValue == "IEHP")
        {
            chsi.dom.pay.ImportIEHP i = new chsi.dom.pay.ImportIEHP();
            i.ImportFile(fullPath);
        }

        if (this.ddFileType.SelectedValue == "LIHP")
        {
            chsi.dom.pay.ImportLIHP i = new chsi.dom.pay.ImportLIHP();
            i.ImportFile(fullPath);
        }

        if (this.ddFileType.SelectedValue == "CHG")
        {
            chsi.dom.pay.ImportCHG i = new chsi.dom.pay.ImportCHG();
            i.ImportFile(fullPath);
        }

        chsi.dat.CHSIEntities db = new chsi.dat.CHSIEntities();
        chsi.dat.payFileImports fileImp = db.payFileImports.OrderByDescending(a => a.payFileImport).First();

        decimal ratio = decimal.Round((decimal)fileImp.MembersWithVisits / (decimal)fileImp.MemberCount, 2);
        int iRatio = (int)(ratio *100);
        string sRatio = iRatio.ToString() + "%";

        lblMessage.Text = string.Format("Members Added: <b>{0}</b><br/>Members Removed: <b>{1}</b><br/>Total Member Count: <b>{2}</b><br/>Members With Visits: <b>{3}</b><br/>Member/Visit Ratio: <b>{4}</b>",
            fileImp.NewMembers, fileImp.DeletedMembers, fileImp.MemberCount, fileImp.MembersWithVisits, sRatio);
    }
 /// <summary>
 /// Deprecated Method for adding a new object to the payFileImports EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTopayFileImports(payFileImports payFileImports)
 {
     base.AddObject("payFileImports", payFileImports);
 }
Beispiel #3
0
        //update file import table
        protected int UpdateFileImportsTable(Payers payer, string fileName)
        {
            if (fileImport == null)
            {
                fileImport = new payFileImports();
            }

            fileImport.DeletedMembers = _deletedMemberCount;
            fileImport.NewMembers = _newMemberCount;
            fileImport.MemberCount = _activeMemberCount;
            fileImport.Filename = fileName;
            fileImport.ImportTimeStamp = DateTime.Now;
            fileImport.Month = DateTime.Now.Month;
            fileImport.payPayerId = (int)payer;
            fileImport.Year = DateTime.Now.Year;

            if (fileImport.payFileImport == 0)
            {
                db.AddTopayFileImports(fileImport);
            }

            db.SaveChanges();

            return fileImport.payFileImport;
        }
 /// <summary>
 /// Create a new payFileImports object.
 /// </summary>
 /// <param name="payFileImport">Initial value of the payFileImport property.</param>
 /// <param name="payPayerId">Initial value of the payPayerId property.</param>
 /// <param name="filename">Initial value of the Filename property.</param>
 /// <param name="year">Initial value of the Year property.</param>
 /// <param name="month">Initial value of the Month property.</param>
 /// <param name="importTimeStamp">Initial value of the ImportTimeStamp property.</param>
 /// <param name="memberCount">Initial value of the MemberCount property.</param>
 /// <param name="newMembers">Initial value of the NewMembers property.</param>
 /// <param name="deletedMembers">Initial value of the DeletedMembers property.</param>
 /// <param name="membersWithVisits">Initial value of the MembersWithVisits property.</param>
 public static payFileImports CreatepayFileImports(global::System.Int32 payFileImport, global::System.Int32 payPayerId, global::System.String filename, global::System.Int32 year, global::System.Int32 month, global::System.DateTime importTimeStamp, global::System.Int32 memberCount, global::System.Int32 newMembers, global::System.Int32 deletedMembers, global::System.Int32 membersWithVisits)
 {
     payFileImports payFileImports = new payFileImports();
     payFileImports.payFileImport = payFileImport;
     payFileImports.payPayerId = payPayerId;
     payFileImports.Filename = filename;
     payFileImports.Year = year;
     payFileImports.Month = month;
     payFileImports.ImportTimeStamp = importTimeStamp;
     payFileImports.MemberCount = memberCount;
     payFileImports.NewMembers = newMembers;
     payFileImports.DeletedMembers = deletedMembers;
     payFileImports.MembersWithVisits = membersWithVisits;
     return payFileImports;
 }