示例#1
0
        private void do_save()
        {
            //DataSet ds = dacTimebook.GetDS(RefWeek, 14);

            for (int i = 0; i < tlpStaff.RowCount; i++)
            {
                ucSalary uc = (ucSalary)tlpStaff.GetControlFromPosition(0, i);

                if (!uc.EmpChk)
                {
                    continue;
                }
                if (uc.IsDelete())
                {
                    continue;
                }
                if (!uc.IsDirty())
                {
                    continue;
                }

                MessageBox.Show(uc.EmpName, System.Reflection.MethodBase.GetCurrentMethod().ToString());

                //RCD rcd = uc.RcdStat;
                //for (int j = 0; j <= 13; j++)
                //    if (rcd.toff[j] != null)  MessageBox.Show(rcd.toff[j].ToString());


                DataRow  row;
                DateTime next_date;

                for (int day = 0; day < 14; day++)
                {
                    next_date = RefWeek.Date.AddDays(day);

                    string toff = uc.EmpToff[day];
                    //string vessel = uc.EmpVessel[day];

                    string paycode = uc.DefPayCode;

                    string empname = uc.EmpName;

                    Decimal hour  = uc.EmpHour[day];
                    Decimal over  = uc.EmpOver[day];
                    Decimal over1 = uc.EmpOver1[day];

                    int    shift   = 0;
                    string lognote = uc.EmpNote[day];

                    MessageBox.Show(string.Format("nd{0} e{1}", next_date, uc.EmpID), System.Reflection.MethodBase.GetCurrentMethod().ToString());
                    //dacTimebook.vwUpdTimebook(DBO, next_date, uc.EmpID, shift, toff, null, hour, over, over1, null, paycode);


                    //row = ds.Tables[0].NewRow();
                    //row["EmpName"] = uc.EmpName;

                    //if (toff != null && toff.Length == 0)
                    //    row["ToffCode"] = null;
                    //else
                    //    row["ToffCode"] = toff;

                    //row["LogHours"] = uc.EmpHour[day];
                    //row["LogOver"] = uc.EmpOver[day];

                    //if (vessel != null && vessel.Length == 0)
                    //    row["LogVessel"] = null;
                    //else
                    //    row["LogVessel"] = uc.EmpVessel[day];

                    //row["LogShift"] = 0;

                    //row["LogNote"] = null;
                    //if (uc.EmpNote[day] != null && uc.EmpNote[day].Length > 0)
                    //    row["LogNote"] = uc.EmpNote[day];

                    //dacTimebook.FindAdd(new object[] { next_date, uc.EmpID, 0 }, row);

                    //uc.SaveReset();
                }
            }

            //dacTimebook.SaveData();
            //dacCache.PutTimebook();
            cmdSave.Visible = false;



            //DataSet ds = dacTimebook.GetDS(RefWeek, 14);

            //for (int i = 0; i < tlpCrew.RowCount; i++)
            //{
            //    ucSalary uc = (ucSalary)tlpCrew.GetControlFromPosition(0, i);

            //    if (!uc.EmpChk) continue;
            //    if (uc.IsDelete()) continue;
            //    if (!uc.IsDirty()) continue;

            //    //MessageBox.Show(uc.EmpName);

            //    //RCD rcd = uc.RcdStat;
            //    //for (int j = 0; j <= 13; j++)
            //    //    if (rcd.toff[j] != null)  MessageBox.Show(rcd.toff[j].ToString());


            //    DataRow row;
            //    DateTime next_date;

            //    for (int day = 0; day < 14; day++)
            //    {
            //        next_date = RefWeek.Date.AddDays(day);

            //        string toff = uc.EmpToff[day];
            //        string vessel = uc.EmpVessel[day];

            //        row = ds.Tables[0].NewRow();
            //        row["EmpName"] = uc.EmpName;

            //        if (toff != null && toff.Length == 0)
            //            row["ToffCode"] = null;
            //        else
            //            row["ToffCode"] = toff;

            //        row["LogHours"] = uc.EmpHour[day];
            //        row["LogOver"] = uc.EmpOver[day];

            //        if (vessel != null && vessel.Length == 0)
            //            row["LogVessel"] = null;
            //        else
            //            row["LogVessel"] = uc.EmpVessel[day];

            //        row["LogShift"] = 0;

            //        row["LogNote"] = null;
            //        if (uc.EmpNote[day] != null && uc.EmpNote[day].Length > 0)
            //            row["LogNote"] = uc.EmpNote[day];

            //        dacTimebook.FindAdd(new object[] { next_date, uc.EmpID, 0 }, row);

            //        uc.SaveReset();
            //    }
            //}

            //dacTimebook.SaveData();
            ////dacCache.PutTimebook();
            //cmdSave.Visible = false;
        }