Example #1
0
        /// <summary>
        /// 获取当前用户当天的打卡信息
        /// </summary>
        private void BindDutyInfo()
        {
            ManagerInfo currentManager = ManagerHelper.GetCurrentManager();
            DataTable   dtDuty         = ManagerHelper.GetDutyInfo(currentManager.UserId);

            if (dtDuty.Rows.Count > 0)
            {
                string orderTotal  = dtDuty.Rows[0]["OrderTotal"] == DBNull.Value ? "0" : ((decimal)dtDuty.Rows[0]["OrderTotal"]).ToString("F2");
                string orderCount  = dtDuty.Rows[0]["OrderCount"].ToString();
                string timeLoginIn = ((DateTime)dtDuty.Rows[0]["LoginTime"]).ToString("HH:mm");
                string timeNow     = DateTime.Now.ToString("HH:mm");
                string timeMinus   = TimeMinus((DateTime)dtDuty.Rows[0]["LoginTime"], DateTime.Now);


                litUserInfo.Text  = string.Format("<td>{0}</td><td>{1}</td>", currentManager.UserName, DateTime.Now);
                litTimeInfo.Text  = string.Format("<td>{0} - {1}</td> <td id='DutyHours'>{2}</td>", timeLoginIn, timeNow, timeMinus);
                litOrderInfo.Text = string.Format("<td>¥{0}</td>", orderTotal);
                litSaleInfo.Text  = string.Format("<td>{0}单</td>", orderCount);
                litSaleInfo.Text += string.Format("<td>¥{0}/{1}单</td>", orderTotal, orderCount);
            }
        }