Beispiel #1
0
        public string GetEmpWorkingList(int EmpID, DateTime dt1, DateTime dt2)
        {
            Hownet.BLL.WorkTicketInfo bllWTI = new Hownet.BLL.WorkTicketInfo();
            string EmpAmount = bllWTI.GetEmpSum(EmpID, dt1, dt2, false);

            Hownet.BLL.MiniEmp   bllME = new Hownet.BLL.MiniEmp();
            Hownet.Model.MiniEmp modME = bllME.GetModel(EmpID);
            DataTable            dt    = bllME.GetSumAmountByID(Convert.ToInt32(modME.IDCardID), dt1, dt2).Tables[0];


            return(EmpAmount + "ю" + Table2String(dt));
        }
Beispiel #2
0
 public string CheckUser(string UserName, string Pass)
 {
     try
     {
         int a = Convert.ToInt32(UserName);
         Hownet.BLL.MiniEmp bllME = new Hownet.BLL.MiniEmp();
         DataTable          dt    = bllME.GetList("(Sn='" + UserName + "')").Tables[0];
         if (dt.Rows.Count == 1)
         {
             return(dt.Rows[0]["ID"].ToString() + "," + dt.Rows[0]["Name"].ToString());
         }
         return("员工编号错误");
     }
     catch
     {
         return("员工编号错误");
     }
 }
Beispiel #3
0
        public string EmpAddWork(string TicketInfoID, string EmpID, string TicketTime)
        {
            if (TicketInfoID == string.Empty || TicketTime == string.Empty)
            {
                return("工序卡刷卡不正确");
            }
            if (Convert.ToDateTime(TicketTime).AddSeconds(30) < DateTime.Now)
            {
                return("刷卡超时");
            }
            if (EmpID == string.Empty)
            {
                return(string.Empty);
            }
            try
            {
                Hownet.BLL.MiniEmp   bllME = new Hownet.BLL.MiniEmp();
                Hownet.Model.MiniEmp modME = bllME.GetModel(Convert.ToInt32(EmpID));
                if (modME == null)
                {
                    return("员工不正确");
                }
                if (Convert.ToDateTime(modME.DimDate) > Convert.ToDateTime("1900-1-1"))
                {
                    return("员工已离职!");
                }
                Hownet.BLL.WorkTicketInfo   bllWTI = new Hownet.BLL.WorkTicketInfo();
                Hownet.Model.WorkTicketInfo modWTI = bllWTI.GetModel(Convert.ToInt32(TicketInfoID));
                if (modWTI == null)
                {
                    return("工序卡刷卡不正确");
                }
                if (modWTI.EmployeeID > 0)
                {
                    return("该工序已被完成");
                }
                Hownet.BLL.Working   bllW = new Hownet.BLL.Working();
                Hownet.Model.Working modW = bllW.GetModel(modWTI.WorkingID);
                if (!CheckWorkType(modW.WorkTypeID.ToString(), modME.WorkTypeID))
                {
                    return("工种不匹配");
                }
                DateTime dtNow = DateTime.Now;
                Hownet.BLL.ProductTaskMain   bllPTM = new Hownet.BLL.ProductTaskMain();
                Hownet.Model.ProductTaskMain modPTM = bllPTM.GetModel(modWTI.TaskID);
                bllWTI.GetBarBack(modWTI.ID, modME.ID, dtNow, 1);
                bllWTI.AddPayInfo(modPTM.MaterielID, modWTI.ID, modPTM.DateTime.ToString("yyyyMMdd") + modPTM.Num.ToString().PadLeft(3, '0'));
                DataRow[] drs = ReaderCard.BasicTable.dtWTCard.Select("(InfoID=" + TicketInfoID + ")");
                if (drs.Length == 1)
                {
                    drs[0]["EmployeeID"]  = modME.ID;
                    drs[0]["MiniEmpName"] = modME.Name;
                    drs[0]["DateTime"]    = DateTime.Now;
                }

                if (modWTI.WorkingID == BasicTable.BackDepotWorkingID)
                {
                    Hownet.BLL.WorkTicket   bllWT = new Hownet.BLL.WorkTicket();
                    Hownet.Model.WorkTicket modWT = bllWT.GetModel(modWTI.MainID);
                    if (modWT.P2DInfoID == 0)
                    {
                        Hownet.BLL.AmountInfo          bllAI = new Hownet.BLL.AmountInfo();
                        List <Hownet.Model.AmountInfo> liAI  = bllAI.GetModelList("(MainID=" + modWT.TaskID + ") And (TableTypeID=1) And (MListID=" + modWT.MListID + ")");
                        if (liAI.Count > 0)
                        {
                            liAI[0].NotAmount -= modWT.Amount;
                            bllAI.Update(liAI[0]);
                        }
                    }
                }
                return("今天总产量:" + bllWTI.CountAmount(modME.ID, dtNow, ReaderCard.BasicTable.IsShowMoney).ToString());
            }
            catch
            {
                return("对不起,出现错误!");
            }
            //return string.Empty;
        }
Beispiel #4
0
        public string Ordering(string EID)
        {
            try
            {
                int _eid = Convert.ToInt32(EID);
            }
            catch
            {
                return("员工不正确");
            }
            bool t = false;

            Hownet.BLL.MiniEmp   bllME = new Hownet.BLL.MiniEmp();
            Hownet.Model.MiniEmp modME = bllME.GetModel(Convert.ToInt32(EID));
            if (modME == null)
            {
                return("员工不正确");
            }
            if (Convert.ToDateTime(modME.DimDate) > Convert.ToDateTime("1900-1-1"))
            {
                return("员工已离职!");
            }
            string mes      = string.Empty;
            int    olTypeID = GetTypeID();

            if (olTypeID < 4)
            {
                DataTable dtOL = new DataTable();
                Hownet.BLL.OrderingList   bllOL = new Hownet.BLL.OrderingList();
                Hownet.Model.OrderingList modOL;
                if (BasicTable.modST.OderOne > BasicTable.modST.OderThree && olTypeID == 1)
                {
                    dtOL = bllOL.GetList("(EmployeeID=" + EID + ") And (DateTime='" + DateTime.Today.AddDays(BasicTable.modST.OrderDays + 1) + "')").Tables[0];
                }
                else
                {
                    dtOL = bllOL.GetList("(EmployeeID=" + EID + ") And (DateTime='" + DateTime.Today.AddDays(BasicTable.modST.OrderDays) + "')").Tables[0];
                }
                if (dtOL.Rows.Count == 0)
                {
                    modOL            = new Hownet.Model.OrderingList();
                    modOL.EmployeeID = Convert.ToInt32(EID);
                    modOL.DateTime   = DateTime.Today.AddDays(BasicTable.modST.OrderDays);
                    if (olTypeID == 1)
                    {
                        if (BasicTable.modST.OderOne > BasicTable.modST.OderThree)
                        {
                            modOL.DateTime = DateTime.Today.AddDays(BasicTable.modST.OrderDays + 1);
                        }
                        modOL.OrderOne      = 1;
                        modOL.DinOne        = modOL.OrderTwo = modOL.DinTwo = modOL.OrderThree = modOL.DinThree = 0;
                        modOL.OrderOneTime  = DateTime.Now;
                        modOL.DiningOneTime = modOL.OrdeTwoTime = modOL.DiningTwoTime = modOL.OrdeThreeTime = modOL.DiningThreeTime = DateTime.Parse("1900-1-1");
                        modOL.OrderCount    = 1;
                        modOL.DinCount      = 0;
                    }
                    else if (olTypeID == 2)
                    {
                        modOL.OrderTwo      = 1;
                        modOL.DinOne        = modOL.OrderOne = modOL.DinTwo = modOL.OrderThree = modOL.DinThree = 0;
                        modOL.OrdeTwoTime   = DateTime.Now;
                        modOL.DiningOneTime = modOL.OrderOneTime = modOL.DiningTwoTime = modOL.OrdeThreeTime = modOL.DiningThreeTime = DateTime.Parse("1900-1-1");
                        modOL.OrderCount    = 1;
                        modOL.DinCount      = 0;
                    }
                    else if (olTypeID == 3)
                    {
                        modOL.OrderThree    = 1;
                        modOL.DinOne        = modOL.OrderOne = modOL.DinTwo = modOL.OrderTwo = modOL.DinThree = 0;
                        modOL.OrdeThreeTime = DateTime.Now;
                        modOL.DiningOneTime = modOL.OrderOneTime = modOL.DiningTwoTime = modOL.OrdeTwoTime = modOL.DiningThreeTime = DateTime.Parse("1900-1-1");
                        modOL.OrderCount    = 1;
                        modOL.DinCount      = 0;
                    }
                    bllOL.Add(modOL);
                }
                else
                {
                    modOL = bllOL.GetModel(Convert.ToInt32(dtOL.Rows[0]["ID"]));
                    if (olTypeID == 1)
                    {
                        if (modOL.OrderOne == 0)
                        {
                            modOL.OrderOne     = 1;
                            modOL.OrderOneTime = DateTime.Now;
                            t = true;
                        }
                    }
                    else if (olTypeID == 2)
                    {
                        if (modOL.OrderTwo == 0)
                        {
                            modOL.OrderTwo    = 1;
                            modOL.OrdeTwoTime = DateTime.Now;
                            t = true;
                        }
                    }
                    else if (olTypeID == 3)
                    {
                        if (modOL.OrderThree == 0)
                        {
                            modOL.OrderThree    = 1;
                            modOL.OrdeThreeTime = DateTime.Now;
                            t = true;
                        }
                    }
                }
                if (t)
                {
                    modOL.OrderCount += 1;
                    bllOL.Update(modOL);
                }
                mes = modME.Name + "  预订";

                if (BasicTable.modST.OderOne > BasicTable.modST.OderThree && olTypeID == 1)
                {
                    mes = mes + DateTime.Today.AddDays(BasicTable.modST.OrderDays + 1).Day.ToString() + "日";
                }
                else
                {
                    mes = mes + DateTime.Today.AddDays(BasicTable.modST.OrderDays).Day.ToString() + "日";
                }
                if (olTypeID == 1)
                {
                    mes = mes + "早餐";
                }
                if (olTypeID == 2)
                {
                    mes = mes + "午餐";
                }
                if (olTypeID == 3)
                {
                    mes = mes + "晚餐";
                }
                mes = mes + "成功";
            }
            else
            {
                mes = "已经打烊不订餐了";
            }
            return(mes);
        }