Exemplo n.º 1
0
    protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
    {
        string strContent = Request.Form["t_contents"].ToString();

        if (strContent == "")
        {
            CommonFunction.Alert(Literal1, "文章内容不能为空");
            return;
        }
        ServiceItem item = new ServiceItem();

        item.I_Title   = txtTitle.Text;
        item.I_Content = strContent;
        item.I_SID     = ((UserInfo)Session["ServiceUser"]).U_SID;
        item.I_MID     = ViewState["mid"].ToString();
        if (ViewState["strAction"].ToString() == "add")
        {
            ServiceItemService.Insert_ServiceItem(item);
        }
        else if (ViewState["strAction"].ToString() == "update")
        {
            item.I_ID = Convert.ToInt32(ViewState["iid"]);
            ServiceItemService.Update_ServiceItem(item);
        }
        CommonFunction.AlertAndRedirect(Literal1, "操作成功", "blank.aspx");
    }
Exemplo n.º 2
0
 protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "delRecord")
     {
         int iid = Convert.ToInt32(e.CommandArgument);
         ServiceItemService.Delete_ServiceItem(iid);
         binddata(((UserInfo)Session["ServiceUser"]).U_SID, Convert.ToInt32(ViewState["mid"]));
     }
 }
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CommonFunction.isSelectedService();
         int itemid = Convert.ToInt32(Request.QueryString["itemid"]);
         dt    = ServiceItemService.Get_ServiceItemView(itemid);
         Title = dt.Rows[0]["i_Title"] + "-" + ((ServiceInfo)Session["serviceinfo"]).S_Name + "门户网站";
     }
 }
Exemplo n.º 4
0
    void binddata(int sid, int mid)
    {
        DataTable dt = ServiceItemService.Get_ServiceItemListByParentItem(sid, mid);

        AspNetPager1.RecordCount = dt.Rows.Count;
        if (dt.Rows.Count >= 0)
        {
            PagedDataSource ps = new PagedDataSource();
            DataView        dv = new DataView(dt);
            ps.DataSource             = dv;
            ps.AllowPaging            = true;
            ps.CurrentPageIndex       = AspNetPager1.CurrentPageIndex - 1;
            ps.PageSize               = AspNetPager1.PageSize;
            rptServiceItem.DataSource = ps;
            rptServiceItem.DataBind();
        }
    }
Exemplo n.º 5
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         CommonFunction.isLoginCheck();
         int iid = Convert.ToInt32(Request.QueryString["iid"]);
         int mid = Convert.ToInt32(Request.QueryString["mid"]);
         ViewState["iid"] = iid;
         ViewState["mid"] = mid;
         string strAction = Request.QueryString["action"];
         ViewState["strAction"] = strAction;
         if (strAction == "update")
         {
             DataTable dt = ServiceItemService.Get_ServiceItem(iid);
             if (dt != null && dt.Rows.Count > 0)
             {
                 txtTitle.Text           = dt.Rows[0]["I_Title"].ToString();
                 ViewState["strContent"] = dt.Rows[0]["I_Content"].ToString();
             }
         }
     }
 }
Exemplo n.º 6
0
        public static ResponseObject <int> FindITSupporterByRequestId(int requestId)
        {
            try
            {
                var requestService     = new RequestService();
                var itSupporterService = new ITSupporterService();
                var agencyService      = new AgencyService();
                var comService         = new CompanyService();
                var skillService       = new SkillService();
                var serviceItemService = new ServiceItemService();

                var request            = requestService.GetAll().SingleOrDefault(p => p.RequestId == requestId);
                var serviceItemId      = request.ServiceItemId;
                var serviceITSupportId = serviceItemService.GetAll().SingleOrDefault(p => p.ServiceItemId == serviceItemId).ServiceITSupportId;
                var skills             = skillService.GetAll().Where(a => a.ServiceITSupportId == serviceITSupportId);
                var agency             = agencyService.GetAll().SingleOrDefault(p => p.AgencyId == request.AgencyId);
                var company            = comService.GetAll().SingleOrDefault(p => p.CompanyId == agency.CompanyId);;
                List <RenderITSupporterListWithWeight> itSupporterListWithWeights = new List <RenderITSupporterListWithWeight>();
                foreach (var item in skills)
                {
                    var itSupporter = itSupporterService.GetAll().SingleOrDefault(p => p.ITSupporterId == item.ITSupporterId && p.IsBusy == false && p.IsOnline == true);
                    if (itSupporter != null)
                    {
                        double weightForITSupporter = 0;
                        var    a = requestService.GetAll().Where(p => p.CurrentITSupporter_Id == itSupporter.ITSupporterId && p.AgencyId == request.AgencyId).Count();
                        var    weightForITSupporterFamiliarWithAgency = a * ((company.PercentForITSupporterFamiliarWithAgency != null && company.PercentForITSupporterFamiliarWithAgency.Value != 0) ? company.PercentForITSupporterFamiliarWithAgency.Value : 30);
                        var    weightForITSupporterRate = (itSupporter.RatingAVG ?? 0) * ((company.PercentForITSupporterRate != null && company.PercentForITSupporterRate.Value != 0) ? company.PercentForITSupporterRate.Value : 40);
                        var    weightForITSupporterExp  = (item.MonthExperience ?? 0) * ((company.PercentForITSupporterExp != null && company.PercentForITSupporterExp.Value != 0) ? company.PercentForITSupporterExp.Value : 30);
                        weightForITSupporter = weightForITSupporterFamiliarWithAgency + weightForITSupporterRate + weightForITSupporterExp;
                        var renderITSupporterListWithWeight = new RenderITSupporterListWithWeight()
                        {
                            ITSupporterId         = itSupporter.ITSupporterId,
                            ITSupporterName       = itSupporter.ITSupporterName,
                            ITSupporterListWeight = weightForITSupporter,
                            TimesReject           = 0
                        };
                        itSupporterListWithWeights.Add(renderITSupporterListWithWeight);
                    }
                }
                // Add redis
                itSupporterListWithWeights = itSupporterListWithWeights.OrderByDescending(p => p.ITSupporterListWeight).ToList();
                //MemoryCacher memoryCacher = new MemoryCacher();
                //memoryCacher.Add("ITSupporterListWithWeights", itSupporterListWithWeights, DateTimeOffset.UtcNow.AddHours(1));
                Queue <RenderITSupporterListWithWeight> itSupporterListWithWeightQueue = new Queue <RenderITSupporterListWithWeight>(itSupporterListWithWeights);

                RedisTools redisTools = new RedisTools();
                redisTools.Save("ITSupporterListWithWeights", itSupporterListWithWeightQueue);
                // Get first
                var itSupporterNameFound = itSupporterListWithWeights.FirstOrDefault().ITSupporterName;
                int itSupporterIdFound   = itSupporterListWithWeights.FirstOrDefault().ITSupporterId;
                if (itSupporterIdFound > 0)
                {
                    return(new ResponseObject <int> {
                        IsError = false, SuccessMessage = $"Tìm được Hero {itSupporterNameFound}! Vùi lòng đợi xác nhận", ObjReturn = itSupporterIdFound
                    });
                }
                return(new ResponseObject <int> {
                    IsError = true, WarningMessage = "Chưa tìm được Hero nào thích hợp!"
                });
            }
            catch (Exception ex)
            {
                return(new ResponseObject <int> {
                    IsError = true, WarningMessage = "Chưa tìm được Hero nào thích hợp!", ErrorMessage = ex.ToString()
                });
            }
        }
Exemplo n.º 7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.Title = ((ServiceInfo)Session["serviceinfo"]).S_Name + "门户网站首页";

            //友情链接
            DataTable dtlink = new DataTable();
            dtlink = MyLinkService.Get_AllLinks(((ServiceInfo)Session["serviceinfo"]).S_ID);
            if (dtlink.Rows.Count > 0)
            {
                rptMyLink.DataSource = dtlink;
                rptMyLink.DataBind();
            }


            //公告公示
            DataTable dtnotice = new DataTable();
            dtnotice = ServiceNewService.Get_AllNews(((ServiceInfo)Session["serviceinfo"]).S_ID, 10, 2);
            if (dtnotice.Rows.Count > 0)
            {
                rptSiteNotice.DataSource = dtnotice;
                rptSiteNotice.DataBind();
            }


            //管理制度
            DataTable dtGLZD = new DataTable();
            dtGLZD = ServiceNewService.Get_AllNews(((ServiceInfo)Session["serviceinfo"]).S_ID, 6, 3);
            if (dtGLZD.Rows.Count > 0)
            {
                rptGLZD.DataSource = dtGLZD;
                rptGLZD.DataBind();
            }


            //ISO国际标准化认证

            dtISO = new DataTable();

            dtISO = ServiceNewService.Get_AllNews(((ServiceInfo)Session["serviceinfo"]).S_ID, 3, 9);
            if (dtISO.Rows.Count > 0)
            {
                rptISO.DataSource = dtISO;
                rptISO.DataBind();
            }



            //驿站新闻
            DataTable dtYzNews = new DataTable();
            dtYzNews = ServiceNewService.Get_AllNews(((ServiceInfo)Session["serviceinfo"]).S_ID, 5, 1);
            if (dtYzNews.Rows.Count > 0)
            {
                rptYzNews.DataSource = dtYzNews;
                rptYzNews.DataBind();
            }


            //图片新闻

            DataTable dtPicNews = new DataTable();
            dtPicNews = ServiceNewService.Get_AllNews(((ServiceInfo)Session["serviceinfo"]).S_ID, 5, 6);
            if (dtPicNews.Rows.Count > 0)
            {
                rptPicNews.DataSource = dtPicNews;

                rptPicNews.DataBind();
                ViewState["rptPicNews"] = dtPicNews;
            }



            /**
             * 餐厅服务
             */
            //经营品种

            DataTable dtdiv1 = new DataTable();
            dtdiv1 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(41, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dtdiv1.Rows.Count > 0)
            {
                rptitem1div1.DataSource = dtdiv1;
                rptitem1div1.DataBind();
            }

            //收费标准

            DataTable dtdiv2 = new DataTable();

            dtdiv2 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(42, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dtdiv2.Rows.Count > 0)
            {
                rptitem1div2.DataSource = dtdiv2;
                rptitem1div2.DataBind();
            }

            //提供餐别

            DataTable dtdiv3 = new DataTable();
            dtdiv3 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(43, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dtdiv3.Rows.Count > 0)
            {
                rptitem1div3.DataSource = dtdiv3;
                rptitem1div3.DataBind();
            }

            //服务承诺

            DataTable dtdiv4 = new DataTable();
            dtdiv4 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(44, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dtdiv4.Rows.Count > 0)
            {
                rptitem1div4.DataSource = dtdiv4;
                rptitem1div4.DataBind();
            }

            //自助餐标准

            DataTable dtdiv5 = new DataTable();
            dtdiv5 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(45, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dtdiv5.Rows.Count > 0)
            {
                rptitem1div5.DataSource = dtdiv5;
                rptitem1div5.DataBind();
            }

            //会议培训用餐

            DataTable dtdiv6 = new DataTable();
            dtdiv6 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(46, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dtdiv6.Rows.Count > 0)
            {
                rptitem1div6.DataSource = dtdiv6;
                rptitem1div6.DataBind();
            }

            //特色菜品

            DataTable dtdiv7 = new DataTable();
            dtdiv7 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(47, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dtdiv7.Rows.Count > 0)
            {
                rptitem1div7.DataSource = dtdiv7;
                rptitem1div7.DataBind();
            }



            /**
             * 超市服务
             */
            //经营品种
            DataTable dt2div1 = new DataTable();
            dt2div1 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(28, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt2div1.Rows.Count > 0)
            {
                rptitem2div1.DataSource = dt2div1;

                rptitem2div1.DataBind();
            }

            //特产专柜

            DataTable dt2div2 = new DataTable();
            dt2div2 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(29, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt2div2.Rows.Count > 0)
            {
                rptitem2div2.DataSource = dt2div2;
                rptitem2div2.DataBind();
            }

            //急救药品

            DataTable dt2div3 = new DataTable();
            dt2div3 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(30, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt2div3.Rows.Count > 0)
            {
                rptitem2div3.DataSource = dt2div3;
                rptitem2div3.DataBind();
            }

            //工艺品

            DataTable dt2div4 = new DataTable();

            dt2div4 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(31, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt2div4.Rows.Count > 0)
            {
                rptitem2div4.DataSource = dt2div4;
                rptitem2div4.DataBind();
            }



            /**
             * 客房服务
             */
            //供房类型

            DataTable dt3div1 = new DataTable();
            dt3div1 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(38, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt3div1.Rows.Count > 0)
            {
                rptitem3div1.DataSource = dt3div1;
                rptitem3div1.DataBind();
            }

            //收费标准
            DataTable dt3div2 = new DataTable();
            dt3div2 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(39, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt3div2.Rows.Count > 0)
            {
                rptitem3div2.DataSource = dt3div2;
                rptitem3div2.DataBind();
            }

            //供房数量

            DataTable dt3div3 = new DataTable();

            dt3div3 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(40, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dtdiv3.Rows.Count > 0)
            {
                rptitem3div3.DataSource = dt3div3;
                rptitem3div3.DataBind();
            }



            /**
             * 加油服务
             */
            //供应油品

            DataTable dt4div1 = new DataTable();
            dt4div1 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(35, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt4div1.Rows.Count > 0)
            {
                rptitem4div1.DataSource = dt4div1;
                rptitem4div1.DataBind();
            }

            //油品价格
            DataTable dt4div2 = new DataTable();

            dt4div2 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(36, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt4div2.Rows.Count > 0)
            {
                rptitem4div2.DataSource = dt4div2;
                rptitem4div2.DataBind();
            }

            //加油机数量
            DataTable dt4div3 = new DataTable();
            dt4div3 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(37, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt4div3.Rows.Count > 0)
            {
                rptitem4div3.DataSource = dt4div3;
                rptitem4div3.DataBind();
            }



            /**
             * 汽修服务
             */
            //维修范围
            DataTable dt5div1 = new DataTable();

            dt5div1 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(32, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt5div1.Rows.Count > 0)
            {
                rptitem5div1.DataSource = dt5div1;
                rptitem5div1.DataBind();
            }

            //收费标准
            DataTable dt5div2 = new DataTable();

            dt5div2 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(33, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt5div2.Rows.Count > 0)
            {
                rptitem5div2.DataSource = dt5div2;
                rptitem5div2.DataBind();
            }

            //资质类别
            DataTable dt5div3 = new DataTable();

            dt5div3 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(34, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);

            if (dt5div3.Rows.Count > 0)
            {
                rptitem5div3.DataSource = dt5div3;
                rptitem5div3.DataBind();
            }



            /**
             * 停车服务
             */
            //停车分区
            DataTable dt6div1 = new DataTable();

            dt6div1 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(48, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt6div1.Rows.Count > 0)
            {
                rptitem6div1.DataSource = dt6div1;
                rptitem6div1.DataBind();
            }

            //停车位数量
            DataTable dt6div2 = new DataTable();

            dt6div2 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(49, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt6div2.Rows.Count > 0)
            {
                rptitem6div2.DataSource = dt6div2;
                rptitem6div2.DataBind();
            }

            //危险品专属区
            DataTable dt6div3 = new DataTable();

            dt6div3 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(50, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt6div3.Rows.Count > 0)
            {
                rptitem6div3.DataSource = dt6div3;
                rptitem6div3.DataBind();
            }

            //降温加水服务

            DataTable dt6div4 = new DataTable();
            dt6div4 = ServiceItemService.Get_ServiceItemListByMIdAdnSId(51, ((ServiceInfo)Session["serviceinfo"]).S_ID, 7);
            if (dt6div4.Rows.Count > 0)
            {
                rptitem6div4.DataSource = dt6div4;
                rptitem6div4.DataBind();
            }
        }
    }