예제 #1
0
        public string GetLine(List <DonationUploadRecord> record_list, string function_mode, int show_valid_only, string login_id, string value_date)
        {
            decimal ytd_inc       = 0;
            decimal ytd_exp       = 0;
            string  upload_strsql = "";

            if (function_mode == "C" || function_mode == "U")
            {
                foreach (var r in record_list)
                {
                    if (function_mode == "U" && r.Record_error == 0)
                    {
                        r.Donor_name    = r.Donor_name.Replace("'", "''");
                        r.Don_specific  = r.Don_specific.Replace("'", "''");
                        r.Don_kind_desc = r.Don_kind_desc.Replace("'", "''");
                        upload_strsql   = upload_strsql + DonationDetailRepository.InsertDonationDetail(r.Hospital, r.Fund, r.Section, r.Analytical, r.Trust, r.Donor_id, r.Donor_name, r.Don_inc_exp, r.Don_type, r.Don_purpose, r.Don_super_cat, r.Don_cat, r.Don_subcat, r.Don_subsubcat, r.Don_specific, r.Maj_don1, r.Maj_don2, r.Maj_don3, r.Reimb, r.Don_kind_desc, r.Don_cur_mth, login_id);
                        upload_strsql   = upload_strsql + DonationHistoryRepository.InsertDonationHistory(r.Don_cur_mth, r.Out_comm, r.Don_date, login_id);

                        if (r.Don_inc_exp == "I")
                        {
                            ytd_inc = r.Don_cur_mth;
                            ytd_exp = 0;
                        }
                        else
                        {
                            ytd_inc = 0;
                            ytd_exp = r.Don_cur_mth;
                        }
                        if (r.R_begin != 0 && r.Fund != "21" && r.Don_type != 1)
                        {
                            upload_strsql = upload_strsql + DonationReserveRepository.InsertDonationReserve(r.Hospital, r.Fund, r.Section, r.Analytical, r.Don_kind_desc, r.Donor_name,
                                                                                                            value_date, r.Don_date, r.Don_super_cat, r.R_begin, ytd_inc, ytd_exp, r.Don_specific);

                            upload_strsql = upload_strsql + DonationReserveRepository.InsertDonationReserve(r.Hospital, r.Fund, r.Section, r.Analytical, r.Don_kind_desc, r.Donor_name,
                                                                                                            value_date, r.Don_date, r.Don_super_cat, 0, ytd_inc, ytd_exp, r.Don_specific);
                        }
                    }
                }
            }


            return(upload_strsql);
        }
예제 #2
0
 public void InsertNewDonation(DonationRecNExpModel model, string login_id)
 {
     DonationDetailRepository.InsertDonationDetail(model, login_id);
     DonationHistoryRepository.InsertDonationHistoryForNewDonation(model.CM_record, model.Previous_record, login_id);
 }