Exemple #1
0
        public DataTable GetSaleByDay(F_Shop_SaleReport filter)
        {
            B_OrderList orderBll = new B_OrderList();

            if (string.IsNullOrEmpty(filter.SDate))
            {
                filter.SDate = DateTime.Now.AddMonths(-2).ToString("yyyy/MM/dd");
            }
            if (string.IsNullOrEmpty(filter.EDate))
            {
                filter.EDate = DateTime.Now.ToString("yyyy/MM/dd");
            }
            DateTime  STime = DataConvert.CDate(filter.SDate), ETime = DataConvert.CDate(filter.EDate);
            DataTable saleDT = orderBll.Report_SelByDate(STime, ETime, filter.StoreID);
            DataTable dayDT  = new DataTable();

            dayDT.Columns.Add("date", typeof(string));
            dayDT.Columns.Add("total", typeof(double));
            dayDT.Columns.Add("pay_online", typeof(double));
            dayDT.Columns.Add("pay_purse", typeof(double));
            for (DateTime s = STime; s <= ETime; s = s.AddDays(1))
            {
                DataRow day = dayDT.NewRow();
                //DateTime sdate = Convert.ToDateTime("{0}/{1}/{2} 00:00:00");
                string sdate = s.ToString("#yyyy/MM/dd 00:00:00#"), edate = s.ToString("#yyyy/MM/dd 23:59:59#");
                saleDT.DefaultView.RowFilter = "PayTime>= " + sdate + " AND PayTime<= " + edate;
                day["date"]       = s.ToString("yyyy-MM-dd");
                day["total"]      = 0;
                day["pay_online"] = 0;
                day["pay_purse"]  = 0;
                foreach (DataRow dr in saleDT.DefaultView.ToTable().Rows)
                {
                    day["Total"] = DataConvert.CDouble(day["Total"]) + DataConvert.CDouble(dr["OrdersAmount"]);
                    if (Convert.ToInt32(dr["PayPlatID"]) == 0)
                    {
                        day["pay_purse"] = DataConvert.CDouble(day["pay_purse"]) + DataConvert.CDouble(dr["OrdersAmount"]);
                    }
                    else
                    {
                        day["pay_online"] = DataConvert.CDouble(day["pay_online"]) + DataConvert.CDouble(dr["OrdersAmount"]);
                    }
                }
                dayDT.Rows.Add(day);
            }
            return(dayDT);
        }
Exemple #2
0
    //用于酒店订单等
    public string GetAddition()
    {
        string additional = Eval("Additional").ToString(), result = "", contract = "";

        if (string.IsNullOrEmpty(additional))
        {
            return("");
        }
        switch (ProClass)
        {
        case 7:    //旅游,酒店,机票
        {
            string        tlp   = "入住时间:{0}<br/>联系人:{1}";
            M_Cart_Travel model = JsonConvert.DeserializeObject <M_Cart_Travel>(additional);
            foreach (M_Cart_Contract m in model.Contract)
            {
                contract += m.Name + "," + m.Mobile + "|";
            }
            contract = contract.TrimEnd('|');
            string another = string.IsNullOrEmpty(model.ProList[0].Remind) ? "" : DataConvert.CDate(model.ProList[0].Remind).ToString("MM-dd HH:mm");
            result = string.Format(tlp, model.ProList[0].GoDate.ToString("MM-dd HH:mm --") + another, contract);
        }
        break;

        case 8:
        {
            string       tlp   = "订单信息:{0},{1}人,时间:{2}--{3}<br/>入住人:{4}<br/>联系人:{5}";
            M_Cart_Hotel model = JsonConvert.DeserializeObject <M_Cart_Hotel>(additional);
            foreach (M_Cart_Contract m in model.Contract)
            {
                contract += m.Name + "," + m.Mobile + "|";
            }
            contract = contract.TrimEnd('|');
            result   = string.Format(tlp, model.HotelName, model.PeopleNum, model.ProList[0].GoDate, model.ProList[0].OutDate, model.Guest[0].Name, contract);
        }
        break;

        case 9:
            break;

        default:
            break;
        }
        return(result);
    }
Exemple #3
0
        /// <summary>
        /// 执行签到/签退操作
        /// </summary>
        /// <param name="uid"></param>
        /// <returns>签到记录ID,若返回值为-1说明今日已签退,此次没有进行任何操作</returns>
        private int Sign(M_UserInfo mu, int ZType)
        {
            M_Plat_Sign model = new M_Plat_Sign();
            DateTime    sdate = DataConvert.CDate("08:30"); //上班时间
            DateTime    edate = DataConvert.CDate("18:00"); //下班时间

            model.State = 0;
            if (ZType == 0 && DateTime.Now > sdate)
            {
                model.State = 1;
            }                                                           //迟到
            if (ZType == 1 && DateTime.Now < edate)
            {
                model.State = 2;
            }                                                           //早退
            model.UserID     = mu.UserID;
            model.IP         = IPScaner.GetUserIP();
            model.IPLocation = IPScaner.IPLocation(model.IP);
            model.ZType      = ZType;
            return(Insert(model));
        }
        //为用户添加域名
        protected void domListBtn_Click(object sender, EventArgs e)
        {
            string datavalue = Request.Form["dataValue"] + ",";

            datavalue += "prvinceDP:" + prvinceDP.SelectedValue + ",";
            datavalue += "uteln:" + Request.Form["uteln"];
            string     t1      = domListT1.Text.Trim(); //域名
            string     t2      = domListT2.Text.Trim(); //用户名
            string     t3      = domListT3.Text.Trim(); //日期
            int        year    = Convert.ToInt32(yearDP.SelectedValue);
            DateTime   endtime = DataConvert.CDate(t3).AddYears(year);
            M_UserInfo mu      = buser.GetUserIDByUserName(t2);

            if (year < 1)
            {
                function.WriteErrMsg("年限错误!");
            }
            else if (string.IsNullOrEmpty(t1) || string.IsNullOrEmpty(t2))
            {
                function.WriteErrMsg("用户名与域名不能为空");
            }
            else if (mu.IsNull)
            {
                function.WriteErrMsg("用户不存在");
            }

            if (Request.QueryString["Edit"] == "1" && Request.QueryString["id"] != "")
            {
                domListBll.UpdateByID(t1, DataConvert.CDate(t3), endtime, mu.UserID, datavalue, year, Request.QueryString["id"]);
                function.WriteSuccessMsg("修改成功", "DomManage.aspx");
            }
            else
            {
                domListBll.Insert(t1, DataConvert.CDate(t3), endtime, mu.UserID, datavalue, year);
                function.WriteSuccessMsg("添加成功", "DomManage.aspx");
            }
        }
        protected void Update(int rowNum, string id)//Update WebSite with index=0,Name,Port,PPath,Domain
        {
            IISWebSite  site = new IISWebSite();
            GridViewRow gr   = EGV.Rows[rowNum];

            site.SiteName = ((TextBox)gr.FindControl("EditSiteName")).Text.Trim();
            site.Port     = ((TextBox)gr.FindControl("EditPort")).Text.Trim();
            //site.PhysicalPath = ((TextBox)gr.FindControl("EditPhySicalPath")).Text.Trim();
            //site.DomainName = ((TextBox)gr.FindControl("EditDomain")).Text.Trim();
            IISHelper iisM = new IISHelper();
            DataTable dt   = iisM.GetWebSiteList();

            dt.DefaultView.RowFilter = "SiteID=" + id;
            DataRow dr = dt.DefaultView.ToTable().Rows[0];

            //-----有更改才更新,先更新域名
            if (!(dr["SiteName"] as string).Equals(site.SiteName))
            {
                iisHelper.ChangeSiteName(dr["SiteName"] as string, site.SiteName);
            }
            if (!(dr["SitePort"] as string).Equals(site.Port))
            {
                iisHelper.ChangeSitePort(site.SiteName, site.Port);
            }
            //if (!(dr["PhysicalPath"] as string).Equals(site.PhysicalPath))
            //    iisHelper.ChangeSitePath(site.SiteName, site.PhysicalPath);
            //if (!(dr["Domain"] as string).Equals(site.DomainName))
            //    iisHelper.ChangeSiteDomain(site.SiteName, site.DomainName);

            B_Site_SiteList siteBll   = new B_Site_SiteList();
            M_Site_SiteList siteModel = new M_Site_SiteList();

            siteModel         = siteBll.SelBySiteID(id);
            siteModel.EndDate = DataConvert.CDate(((TextBox)gr.FindControl("EditEndDate")).Text.Trim());
            siteBll.UpdateModel(siteModel);
            Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('修改完成');location=location;", true);
        }
Exemple #6
0
        protected void ExportExcel_B_Click(object sender, EventArgs e)
        {
            OfficeHelper helper = new OfficeHelper();
            DataTable    dt     = orderBll.IDC_Sel((int)M_OrderList.OrderEnum.IDC, souchtable.SelectedValue, souchkey.Text, OrderBy, SelType);

            dt.Columns.Add("UserName");
            dt.Columns.Add("IsExpire"); //是否过期
            dt.Columns.Add("OStatus");  //状态
            dt.Columns.Add("PStatus");  //财务
            for (int i = 0; i < dt.Rows.Count; i++)
            {
                DataRow dr = dt.Rows[i];
                dr["UserName"] = GetUsers(dr["UserID"].ToString());
                dr["Domain"]   = dr["Domain"].ToString().ToLower().Replace("www.", "");
                dr["STime"]    = DataConvert.CDate(dr["STime"]).ToString("yyyy-MM-dd");
                dr["ETime"]    = DataConvert.CDate(dr["ETime"]).ToString("yyyy-MM-dd");
                dr["OStatus"]  = RemoveHtml(formatzt(dr["OrderStatus"].ToString(), "0"));
                dr["PStatus"]  = RemoveHtml(formatzt(dr["Paymentstatus"].ToString(), "1"));
            }
            DataTable newDt      = dt.DefaultView.ToTable(false, "ID,OrderNo,Domain,UserName,Proname,STime,ETime,IsExpire,OStatus,PStatus".Split(','));
            string    columnames = "ID,订单号,绑定域名,会员,商品名称,生效时间,到期时间,是否到期,状态,财务";

            SafeC.DownStr(helper.ExportExcel(newDt, columnames), DateTime.Now.ToString("yyyyMMdd") + "IDC订单表.xls", Encoding.UTF8);
        }
        public void MyBind()
        {
            M_User_Plat up = B_User_Plat.GetLogin();
            //---------------总览
            DateTime  st    = Convert.ToDateTime(CurDate.Year + "-" + CurDate.Month + "-01");
            DataTable dt    = signBll.SelCompByMonth(st, up.CompID);
            DateTime  dtNow = DateTime.Now;

            if (CurDate.Year == dtNow.Year && CurDate.Month == dtNow.Month)
            {
                AllCount = dtNow.Day;
            }
            else
            {
                AllCount = DateTime.DaysInMonth(st.Year, st.Month);
            }
            dt.Columns.Add("lack", typeof(int));
            dt.Columns.Add("invalid", typeof(int));
            foreach (DataRow dr in dt.Rows)
            {
                dr["lack"]    = AllCount - DataConvert.CLng(dr["attendance"]);
                dr["invalid"] = DataConvert.CLng(dr["attendance"]) * 2 - DataConvert.CLng(dr["signcount"]);
            }
            AllCount_L.Text   = AllCount.ToString();
            Late_L.Text       = dt.Compute("SUM(late)", "true").ToString();
            LeaveEarly_L.Text = dt.Compute("SUM(leave)", "true").ToString();
            Lack_L.Text       = dt.Compute("SUM(lack)", "true").ToString();
            Invalid_L.Text    = dt.Compute("SUM(invalid)", "true").ToString();

            //----------------考勤概略
            if (Tabs == 0)
            {
                RPT.DataSource = dt;
                RPT.DataBind();
            }
            //----------------出勤清单
            else
            {
                //获取当月员工考勤数据
                DataTable info_dt = signBll.SelInfoByMonth(st, up.CompID);
                //新建一列,用来标识签到日期
                info_dt.Columns.Add("Date", typeof(DateTime));
                foreach (DataRow row in info_dt.Rows)
                {
                    row["Date"] = DataConvert.CDate(row["CDate"]).Date;
                }
                //新建清单表,为info_dt合并重复的Date、TrueName数据
                DataTable newDt = info_dt.AsDataView().ToTable(true, "Date", "TrueName", "UserID");
                //增加一列,保存工时
                newDt.Columns.Add("TimeLen", typeof(string));
                newDt.Columns.Add("InTime", typeof(string));
                newDt.Columns.Add("OutTime", typeof(string));
                int count = 0;
                for (int i = 0; i < newDt.Rows.Count + count; i++)
                {
                    DataRow row = newDt.Rows[i - count];
                    //从info_dt获取指定日期的数据
                    string where = "TrueName = '" + row["TrueName"] + "' AND Date ='" + row["Date"] + "'";
                    DataRow[] r = info_dt.Select(where);
                    if (r.Length == 2)//签到、签退记录都有才计有效考勤
                    {
                        DateTime t1 = DataConvert.CDate(r[0]["CDate"]);
                        DateTime t2 = DataConvert.CDate(r[1]["CDate"]);
                        row["InTime"]  = t1.ToShortTimeString();
                        row["OutTime"] = t2.ToShortTimeString();
                        row["TimeLen"] = (t2 - t1).TotalHours.ToString("0.0") + "小时";
                    }
                    else
                    {
                        newDt.Rows.Remove(row); count++;
                    }
                }
                EGV.DataSource = newDt;
                EGV.DataBind();
            }
            function.Script(this, "CheckTabs(" + Tabs + ");");
        }
Exemple #8
0
    //Uid为提供
    public string GetRUser()
    {
        string tlp = "<span class='uname' title='回复时间:{0}'><span class='glyphicon glyphicon-comment'></span><a href='{1}'>{2}</a>"
                     + "<span class='pull-right remind_g_x'>{3}</span></span>";
        bool isnull = Eval("R_CUser") == DBNull.Value;
        int  rcuser = isnull ? DataConvert.CLng(Eval("CUser").ToString()) : DataConvert.CLng(Eval("R_CUser").ToString());

        string   rcuname = isnull ? function.GetStr(barBll.GetUName(Eval("HoneyName"), Eval("CUName")), 6) : function.GetStr(Eval("R_CUName"), 6);
        string   url     = rcuser == 0 ? "javascript:;" : CreateUrl(1, "") + "?uid=" + rcuser;
        DateTime cdate   = isnull ? Convert.ToDateTime(Eval("CDate")) : Convert.ToDateTime(Eval("R_CDate"));
        string   rdate   = cdate.ToString("yyyy-MM-dd HH:mm");
        string   rdate2  = isnull ? DataConvert.CDate(Eval("CDate")).ToString("yyyy/MM/dd HH:mm") : DataConvert.CDate(Eval("R_CDate")).ToString("yyyy/MM/dd HH:mm");

        return(string.Format(tlp, rdate, url, rcuname, rdate2));
    }
Exemple #9
0
        public IActionResult TaskAdd_Submit()
        {
            if (Mid > 0)
            {
                scheMod = scheBll.GetModel(Mid);
            }
            scheMod.TaskName = RequestEx["TaskName_T"];
            //scheMod.ExecuteTime = ExecuteTime_T1.Text;
            scheMod.Interval = DataConvert.CLng(RequestEx["Interval_T"]);
            string taskContent = RequestEx["TaskContent_T"].Trim();

            if (taskContent.StartsWith("/"))//任务内容为脚本路径时
            {
                if (!System.IO.File.Exists(function.VToP(taskContent)))
                {
                    return(WriteErr("脚本不存在"));
                }
                else
                {
                    scheMod.TaskContent = taskContent;
                }
            }
            else
            {
                scheMod.TaskContent = taskContent;
            }
            scheMod.Remind = RequestEx["Remind_T"];
            //任务类型不允许修改
            if (Mid <= 0)
            {
                scheMod.TaskType = DataConvert.CLng(Request.Form["taskType_rad"]);
            }
            scheMod.ExecuteType = DataConvert.CLng(Request.Form["executeType_rad"]);
            scheMod.Status      = DataConvert.CLng(Request.Form["status_rad"]);
            if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.Interval)
            {
                if (scheMod.Interval <= 0)
                {
                    return(WriteErr("未指定正确的间隔时间"));
                }
            }
            else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.JustOnce)
            {
                scheMod.ExecuteTime = RequestEx["ExecuteTime_T1"];
                if (DataConvert.CDate(scheMod.ExecuteTime) < DateTime.Now)
                {
                    return(WriteErr("执行时间无效"));
                }
            }
            else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.EveryDay)
            {
                scheMod.ExecuteTime = RequestEx["ExecuteTime_T2"];
            }
            else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.EveryMonth)
            {
                scheMod.ExecuteTime = RequestEx["ExecuteTime_T1"];
            }
            if (Mid > 0)
            {
                scheBll.Update(scheMod);
            }
            else
            {
                scheMod.CDate   = DateTime.Now;
                scheMod.AdminID = adminMod.AdminId;
                scheMod.ID      = scheBll.Add(scheMod);
            }
            HFHelper.AddTask(scheMod);
            return(WriteOK("操作成功", "TaskList"));
        }
        private void MyBind()
        {
            int guestnum = 0, totalnum = 0;

            if (!string.IsNullOrEmpty(ids))
            {
                M_Cart       cartMod  = cartBll.SelReturnModel(DataConvert.CLng(ids.Split(',')[0]));
                M_Cart_Hotel hotelMod = JsonConvert.DeserializeObject <M_Cart_Hotel>(cartMod.Additional);
                Pros                = JsonConvert.SerializeObject(hotelMod.ProList);
                Guest_Hid2.Value    = JsonConvert.SerializeObject(hotelMod.Guest);
                Contract_Hid2.Value = JsonConvert.SerializeObject(hotelMod.Contract);
                guestnum            = hotelMod.Guest.Count;
            }
            //绑定显示商品
            if (!string.IsNullOrEmpty(Pros))
            {
                JArray    proArr      = (JArray)JsonConvert.DeserializeObject(Pros);//将其转化为DataTable?
                DataTable proDT       = CreateProDT();
                double    proAllMoney = 0;
                for (int i = 0; i < proArr.Count; i++)
                {
                    M_Product proMod = proBll.GetproductByid(Convert.ToInt32(proArr[i]["ProID"].ToString()));
                    if (proMod.ID > 0)
                    {
                        for (int j = 0; j < DataConvert.CLng(proArr[i]["Pronum"].ToString()); j++)
                        {
                            DataRow proDR = proDT.NewRow();
                            proDR["ProID"]    = proMod.ID;
                            proDR["ProName"]  = proMod.Proname;
                            proDR["Pronum"]   = GetDiffDay(DataConvert.CDate(proArr[i]["GoDate"].ToString()), DataConvert.CDate(proArr[i]["OutDate"].ToString()));
                            proDR["Price"]    = proMod.LinPrice;
                            proDR["AllMoney"] = GetDiffDay(DataConvert.CDate(proArr[i]["GoDate"].ToString()), DataConvert.CDate(proArr[i]["OutDate"].ToString())) * Convert.ToDouble(proDR["Price"]);
                            proDR["GoDate"]   = DataConvert.CDate(proArr[i]["GoDate"]);
                            proDR["OutDate"]  = proArr[i]["OutDate"].ToString();
                            proDR["Remind"]   = HttpUtility.UrlDecode(proArr[i]["Remind"].ToString());
                            proDT.Rows.Add(proDR);
                            proAllMoney += Convert.ToDouble(proDR["AllMoney"]);
                            totalnum    += 2;
                        }
                    }
                }
                AllMoney_sp.InnerText  = proAllMoney.ToString("0.00");
                ProList_RPT.DataSource = proDT;
                ProList_RPT.DataBind();
                Pros = JsonHelper.JsonSerialDataTable(proDT);
                function.Script(this, "AddGuests(" + (string.IsNullOrEmpty(ids) ? totalnum : guestnum) + ");");
            }
        }
 protected void Save_Btn_Click(object sender, EventArgs e)
 {
     if (Mid > 0)
     {
         scheMod = scheBll.GetModel(Mid);
     }
     scheMod.TaskName = TaskName_T.Text;
     //scheMod.ExecuteTime = ExecuteTime_T1.Text;
     scheMod.Interval = DataConvert.CLng(Interval_T.Text);
     if (TaskContent_T.Text.StartsWith("/"))//任务内容为脚本路径时
     {
         if (!File.Exists(function.VToP(TaskContent_T.Text)))
         {
             function.WriteErrMsg("脚本不存在");
         }
         else
         {
             scheMod.TaskContent = TaskContent_T.Text;
         }
     }
     else
     {
         scheMod.TaskContent = TaskContent_T.Text;
     }
     scheMod.Remind = Remind_T.Text;
     //任务类型不允许修改
     if (Mid <= 0)
     {
         scheMod.TaskType = DataConvert.CLng(Request.Form["taskType_rad"]);
     }
     scheMod.ExecuteType = DataConvert.CLng(Request.Form["executeType_rad"]);
     scheMod.Status      = DataConvert.CLng(Request.Form["status_rad"]);
     if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.Interval)
     {
         if (scheMod.Interval <= 0)
         {
             function.WriteErrMsg("未指定正确的间隔时间");
         }
     }
     else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.JustOnce)
     {
         scheMod.ExecuteTime = ExecuteTime_T1.Text;
         if (DataConvert.CDate(scheMod.ExecuteTime) < DateTime.Now)
         {
             function.WriteErrMsg("执行时间无效");
         }
     }
     else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.EveryDay)
     {
         scheMod.ExecuteTime = ExecuteTime_T2.Text;
     }
     else if (scheMod.ExecuteType == (int)M_Content_ScheTask.ExecuteTypeEnum.EveryMonth)
     {
         scheMod.ExecuteTime = ExecuteTime_T1.Text;
     }
     if (Mid > 0)
     {
         scheBll.Update(scheMod);
     }
     else
     {
         M_AdminInfo adminMod = B_Admin.GetLogin();
         scheMod.CDate   = DateTime.Now;
         scheMod.AdminID = adminMod.AdminId;
         scheMod.ID      = scheBll.Add(scheMod);
     }
     TaskCenter.AddTask(scheMod);
     function.WriteSuccessMsg("操作成功", "Default.aspx");
 }
Exemple #12
0
        protected void EBtnSubmit_Click(object sender, EventArgs e)//添加文章
        {
            int nodeID = Convert.ToInt32(nodeDP.SelectedValue);

            if (nodeID < 0)
            {
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('请先选择栏目!!!');", true);
                return;
            }
            if (!AuthCheck(nodeID))
            {
                function.WriteErrMsg("你没有对该栏目的添加权限!!!");
            }
            M_CommonData CData = new M_CommonData();
            DataTable    dt    = this.bfield.SelByModelID(modelID);
            DataTable    table = new DataTable();

            table.Columns.Add(new DataColumn("FieldName", typeof(string)));
            table.Columns.Add(new DataColumn("FieldType", typeof(string)));
            table.Columns.Add(new DataColumn("FieldValue", typeof(string)));
            //手动完成赋值

            string[] fieldArr = { "Secret", "Urgency", "Importance" };
            for (int i = 0; i < fieldArr.Length; i++)
            {
                DataRow dr = table.NewRow();
                dr["FieldName"]  = fieldArr[i];
                dr["FieldType"]  = "TextType";
                dr["FieldValue"] = Request.Form[fieldArr[i]];
                table.Rows.Add(dr);
            }
            //内容
            DataRow dr2 = table.NewRow();

            dr2["FieldName"]  = "content";
            dr2["FieldType"]  = "MultipleHtmlType";
            dr2["FieldValue"] = content.Text;
            table.Rows.Add(dr2);
            //所属部门
            dr2 = table.NewRow();
            dr2["FieldName"]  = "UserGroupT";
            dr2["FieldType"]  = "TextType";
            dr2["FieldValue"] = strBll.SelNameByUid(buser.GetLogin().UserID);
            table.Rows.Add(dr2);
            //附件
            dr2 = table.NewRow();
            dr2["FieldName"]  = "Attach";
            dr2["FieldType"]  = "TextType";
            dr2["FieldValue"] = SaveFile();
            table.Rows.Add(dr2);

            //将无法获取的值,手动写入table中
            if (!string.IsNullOrEmpty(Request.QueryString["Gid"]))
            {
                CData = bll.GetCommonData(Convert.ToInt32(Request.QueryString["Gid"]));
            }

            CData.NodeID    = nodeID;
            CData.ModelID   = modelID;
            CData.TableName = this.bmode.GetModelById(modelID).TableName;
            CData.Title     = Title_T.Text.Trim();
            //判断是否使用文件流程
            CData.Status     = 99;
            CData.EliteLevel = 0;
            CData.InfoID     = "";
            CData.SpecialID  = "";
            //CData.CreateTime = "";
            CData.UpDateType = 2;
            CData.UpDateTime = DateTime.Now;
            string Keyword = this.TxtTagKey.Text.Trim().Replace(" ", "|");

            ;
            CData.TagKey       = Keyword;
            CData.Titlecolor   = "";
            CData.Template     = "";
            CData.CreateTime   = DataConvert.CDate(CreateTime.Text);
            CData.ProWeek      = 0;
            CData.Pronum       = 0;
            CData.BidType      = 0;
            CData.IsBid        = (CData.BidType > 0) ? 1 : 0;
            CData.BidMoney     = DataConverter.CDouble(0);
            CData.DefaultSkins = 0;
            CData.FirstNodeID  = GetFriestNode(nodeID);
            CData.TitleStyle   = Request.Form["ThreadStyle"];
            CData.ParentTree   = GetParentTree(nodeID);     //父级别树
            CData.TopImg       = Request.Form["selectpic"]; //首页图片
            CData.PdfLink      = "";
            CData.Subtitle     = "";
            CData.PYtitle      = "";
            int newID = 0;

            if (string.IsNullOrEmpty(Request.QueryString["Gid"]))//新增
            {
                CData.Inputer = buser.GetLogin().UserName;
                CData.Hits    = 0;
                newID         = this.bll.AddContent(table, CData); //插入信息给两个表,主表和从表:CData-主表的模型,table-从表

                B_KeyWord kll = new B_KeyWord();                   //添加关键词
                if (!string.IsNullOrEmpty(Keyword))
                {
                    string[] arrKey = Keyword.Split(new char[] { '|' }, StringSplitOptions.RemoveEmptyEntries);
                    for (int tt = 0; tt < arrKey.Length; tt++)
                    {
                        if (kll.IsExist(arrKey[tt]))
                        {
                            M_KeyWord kinfo = kll.GetKeyByName(arrKey[tt]);
                            kinfo.QuoteTimes++;
                            kinfo.LastUseTime = DateTime.Now;
                            if (string.IsNullOrEmpty(kinfo.ArrGeneralID))
                            {
                                kinfo.ArrGeneralID = newID.ToString() + ",";
                            }
                            else
                            {
                                kinfo.ArrGeneralID = kinfo.ArrGeneralID + newID.ToString() + ",";
                            }
                            kll.Update(kinfo);
                        }
                        else
                        {
                            M_KeyWord kinfo1 = new M_KeyWord();
                            kinfo1.KeyWordID    = 0;
                            kinfo1.KeywordText  = arrKey[tt];
                            kinfo1.KeywordType  = 1;
                            kinfo1.LastUseTime  = DateTime.Now;
                            kinfo1.Hits         = 0;
                            kinfo1.Priority     = 10;
                            kinfo1.QuoteTimes   = 1;
                            kinfo1.ArrGeneralID = "," + newID.ToString() + ",";
                            kll.Add(kinfo1);
                        }
                    }
                }
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('添加成功');window.location.href='ContentManage.aspx?NodeID=" + nodeID + "'", true);
            }
            else //修改
            {
                newID = CData.GeneralID;
                bll.UpdateContent(table, CData);
                Page.ClientScript.RegisterStartupScript(this.GetType(), "", "alert('修改成功');window.location.href='ContentManage.aspx?NodeID=" + nodeID + "'", true);
            }
        }
        public string GetHtml(DataTable dt, DateTime st)
        {
            DateTime it   = DateTime.Now;
            DateTime ot   = DateTime.Now;
            string   html = "<td class='datas'><div class='tdTitle' style='width:100px;'>" + st.Day + "</div>";

            html += "<div style='height:80px;'>";
            if (st <= DateTime.Now)
            {
                AllCount++;//班次+1
                string div = "<div >@signin - @signout</br>@state</div>";
                foreach (DataRow dr in dt.Rows)
                {
                    if (dr["ZType"].ToString().Equals("0"))
                    {
                        AttendCount++;//签到
                        it = DataConvert.CDate(dr["CDate"]);
                        if (dr["State"].ToString().Equals("1"))
                        {//迟到
                            Late++;
                            div = div.Replace("@signin", "<span style='color:red;'>" + it.ToShortTimeString() + "</span> 签到");
                        }
                        else
                        {
                            div = div.Replace("@signin", it.ToShortTimeString() + " 签到");
                        }
                    }
                    if (dr["ZType"].ToString().Equals("1"))
                    {
                        ot = DataConvert.CDate(dr["CDate"]);
                        if (dr["State"].ToString().Equals("2"))
                        {
                            LeaveEarly++;
                            div = div.Replace("@signout", "<span style='color:red;'>" + ot.ToShortTimeString() + "</span> 签退");
                        }
                        else
                        {
                            div = div.Replace("@signout", ot.ToShortTimeString() + " 签退");
                        }
                    }
                }
                if (st.Date == DateTime.Now.Date && div.Contains("@signout"))
                {
                    div = div.Replace("@state", "");
                }
                if (div.Contains("@signin"))//未签到
                {
                    Lack++;
                    div = "<span style='color:red;'>(无签到信息)</span>";
                }
                if (div.Contains("@signout"))
                {//未签退
                    Lack++;
                    div = div.Replace("@signout", "<span style='color:red;'>未签退</span>")
                          .Replace("@state", "<span style='color:red;'>(无效考勤)</span>");
                }
                double time = (ot - it).TotalHours;
                div   = div.Replace("@state", "(共" + time.ToString("0.0") + "个小时)");
                html += div;
            }
            html += "</div></td>";
            return(html);
        }
Exemple #14
0
        private void MyBind()
        {
            int guestnum = 0, totalnum = 0;

            if (!string.IsNullOrEmpty(ids))
            {
                M_Cart        cartMod  = cartBll.SelReturnModel(DataConvert.CLng(ids.Split(',')[0]));
                M_Cart_Travel traveMod = JsonConvert.DeserializeObject <M_Cart_Travel>(cartMod.Additional);
                Pros                = JsonConvert.SerializeObject(traveMod.ProList);
                Guest_Hid2.Value    = JsonConvert.SerializeObject(traveMod.Guest);
                Contract_Hid2.Value = JsonConvert.SerializeObject(traveMod.Contract);
                guestnum            = traveMod.Guest.Count;
            }
            //绑定显示商品
            if (!string.IsNullOrEmpty(Pros))
            {
                JArray    proArr      = (JArray)JsonConvert.DeserializeObject(Pros);
                DataTable proDT       = CreateProDT();//仅用于展示,不参与逻辑
                double    proAllMoney = 0;
                for (int i = 0; i < proArr.Count; i++)
                {
                    DataRow   proDR  = proDT.NewRow();
                    M_Product proMod = proBll.GetproductByid(Convert.ToInt32(proArr[i]["ProID"].ToString()));
                    switch ((M_Product.ClassType)proMod.ProClass)
                    {
                    case M_Product.ClassType.LY:
                    case M_Product.ClassType.JD:
                        break;

                    default:
                        function.WriteErrMsg("[" + proMod.Proname + "]商品类型不正确");
                        break;
                    }
                    if (proMod.ID > 0)
                    {
                        proDR["ID"]      = proMod.ID;
                        proDR["ProName"] = proMod.Proname;
                        proDR["Pronum"]  = proArr[i]["Pronum"].ToString();
                        //----如果传递了编号,则读取多价格信息
                        double  price   = proMod.LinPrice;
                        DataRow priceDR = proBll.GetPriceByCode(proArr[i]["code"], proMod.Wholesalesinfo, ref price);
                        proDR["Price"] = price;
                        if (priceDR != null)
                        {
                            proDR["ProName"] += "(" + priceDR["Proname"] + ")";
                        }
                        //----
                        proDR["AllMoney"] = Convert.ToInt32(proDR["Pronum"]) * Convert.ToDouble(proDR["Price"]);
                        proDR["GoDate"]   = DataConvert.CDate(proArr[i]["GoDate"]);
                        proDR["Remind"]   = HttpUtility.UrlDecode(proArr[i]["Remind"].ToString());
                        proDT.Rows.Add(proDR);
                        proAllMoney += Convert.ToDouble(proDR["AllMoney"]);
                        totalnum    += Convert.ToInt32(proDR["Pronum"]);
                    }
                }
                AllMoney_sp.InnerText  = proAllMoney.ToString("0.00");
                ProList_RPT.DataSource = proDT;
                ProList_RPT.DataBind();
                function.Script(this, "AddGuests(" + (string.IsNullOrEmpty(ids) ? totalnum : guestnum) + ");");
            }
        }
Exemple #15
0
        /// <summary>
        /// 根据起始和结束时间,自动计算出难度系数
        /// 1,忽略教师未批阅的
        /// 2,如果本周未有学生考试则不更新
        /// 3,(计算公式是否应该改为难度偏移计算,以更准确)
        /// </summary>
        public void CountDiffcult(string stime, string etime)
        {
            string where = "WHERE IsRight>0 AND QID>0 ";
            if (!string.IsNullOrEmpty(stime))
            {
                where += " AND CDate>=@stime";
            }
            if (!string.IsNullOrEmpty(etime))
            {
                where += " AND CDate<=@etime";
            }
            SqlParameter[] sp  = new SqlParameter[] { new SqlParameter("stime", DataConvert.CDate(stime)), new SqlParameter("etime", DataConvert.CDate(etime)) };
            string         sql = "SELECT Qid,"
                                 + "(SELECT COUNT(*)AS Num FROM ZL_Exam_Answer WHERE QID=A.Qid AND IsRight=1)as rightNum,"
                                 + "(SELECT COUNT(*)AS Num FROM ZL_Exam_Answer WHERE QID=A.Qid AND IsRight=2)as wrongNum "
                                 + "FROM ZL_Exam_Answer A " + where + " GROUP BY QID";
            DataTable dt = SqlHelper.ExecuteTable(sql, sp);

            foreach (DataRow dr in dt.Rows)
            {
                double diff  = DataConvert.CDouble(dr["rightNum"]) / (DataConvert.CDouble(dr["wrongNum"]) + DataConvert.CDouble(dr["rightNum"]));
                string upsql = "UPDATE " + strTableName + " SET p_Difficulty=" + diff + " WHERE p_id=" + dr["QID"];
                SqlHelper.ExecuteSql(upsql);
            }
        }
        public MvcHtmlString GetRUser(DataRow dr)
        {
            string tlp = "<span class='uname' title='回复时间:{0}'><span class='fa fa-comment'></span><a href='{1}'>{2}</a>"
                         + "<span class='pull-right remind_g_x'>{3}</span></span>";
            bool isnull = dr["R_CUser"] == DBNull.Value;
            int  rcuser = isnull ? DataConvert.CLng(dr["CUser"]) : DataConvert.CLng(dr["R_CUser"]);

            string   rcuname = isnull ? function.GetStr(barBll.GetUName(dr["HoneyName"], dr["CUName"]), 6) : function.GetStr(dr["R_CUName"], 6);
            string   url     = rcuser == 0 ? "javascript:;" : "PostSearch?uid=" + rcuser;
            DateTime cdate   = isnull ? Convert.ToDateTime(dr["CDate"]) : Convert.ToDateTime(dr["R_CDate"]);
            string   rdate   = cdate.ToString("yyyy-MM-dd HH:mm");
            string   rdate2  = isnull ? DataConvert.CDate(dr["CDate"]).ToString("yyyy/MM/dd HH:mm") : DataConvert.CDate(dr["R_CDate"]).ToString("yyyy/MM/dd HH:mm");

            return(MvcHtmlString.Create(string.Format(tlp, rdate, url, rcuname, rdate2)));
        }
Exemple #17
0
        public static void OrderFinish(M_OrderList mod, M_Payment pinfo)
        {
            B_OrderList orderBll = new B_OrderList();
            B_CartPro   cpBll    = new B_CartPro();
            B_User      buser    = new B_User();

            //B_User_Card cdBll = new B_User_Card();
            //B_User_StoreUser suBll = new B_User_StoreUser();
            switch (mod.Ordertype)
            {
            case (int)M_OrderList.OrderEnum.Domain:
            {
                B_Shop_MoneyRegular regBll = new B_Shop_MoneyRegular();
                //M_User_StoreUser suMod = suBll.SelReturnModel(Convert.ToInt32(mod.Receiver));
                //M_User_Card cdMod = cdBll.SelModelByUid(suMod.ID);
                //cdMod.CardPurse += mod.Ordersamount;
                //cdBll.UpdateByID(cdMod);
                int regular = DataConvert.CLng(mod.Money_code);
                M_Shop_MoneyRegular regMod = null;
                if (regular > 0)
                {
                    regMod = regBll.SelReturnModel(regular);
                }
                else
                {
                    regMod     = new M_Shop_MoneyRegular();
                    regMod.Min = mod.Ordersamount;
                }
                buser.AddMoney(DataConvert.CLng(mod.Receiver), regMod.Min + regMod.Purse, M_UserExpHis.SType.Purse, "充值,订单号:" + mod.OrderNo + ",充值:" + regMod.Min + ",赠送:" + regMod.Purse);
                if (regMod.Point > 0)
                {
                    buser.AddMoney(DataConvert.CLng(mod.Receiver), regMod.Point, M_UserExpHis.SType.Point, "充值赠送积分,订单号:" + mod.OrderNo);
                }
            }
            break;

            case (int)M_OrderList.OrderEnum.Cloud:    //通过微信下的预约订单
            {
                //付款后增加预约记录,由收银员完成开单
                //{ id: 0, proid: 0, proname: "", empid: 0, empname: "" };
                DataTable cpDT = cpBll.SelByOrderID(mod.id);
                List <M_Ex_PreOrder_Item> itemList = new List <M_Ex_PreOrder_Item>();
                foreach (DataRow dr in cpDT.Rows)
                {
                    M_Ex_PreOrder_Item model = new M_Ex_PreOrder_Item();
                    model.proid   = Convert.ToInt32(dr["ProID"]);
                    model.proname = DataConvert.CStr(dr["Proname"]);
                    model.empid   = DataConvert.CLng(dr["code"]);
                    model.empname = DataConvert.CStr(dr["Proinfo"]);
                    itemList.Add(model);
                }
                B_Ex_PreOrder poBll = new B_Ex_PreOrder();
                M_Ex_PreOrder poMod = new M_Ex_PreOrder();
                poMod.ClientMobile = mod.Mobile.ToString();
                poMod.ClientName   = mod.Rename;
                poMod.ClientDate   = DataConvert.CDate(mod.ExpTime);
                poMod.ClientNeed   = JsonConvert.SerializeObject(itemList);
                poMod.Remark       = mod.Ordermessage;
                poMod.Source       = "微信";
                poMod.OrderID      = mod.id;
                poMod.ID           = poBll.Insert(poMod);
            }
            break;

            default:    //普通订单,计算提成,赠送积分
            {
                B_Shop_Bonus bnBll = new B_Shop_Bonus();
                DataTable    cpDT  = cpBll.SelByOrderID(mod.id);
                foreach (DataRow dr in cpDT.Rows)
                {
                    int    code     = DataConvert.CLng(dr["code"]);
                    int    proid    = DataConvert.CLng(dr["Proid"]);
                    double allMoney = DataConvert.CDouble(dr["AllMoney"]);
                    if (code < 1)
                    {
                        continue;
                    }
                    #region 技师计算提成
                    //技师绑定了何种分成方案,
                    M_UserInfo   jsMod = buser.SelReturnModel(code);
                    M_Shop_Bonus bnMod = null;
                    if (jsMod.VIP < 1)
                    {
                        bnMod = bnBll.SelModelByDefault();
                    }
                    else
                    {
                        bnMod = bnBll.SelReturnModel(jsMod.VIP);
                    }
                    //无提成方案则不计算
                    if (bnMod != null)
                    {
                        //根据商品ID,看有无匹配的子数据类型
                        M_Shop_Bonus bnMod2 = bnBll.SelModelByProID(bnMod.ID, proid);
                        if (bnMod2 != null)
                        {
                            bnMod = bnMod2;
                        }
                        //-------计算提成,写入CartPro中
                        double bonus = 0;
                        switch (bnMod.BonusType)
                        {
                        case 0:
                            bonus = allMoney * (DataConvert.CDouble(bnMod.BonusValue1) * 0.01);
                            break;

                        case 1:
                            bonus = DataConvert.CDouble(bnMod.BonusValue1);
                            break;
                        }
                        DBCenter.UpdateSQL("ZL_CartPro", "AllMoney_Json='" + bonus.ToString("F2") + "'", "ID=" + dr["ID"]);
                    }
                    #endregion
                }
                //-------赠送积分,默认每一元送一分
                buser.AddMoney(DataConvert.CLng(mod.Receiver), mod.Receivablesamount, M_UserExpHis.SType.Point, "订单[" + mod.id + "]赠送积分");
            }
            break;
            }
        }
Exemple #18
0
 /// <summary>
 /// 以标准格式输出时间,主用于前端
 /// </summary>
 public static string ToDate(object o, string format = "yyyy年MM月dd日 HH:mm")
 {
     return(DataConvert.CDate(o).ToString(format));
 }