Exemple #1
0
        public static List <HRAlloc> getHRAlloc(HRAlloc hRAlloc)
        {
            List <HRAlloc> listData = new List <HRAlloc>();

            try
            {
                MysqlDBA <HRAlloc> dbaHRAlloc = new MysqlDBA <HRAlloc>(FunctionController.CONNSTR);
                DataSet            ds         = dbaHRAlloc.getDataSet(string.Format("SELECT * FROM HRAlloc WHERE Year='{0}' AND INSTNO='{1}'", hRAlloc.Year, hRAlloc.INSTNO));
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    HRAlloc data = new HRAlloc();
                    data.Year         = row["Year"].ToString();
                    data.INSTNO       = row["INSTNO"].ToString();
                    data.HRAllocSerNo = int.Parse(row["HRAllocSerNo"].ToString());
                    data.JobType      = row["JobType"].ToString();
                    data.PROBG        = row["PROBG"].ToString();
                    data.FullTimeNum  = int.Parse(row["FullTimeNum"].ToString());
                    data.PartTimeNum  = int.Parse(row["PartTimeNum"].ToString());
                    listData.Add(data);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(listData);
        }
Exemple #2
0
        public static List <InstScoreTable> getInstScore(string INSTNO, string itemNo, string evalYear)
        {
            List <InstScoreTable> listData = new List <InstScoreTable>();

            try
            {
                MysqlDBA <InstScoreTable> dbaHRAlloc = new MysqlDBA <InstScoreTable>(FunctionController.CONNSTR);
                DataSet ds = dbaHRAlloc.getDataSet(string.Format("SELECT * FROM InstScoreTable WHERE INSTNO='{0}' AND EvalYear='{1}' AND ItemNo='{2}'", INSTNO, evalYear, itemNo));
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    InstScoreTable data = new InstScoreTable();
                    data.EvalYear  = row["EvalYear"].ToString();
                    data.INSTNO    = row["INSTNO"].ToString();
                    data.ItemNo    = row["ItemNo"].ToString();
                    data.SelfScore = row["SelfScore"].ToString();
                    data.EvalScore = row["EvalScore"].ToString();
                    data.EvalDesc  = row["EvalDesc"].ToString();
                    data.EvalDate  = row["EvalDate"].ToString();
                    data.SelfDate  = row["SelfDate"].ToString();
                    listData.Add(data);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(listData);
        }
Exemple #3
0
        // GET: HR
        public ActionResult Index(int page = 1)
        {
            if (Session["INSTNO"] == null || string.IsNullOrEmpty(Session["INSTNO"].ToString()))
            {
                //Log.Error(ex + ex.StackTrace);
                TempData["SessionExipred"] = "true";
                //TempData["error"] = ex + ex.StackTrace;
                //tran.Rollback();
                return(RedirectToAction("Index", "Login", null));
            }
            MysqlDBA <HRAlloc>   dbaHRAlloc   = new MysqlDBA <HRAlloc>(FunctionController.CONNSTR);
            MysqlDBA <UnitAYear> dbaUnitAYear = new MysqlDBA <UnitAYear>(FunctionController.CONNSTR);
            List <HRAlloc>       listData     = new List <HRAlloc>();
            HRData hrData = new HRData();

            try
            {
                UnitAYear queryCritUAY = new UnitAYear();
                queryCritUAY.INSTNO = Session["INSTNO"].ToString();
                queryCritUAY.Year   = (DateTime.Now.Year - 1911).ToString();
                List <UnitAYear> UAYS = (List <UnitAYear>)dbaUnitAYear.getDataList(queryCritUAY);

                HRAlloc queryCrit = new HRAlloc();
                queryCrit.Year   = (DateTime.Now.Year - 1911).ToString();
                queryCrit.INSTNO = Session["INSTNO"].ToString();
                DataSet ds = dbaHRAlloc.getDataSet(string.Format("SELECT * FROM HRAlloc WHERE Year='{0}' AND INSTNO='{1}'", queryCrit.Year, queryCrit.INSTNO));
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    HRAlloc data = new HRAlloc();
                    data.Year         = row["Year"].ToString();
                    data.INSTNO       = row["INSTNO"].ToString();
                    data.HRAllocSerNo = int.Parse(row["HRAllocSerNo"].ToString());
                    data.JobType      = row["JobType"].ToString();
                    data.PROBG        = row["PROBG"].ToString();
                    data.FullTimeNum  = int.Parse(row["FullTimeNum"].ToString());
                    data.PartTimeNum  = int.Parse(row["PartTimeNum"].ToString());
                    listData.Add(data);
                }
                List <CodeBase> codeBaseData = new List <CodeBase>();
                codeBaseData      = (List <CodeBase>) new MysqlDBA <CodeBase>(FunctionController.CONNSTR).getAllDataList(new CodeBase());
                hrData.hrDataList = listData.OrderBy(p => p.HRAllocSerNo).ToPagedList(page == 0 ? 1 : page, DefaultPageSize);
                if (UAYS.Count > 0)
                {
                    hrData.YearLeaveCnt = UAYS[0].ResignNum;
                    hrData.YearStartCnt = UAYS[0].CMDBegYearNum;
                    hrData.RateAddCnt   = UAYS[0].CMDPeriodAddNum;
                }
                TempData["CodeBase"] = codeBaseData;
            }
            catch (Exception ex)
            {
                Log.Error(ex + ex.StackTrace);
                TempData["action"] = "Function";
                TempData["error"]  = ex + ex.StackTrace;
                //tran.Rollback();
                return(RedirectToAction("Index", "HR", null));
            }
            return(View(hrData));
        }
Exemple #4
0
        internal static DataSet getMessageDataSet(MysqlDBA <MessageRec> mysqlDBA, MessageRec messageRec)
        {
            DataSet dataSet = new DataSet();

            try
            {
                dataSet = mysqlDBA.getDataSet(string.Format("SELECT * FROM MessageRec WHERE MsgSerialNo={0}", messageRec.MsgSerialNo));
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(dataSet);
        }
Exemple #5
0
 // GET: SelfRate
 public ActionResult Index()
 {
     try
     {
         if (Session["INSTNO"] == null || string.IsNullOrEmpty(Session["INSTNO"].ToString()))
         {
             //Log.Error(ex + ex.StackTrace);
             TempData["SessionExipred"] = "true";
             //TempData["error"] = ex + ex.StackTrace;
             //tran.Rollback();
             return(RedirectToAction("Index", "Login", null));
         }
         MysqlDBA <ScoreItem> mysqlDBA = new MysqlDBA <ScoreItem>(FunctionController.CONNSTR);
         //MysqlDBA<InstScoreTable> mysqlDBAInstScoreTable = new MysqlDBA<InstScoreTable>(FunctionController.CONNSTR);
         List <ScoreItem>      lstScoreItem      = new List <ScoreItem>();
         DataSet               scoreItemsdateSet = mysqlDBA.getDataSet(string.Format("SELECT * FROM ScoreItem WHERE ItemParentNo='-1'"));
         List <InstScoreTable> instScoreTables   = Utility.Utility.getInstScore(Session["INSTNO"].ToString(), (DateTime.Now.Year - 1911).ToString());
         foreach (DataRow scoreItem in scoreItemsdateSet.Tables[0].Rows)
         {
             ScoreItem score_Item = new ScoreItem();
             score_Item.ItemNo       = scoreItem["ItemNo"].ToString();
             score_Item.ItemParentNo = scoreItem["ItemParentNo"].ToString();
             score_Item.ItemDesc     = scoreItem["ItemDesc"].ToString();
             score_Item.ItemGrade    = scoreItem["ItemGrade"].ToString();
             score_Item.ItemScore    = scoreItem["ItemScore"].ToString();
             score_Item.EvalYear     = scoreItem["EvalYear"].ToString();
             score_Item.EvalType     = scoreItem["EvalType"].ToString();
             score_Item.CreateDate   = scoreItem["CreateDate"].ToString();
             score_Item.getChildItem(Session["INSTNO"].ToString(), score_Item.ItemNo);
             lstScoreItem.Add(score_Item);
             if (Session["INSTNO"] == null || string.IsNullOrEmpty(Session["INSTNO"].ToString()))
             {
                 TempData["SessionExipred"] = "true";
                 return(RedirectToAction("Index", "Login", null));
             }
         }
         TempData["ScoreItems"] = lstScoreItem;
         TempData["InstScores"] = instScoreTables;
     }
     catch (Exception ex)
     {
         Log.Error(ex + ex.StackTrace);
         TempData["action"] = "Function";
         TempData["error"]  = ex + ex.StackTrace;
         return(RedirectToAction("Index", "SelfRate", null));
     }
     return(View());
 }
Exemple #6
0
 public ActionResult Edit(string year, string INSTNO, string HRAllocSerNo)
 {
     try
     {
         if (Session["INSTNO"] == null || string.IsNullOrEmpty(Session["INSTNO"].ToString()))
         {
             //Log.Error(ex + ex.StackTrace);
             TempData["SessionExipred"] = "true";
             //TempData["error"] = ex + ex.StackTrace;
             //tran.Rollback();
             return(RedirectToAction("Index", "Login", null));
         }
         List <HRAlloc> listData  = new List <HRAlloc>();
         HRAlloc        queryCrit = new HRAlloc();
         queryCrit.Year         = year;
         queryCrit.INSTNO       = INSTNO;
         queryCrit.HRAllocSerNo = int.Parse(HRAllocSerNo);
         MysqlDBA <HRAlloc> mysqlDBA = new MysqlDBA <HRAlloc>(FunctionController.CONNSTR);
         DataSet            ds       = mysqlDBA.getDataSet(string.Format("SELECT * FROM HRAlloc WHERE Year='{0}' AND INSTNO='{1}' AND HRAllocSerNo = '{2}'", queryCrit.Year, queryCrit.INSTNO, queryCrit.HRAllocSerNo));
         foreach (DataRow row in ds.Tables[0].Rows)
         {
             HRAlloc data = new HRAlloc();
             data.Year         = row["Year"].ToString();
             data.INSTNO       = row["INSTNO"].ToString();
             data.HRAllocSerNo = int.Parse(row["HRAllocSerNo"].ToString());
             data.JobType      = row["JobType"].ToString();
             data.PROBG        = row["PROBG"].ToString();
             data.FullTimeNum  = int.Parse(row["FullTimeNum"].ToString());
             data.PartTimeNum  = int.Parse(row["PartTimeNum"].ToString());
             listData.Add(data);
         }
         TempData["HRAlloc"] = listData;
         List <CodeBase> codeBaseData = new List <CodeBase>();
         codeBaseData         = (List <CodeBase>) new MysqlDBA <CodeBase>(FunctionController.CONNSTR).getAllDataList(new CodeBase());
         TempData["CodeBase"] = codeBaseData;
     }
     catch (Exception ex)
     {
         Log.Error(ex + ex.StackTrace);
         TempData["action"] = "Function";
         TempData["error"]  = ex + ex.StackTrace;
         //tran.Rollback();
         return(RedirectToAction("Index", "HR", null));
     }
     return(RedirectToAction("Index", "HRAdd", null));
 }
Exemple #7
0
 public ActionResult Edit(string year, string INSTNO, string TrSeialNo1)
 {
     try
     {
         if (Session["INSTNO"] == null || string.IsNullOrEmpty(Session["INSTNO"].ToString()))
         {
             //Log.Error(ex + ex.StackTrace);
             TempData["SessionExipred"] = "true";
             //TempData["error"] = ex + ex.StackTrace;
             //tran.Rollback();
             return(RedirectToAction("Index", "Login", null));
         }
         List <UnitAToBSum> listData  = new List <UnitAToBSum>();
         UnitAToBSum        queryCrit = new UnitAToBSum();
         queryCrit.Year      = year;
         queryCrit.INSTNO    = INSTNO;
         queryCrit.TrSeialNo = int.Parse(TrSeialNo1);
         MysqlDBA <UnitAToBSum> mysqlDBA = new MysqlDBA <UnitAToBSum>(FunctionController.CONNSTR);
         DataSet ds = mysqlDBA.getDataSet(string.Format("SELECT * FROM UnitAToBSum WHERE Year='{0}' AND INSTNO='{1}' AND TrSeialNo = '{2}'", queryCrit.Year, queryCrit.INSTNO, queryCrit.TrSeialNo));
         foreach (DataRow row in ds.Tables[0].Rows)
         {
             UnitAToBSum data = new UnitAToBSum();
             data.Year      = row["Year"].ToString();
             data.INSTNO    = row["INSTNO"].ToString();
             data.TrSeialNo = int.Parse(row["TrSeialNo"].ToString());
             data.LCareType = row["LCareType"].ToString();
             data.UnitBNo   = row["UnitBNo"].ToString();
             data.UnitBName = row["UnitBName"].ToString();
             data.TrCaseNum = row["TrCaseNum"].ToString();
             listData.Add(data);
         }
         TempData["UnitAToBSum"] = listData;
         List <CodeBase> codeBaseData = new List <CodeBase>();
         codeBaseData         = (List <CodeBase>) new MysqlDBA <CodeBase>(FunctionController.CONNSTR).getAllDataList(new CodeBase());
         TempData["CodeBase"] = codeBaseData;
     }
     catch (Exception ex)
     {
         Log.Error(ex + ex.StackTrace);
         TempData["action"] = "Function";
         TempData["error"]  = ex + ex.StackTrace;
         //tran.Rollback();
         return(RedirectToAction("Index", "SupportUnit", null));
     }
     return(RedirectToAction("Index", "SupportUnitAdd", null));
 }
Exemple #8
0
 // GET: Meeting
 public ActionResult Edit(string MSerNo)
 {
     try
     {
         if (Session["INSTNO"] == null || string.IsNullOrEmpty(Session["INSTNO"].ToString()))
         {
             //Log.Error(ex + ex.StackTrace);
             TempData["SessionExipred"] = "true";
             //TempData["error"] = ex + ex.StackTrace;
             //tran.Rollback();
             return(RedirectToAction("Index", "Login", null));
         }
         List <UnitAMeeting> listData  = new List <UnitAMeeting>();
         UnitAMeeting        queryCrit = new UnitAMeeting();
         queryCrit.MSerialNo = int.Parse(MSerNo);
         MysqlDBA <UnitAMeeting> mysqlDBA = new MysqlDBA <UnitAMeeting>(FunctionController.CONNSTR);
         DataSet ds = mysqlDBA.getDataSet(string.Format("SELECT * FROM UnitAMeeting WHERE MSerialNo = '{0}'", queryCrit.MSerialNo));
         foreach (DataRow row in ds.Tables[0].Rows)
         {
             UnitAMeeting data = new UnitAMeeting();
             data.Year       = row["Year"].ToString();
             data.INSTNO     = row["INSTNO"].ToString();
             data.MSerialNo  = int.Parse(row["MSerialNo"].ToString());
             data.MType      = row["MType"].ToString();
             data.MDate      = Utility.Utility.convertUDT2ROCDateFormat(DateTime.Parse(row["MDate"].ToString()).ToString("MM/dd/yyyy"));
             data.Topic      = row["Topic"].ToString();
             data.AttendNum  = int.Parse(row["AttendNum"].ToString());
             data.ProfCnt    = int.Parse(row["ProfCnt"].ToString());
             data.CreateDate = row["CreateDate"].ToString();
             data.ModifyDate = row["ModifyDate"].ToString();
             listData.Add(data);
         }
         TempData["UnitAMeeting"] = listData;
     }
     catch (Exception ex)
     {
         Log.Error(ex + ex.StackTrace);
         TempData["action"] = "Function";
         TempData["error"]  = ex + ex.StackTrace;
         //tran.Rollback();
         return(RedirectToAction("Index", "Meeting", null));
     }
     return(RedirectToAction("Index", "MeetingAdd", null));
 }
Exemple #9
0
        internal static int getUnitAToBSumSerNo(MysqlDBA <UnitAToBSum> mysqlDBA)
        {
            int retInt = 0;

            try
            {
                string  strSQL = "select MAX(TrSeialNo) TrSeialNo from UnitAToBSum ";
                DataSet ds     = mysqlDBA.getDataSet(strSQL);
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if (!string.IsNullOrEmpty(row["TrSeialNo"].ToString()))
                    {
                        retInt = int.Parse(row["TrSeialNo"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(retInt);
        }
Exemple #10
0
        internal static int getCaseSrvRecSerNo(MysqlDBA <CaseSvrRec> mysqlDBA)
        {
            int retInt = 0;

            try
            {
                string  strSQL = "select MAX(CaseSerNo) CaseSerNo from CaseSvrRec";
                DataSet ds     = mysqlDBA.getDataSet(strSQL);
                foreach (DataRow row in ds.Tables[0].Rows)
                {
                    if (!string.IsNullOrEmpty(row["CaseSerNo"].ToString()))
                    {
                        retInt = int.Parse(row["CaseSerNo"].ToString());
                    }
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(retInt);
        }