コード例 #1
0
        public static BG_ProBasiPerPayTwo AddBG_ProBasiPerPayTwo(BG_ProBasiPerPayTwo bG_ProBasiPerPayTwo)
        {
            string sql =
                "INSERT BG_ProBasiPerPayTwo (DepID, PTYear, RetiredPerP, RetiredPubP, RetirementPerP, RetirementPubP, PTHF, PTME, PTOther, PTTitol)" +
                "VALUES (@DepID, @PTYear, @RetiredPerP, @RetiredPubP, @RetirementPerP, @RetirementPubP, @PTHF, @PTME, @PTOther, @PTTitol)";

            sql += " ; SELECT @@IDENTITY";

            try
            {
                SqlParameter[] para = new SqlParameter[]
                {
                    new SqlParameter("@DepID", bG_ProBasiPerPayTwo.DepID),
                    new SqlParameter("@PTYear", bG_ProBasiPerPayTwo.PTYear),
                    new SqlParameter("@RetiredPerP", bG_ProBasiPerPayTwo.RetiredPerP),
                    new SqlParameter("@RetiredPubP", bG_ProBasiPerPayTwo.RetiredPubP),
                    new SqlParameter("@RetirementPerP", bG_ProBasiPerPayTwo.RetirementPerP),
                    new SqlParameter("@RetirementPubP", bG_ProBasiPerPayTwo.RetirementPubP),
                    new SqlParameter("@PTHF", bG_ProBasiPerPayTwo.PTHF),
                    new SqlParameter("@PTME", bG_ProBasiPerPayTwo.PTME),
                    new SqlParameter("@PTOther", bG_ProBasiPerPayTwo.PTOther),
                    new SqlParameter("@PTTitol", bG_ProBasiPerPayTwo.PTTitol)
                };

                string IdStr = DBUnity.ExecuteScalar(CommandType.Text, sql, para);
                int    newId = Convert.ToInt32(IdStr);
                return(GetBG_ProBasiPerPayTwoByPTID(newId));
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw e;
            }
        }
コード例 #2
0
        public static bool ModifyBG_ProBasiPerPayTwo(BG_ProBasiPerPayTwo bG_ProBasiPerPayTwo)
        {
            string sql =
                "UPDATE BG_ProBasiPerPayTwo " +
                "SET " +
                "DepID = @DepID, " +
                "PTYear = @PTYear, " +
                "RetiredPerP = @RetiredPerP, " +
                "RetiredPubP = @RetiredPubP, " +
                "RetirementPerP = @RetirementPerP, " +
                "RetirementPubP = @RetirementPubP, " +
                "PTHF = @PTHF, " +
                "PTME = @PTME, " +
                "PTOther = @PTOther, " +
                "PTTitol = @PTTitol " +
                "WHERE PTID = @PTID";


            try
            {
                SqlParameter[] para = new SqlParameter[]
                {
                    new SqlParameter("@PTID", bG_ProBasiPerPayTwo.PTID),
                    new SqlParameter("@DepID", bG_ProBasiPerPayTwo.DepID),
                    new SqlParameter("@PTYear", bG_ProBasiPerPayTwo.PTYear),
                    new SqlParameter("@RetiredPerP", bG_ProBasiPerPayTwo.RetiredPerP),
                    new SqlParameter("@RetiredPubP", bG_ProBasiPerPayTwo.RetiredPubP),
                    new SqlParameter("@RetirementPerP", bG_ProBasiPerPayTwo.RetirementPerP),
                    new SqlParameter("@RetirementPubP", bG_ProBasiPerPayTwo.RetirementPubP),
                    new SqlParameter("@PTHF", bG_ProBasiPerPayTwo.PTHF),
                    new SqlParameter("@PTME", bG_ProBasiPerPayTwo.PTME),
                    new SqlParameter("@PTOther", bG_ProBasiPerPayTwo.PTOther),
                    new SqlParameter("@PTTitol", bG_ProBasiPerPayTwo.PTTitol)
                };

                int t = DBUnity.ExecuteNonQuery(CommandType.Text, sql, para);
                if (t > 0)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw e;
            }
        }
コード例 #3
0
        public static BG_ProBasiPerPayTwo GetBG_ProBasiPerPayTwoByPTID(int pTID)
        {
            string sql = "SELECT * FROM BG_ProBasiPerPayTwo WHERE PTID = @PTID";

            try
            {
                SqlParameter para = new SqlParameter("@PTID", pTID);
                DataTable    dt   = DBUnity.AdapterToTab(sql, para);

                if (dt.Rows.Count > 0)
                {
                    BG_ProBasiPerPayTwo bG_ProBasiPerPayTwo = new BG_ProBasiPerPayTwo();

                    bG_ProBasiPerPayTwo.PTID           = dt.Rows[0]["PTID"] == DBNull.Value ? 0 : (int)dt.Rows[0]["PTID"];
                    bG_ProBasiPerPayTwo.DepID          = dt.Rows[0]["DepID"] == DBNull.Value ? 0 : (int)dt.Rows[0]["DepID"];
                    bG_ProBasiPerPayTwo.PTYear         = dt.Rows[0]["PTYear"] == DBNull.Value ? DateTime.MinValue : (DateTime)dt.Rows[0]["PTYear"];
                    bG_ProBasiPerPayTwo.RetiredPerP    = dt.Rows[0]["RetiredPerP"] == DBNull.Value ? 0 : (decimal)dt.Rows[0]["RetiredPerP"];
                    bG_ProBasiPerPayTwo.RetiredPubP    = dt.Rows[0]["RetiredPubP"] == DBNull.Value ? 0 : (decimal)dt.Rows[0]["RetiredPubP"];
                    bG_ProBasiPerPayTwo.RetirementPerP = dt.Rows[0]["RetirementPerP"] == DBNull.Value ? 0 : (decimal)dt.Rows[0]["RetirementPerP"];
                    bG_ProBasiPerPayTwo.RetirementPubP = dt.Rows[0]["RetirementPubP"] == DBNull.Value ? 0 : (decimal)dt.Rows[0]["RetirementPubP"];
                    bG_ProBasiPerPayTwo.PTHF           = dt.Rows[0]["PTHF"] == DBNull.Value ? 0 : (decimal)dt.Rows[0]["PTHF"];
                    bG_ProBasiPerPayTwo.PTME           = dt.Rows[0]["PTME"] == DBNull.Value ? 0 : (decimal)dt.Rows[0]["PTME"];
                    bG_ProBasiPerPayTwo.PTOther        = dt.Rows[0]["PTOther"] == DBNull.Value ? 0 : (decimal)dt.Rows[0]["PTOther"];
                    bG_ProBasiPerPayTwo.PTTitol        = dt.Rows[0]["PTTitol"] == DBNull.Value ? 0 : (decimal)dt.Rows[0]["PTTitol"];

                    return(bG_ProBasiPerPayTwo);
                }
                else
                {
                    return(null);
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                throw e;
            }
        }
コード例 #4
0
 public static bool ModifyBG_ProBasiPerPayTwo(BG_ProBasiPerPayTwo bG_ProBasiPerPayTwo)
 {
     return(BG_ProBasiPerPayTwoService.ModifyBG_ProBasiPerPayTwo(bG_ProBasiPerPayTwo));
 }
コード例 #5
0
 public static bool DeleteBG_ProBasiPerPayTwo(BG_ProBasiPerPayTwo bG_ProBasiPerPayTwo)
 {
     return(BG_ProBasiPerPayTwoService.DeleteBG_ProBasiPerPayTwo(bG_ProBasiPerPayTwo));
 }
コード例 #6
0
 public static BG_ProBasiPerPayTwo AddBG_ProBasiPerPayTwo(BG_ProBasiPerPayTwo bG_ProBasiPerPayTwo)
 {
     return(BG_ProBasiPerPayTwoService.AddBG_ProBasiPerPayTwo(bG_ProBasiPerPayTwo));
 }
コード例 #7
0
 public static bool DeleteBG_ProBasiPerPayTwo(BG_ProBasiPerPayTwo bG_ProBasiPerPayTwo)
 {
     return(DeleteBG_ProBasiPerPayTwoByPTID(bG_ProBasiPerPayTwo.PTID));
 }
コード例 #8
0
    private void IsnotBG_ProBasiPerPay()
    {
        byte[]    bt;
        DataTable dt1 = new DataTable();
        DataTable dt2 = new DataTable();
        DataTable dt3 = new DataTable();
        DataTable dt4 = new DataTable();

        if (FUFEXC.HasFile)
        {
            bt  = FUFEXC.FileBytes;
            dt1 = ImportFinaDataLogic.GetDTBySheetname("基人一", bt, 9, 10);
            dt2 = ImportFinaDataLogic.GetDTBySheetname("基人二", bt, 10, 12);
            dt3 = ImportFinaDataLogic.GetDTBySheetname("基公", bt, 9, 21);
            dt4 = ImportFinaDataLogic.GetDTBySheetname("项目支出", bt, 9, 15);
        }
        else
        {
            Response.Write("没有数据");
        }
        bt = null;

        DateTime            dtime  = Convert.ToDateTime(CurrentYear + "-" + "01-" + "01");
        BG_ProBasiPerPayOne PBPPOM = new BG_ProBasiPerPayOne();

        PBPPOM.POBS    = ParToDecimal.ParToDel(dt1.Rows[0][4].ToString());
        PBPPOM.POAS    = ParToDecimal.ParToDel(dt1.Rows[0][5].ToString());
        PBPPOM.POBonus = ParToDecimal.ParToDel(dt1.Rows[0][6].ToString());
        PBPPOM.POPS    = ParToDecimal.ParToDel(dt1.Rows[0][7].ToString());
        PBPPOM.POSE    = ParToDecimal.ParToDel(dt1.Rows[0][8].ToString());
        PBPPOM.POOther = ParToDecimal.ParToDel(dt1.Rows[0][9].ToString());
        PBPPOM.POTitol = ParToDecimal.ParToDel(dt1.Rows[0][3].ToString());
        PBPPOM.POYear  = dtime;
        PBPPOM.DepID   = AreaDepID;
        BG_ProBasiPerPayOneManager.AddBG_ProBasiPerPayOne(PBPPOM);

        BG_ProBasiPerPayTwo PBPPT = new BG_ProBasiPerPayTwo();

        PBPPT.RetiredPerP    = ParToDecimal.ParToDel(dt2.Rows[0][5].ToString());
        PBPPT.RetiredPubP    = ParToDecimal.ParToDel(dt2.Rows[0][6].ToString());
        PBPPT.RetirementPerP = ParToDecimal.ParToDel(dt2.Rows[0][9].ToString());
        PBPPT.RetirementPubP = ParToDecimal.ParToDel(dt2.Rows[0][8].ToString());
        PBPPT.PTME           = ParToDecimal.ParToDel(dt2.Rows[0][10].ToString());
        PBPPT.PTOther        = ParToDecimal.ParToDel(dt2.Rows[0][11].ToString());
        PBPPT.PTTitol        = ParToDecimal.ParToDel(dt2.Rows[0][3].ToString());
        PBPPT.PTYear         = dtime;
        PBPPT.DepID          = AreaDepID;
        BG_ProBasiPerPayTwoManager.AddBG_ProBasiPerPayTwo(PBPPT);

        BG_ProBasiPubPay PBPP = new BG_ProBasiPubPay();

        PBPP.PBOE        = ParToDecimal.ParToDel(dt3.Rows[0][5].ToString());
        PBPP.PBUtilities = ParToDecimal.ParToDel(dt3.Rows[0][6].ToString());
        PBPP.PBPF        = ParToDecimal.ParToDel(dt3.Rows[0][7].ToString());
        PBPP.OBCFE       = ParToDecimal.ParToDel(dt3.Rows[0][8].ToString());
        PBPP.PBTravelE   = ParToDecimal.ParToDel(dt3.Rows[0][9].ToString());
        PBPP.PBRE        = ParToDecimal.ParToDel(dt3.Rows[0][10].ToString());
        PBPP.PBME        = ParToDecimal.ParToDel(dt3.Rows[0][11].ToString());
        PBPP.PBTrainE    = ParToDecimal.ParToDel(dt3.Rows[0][12].ToString());
        PBPP.OBRE        = ParToDecimal.ParToDel(dt3.Rows[0][13].ToString());
        PBPP.PBAE        = ParToDecimal.ParToDel(dt3.Rows[0][14].ToString());
        PBPP.LUMD        = ParToDecimal.ParToDel(dt3.Rows[0][15].ToString());
        PBPP.PBWE        = ParToDecimal.ParToDel(dt3.Rows[0][16].ToString());
        PBPP.PBOCE       = ParToDecimal.ParToDel(dt3.Rows[0][17].ToString());
        PBPP.OCASE       = ParToDecimal.ParToDel(dt3.Rows[0][19].ToString());
        PBPP.PBIDTitol   = ParToDecimal.ParToDel(dt3.Rows[0][3].ToString());
        PBPP.PBYear      = dtime;
        PBPP.DepID       = AreaDepID;
        BG_ProBasiPubPayManager.AddBG_ProBasiPubPay(PBPP);

        for (int i = 0; i < dt4.Rows.Count; i++)
        {
            if (string.IsNullOrEmpty(dt4.Rows[i][3].ToString()))
            {
                return;
            }
            BG_ProPay PP = new BG_ProPay();
            PP.PPID     = dt4.Rows[i][3].ToString().Trim();
            PP.ProPA0M  = ParToDecimal.ParToDel(dt4.Rows[i][4].ToString());
            PP.ProPYear = dtime;
            PP.DepID    = AreaDepID;
            BG_ProPayManager.AddBG_ProPay(PP);
        }
        X.Msg.Alert("提示", "导入成功.").Show();
    }