Exemplo n.º 1
0
 static public void SetManagerDiary(ManagerDiary diray,
                                    DateTime beginDate, DateTime endDate)
 {
     try
     {
         YZCX_Dal dal = new YZCX_Dal();
         dal._oleDb = oleDb;
         string strWhereCostTime = "a.cost_date between '" + beginDate.Date.ToString("yyyy-MM-dd") + " 00:00:00'" + oleDb.And()
                                   + "'" + endDate.Date.ToString("yyyy-MM-dd") + " 23:59:59'";
         string strWherePresTime = "a.presdate between '" + beginDate.Date.ToString("yyyy-MM-dd") + " 00:00:00'" + oleDb.And()
                                   + "'" + endDate.Date.ToString("yyyy-MM-dd") + " 23:59:59'";
         string strWhereType = "a.itemcode in ('00','01','02','03')";
         diray.Mz_Population  = dal.GetMZPopulation(strWhereCostTime);
         diray.TotalFee_MZ    = dal.GetMZTotalFee(strWhereCostTime);
         diray.TotalFee_MZ_YP = dal.GetMZTotalFee(strWhereCostTime + oleDb.And() + strWhereType);
         if (diray.Mz_Population != 0)
         {
             diray.AverageFee_MZ = diray.TotalFee_MZ / diray.Mz_Population;
         }
         int presNum = dal.GetMZPresNum(strWherePresTime);
         if (presNum != 0)
         {
             diray.AveragePresFee_MZ = diray.TotalFee_MZ / presNum;
         }
         diray.HSFee = dal.GetMZHSFee(strWhereCostTime);
     }
     catch (Exception error)
     {
         throw error;
     }
 }
Exemplo n.º 2
0
 static public void SetManagerDiary(ManagerDiary diray, DateTime beginDate, DateTime endDate)
 {
     try
     {
         YZCX_Dal dal = new YZCX_Dal();
         dal._oleDb = oleDb;
         string strWhereAdimDATE = "curedate" + oleDb.Between() + "'" + beginDate.Date.ToString("yyyy-MM-dd") + "'" + oleDb.And()
                                   + "'" + endDate.Date.ToString("yyyy-MM-dd") + "'";
         string strWhereLeaveDATE = "outdate" + oleDb.Between() + "'" + beginDate.Date.ToString("yyyy-MM-dd") + "'" + oleDb.And()
                                    + "'" + endDate.Date.ToString("yyyy-MM-dd") + "'";
         string strWhereCostTime = "a.costdate between " + "'" + beginDate.Date.ToString("yyyy-MM-dd") + " 00:00:00'" + oleDb.And()
                                   + "'" + endDate.Date.ToString("yyyy-MM-dd") + " 23:59:59'";
         string strWhereType = "a.bigitemtype in ('00','01','02','03')";
         diray.AdminNum_ZY      = dal.GetZYPopulation(strWhereAdimDATE);
         diray.LeaveNum_ZY      = dal.GetZYPopulation(strWhereLeaveDATE);
         diray.AtNum_ZY         = dal.GetZYCurrentNum();
         diray.TotalFee_ZY      = dal.GetZYTotalFee(strWhereCostTime);
         diray.TotalFee_ZY_YP   = dal.GetZYTotalFee(strWhereCostTime + oleDb.And() + strWhereType);
         diray.TotalFee         = diray.TotalFee_MZ + diray.TotalFee_ZY;
         diray.HSFee.PrimaryKey = new DataColumn[] { diray.HSFee.Columns["CODE"] };
         diray.TatalDays_ZY     = dal.GetZYTotalLeaveDays(beginDate, endDate);
         DataTable zy_HSFee = dal.GetZYHSFee(strWhereCostTime);
         for (int index = 0; index < zy_HSFee.Rows.Count; index++)
         {
             if (zy_HSFee.Rows[index]["CODE"] != DBNull.Value)
             {
                 string  code    = zy_HSFee.Rows[index]["CODE"].ToString();
                 DataRow findRow = diray.HSFee.Rows.Find(code);
                 if (findRow != null)
                 {
                     findRow["TOTALFEE"] = Convert.ToDecimal(findRow["TOTALFEE"])
                                           + Convert.ToDecimal(zy_HSFee.Rows[index]["TOTAL_FEE"]);
                 }
                 else
                 {
                     DataRow newRow = diray.HSFee.NewRow();
                     newRow["CODE"]      = zy_HSFee.Rows[index]["CODE"];
                     newRow["TOTALFEE"]  = zy_HSFee.Rows[index]["TOTAL_FEE"];
                     newRow["ITEM_NAME"] = zy_HSFee.Rows[index]["ITEM_NAME"];
                     diray.HSFee.Rows.Add(newRow);
                 }
             }
             else
             {
                 string  code    = "0";
                 DataRow findRow = diray.HSFee.Rows.Find(code);
                 if (findRow != null)
                 {
                     findRow["TOTALFEE"] = Convert.ToDecimal(findRow["TOTALFEE"])
                                           + Convert.ToDecimal(zy_HSFee.Rows[index]["TOTAL_FEE"]);
                 }
                 else
                 {
                     DataRow newRow = diray.HSFee.NewRow();
                     newRow["CODE"]      = "0";
                     newRow["TOTALFEE"]  = zy_HSFee.Rows[index]["TOTAL_FEE"];
                     newRow["ITEM_NAME"] = "未设置核算项目";
                     diray.HSFee.Rows.Add(newRow);
                 }
             }
         }
     }
     catch (Exception error)
     {
         throw error;
     }
 }