Пример #1
0
 protected override void BasePage_Load(AutoRepair.Entity.tb_UsersEntity user)
 {
     if (user != null)
     {
         userId = user.UserId;
         AutoRepair.Entity.tb_LocationEntity locationModel = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(user.LocationId);
         if (locationModel != null)
         {
             string   path = locationModel.LocationPath;
             string[] arr  = path.Split('/');
             if (arr.Count() == 6)
             {
                 mark        = 1;
                 idCard      = user.IdCard;
                 realName    = user.RealName;
                 mail        = user.Mail;
                 locationId  = Convert.ToInt32(arr[2]);
                 locationId2 = Convert.ToInt32(arr[3]);
                 locationId3 = Convert.ToInt32(arr[4]);
             }
         }
         //绑定数据
         ddlProvince.DataSource     = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetProvinceByCache();
         ddlProvince.DataTextField  = "LocationName";
         ddlProvince.DataValueField = "LocationId";
         ddlProvince.DataBind();
     }
     else
     {
         Response.Redirect("Registered.aspx");
     }
 }
Пример #2
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            //省
            List <AutoRepair.Entity.tb_LocationEntity> list = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetProvinceByCache() as List <AutoRepair.Entity.tb_LocationEntity>;
            list.RemoveAt(0);
            ddlProvince.DataSource     = list;
            ddlProvince.DataTextField  = "LocationName";
            ddlProvince.DataValueField = "LocationId";
            ddlProvince.DataBind();
            //市
            List <AutoRepair.Entity.tb_LocationEntity> list2 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCityListCache(list[0].LocationId);
            ddlCity.DataSource     = list2;
            ddlCity.DataTextField  = "LocationName";
            ddlCity.DataValueField = "LocationId";
            ddlCity.DataBind();
            txt_hid.Text = ddlCity.SelectedValue;
            //县
            List <AutoRepair.Entity.tb_LocationEntity> list3 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCountyListCache(list2[0].LocationId);
            AutoRepair.Entity.tb_LocationEntity        model = new AutoRepair.Entity.tb_LocationEntity();
            model.LocationName = "--全选--";
            model.LocationId   = -1;
            list3.Insert(0, model);
            ddlCounty.DataSource     = list3;
            ddlCounty.DataTextField  = "LocationName";
            ddlCounty.DataValueField = "LocationId";
            ddlCounty.DataBind();
            qx.Text = "-1";

            BindData();
        }
    }
Пример #3
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (unitID != "")
         {
             AutoRepair.Entity.T_RepairUnitEntity ds = AutoRepair.BLL.T_RepairUnitBLL.GetInstance().GetAdminSingle(unitID);
             if (ds != null)
             {
                 AutoRepair.Entity.tb_LocationEntity model = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(int.Parse((ds.Area == "") ? "0" : ds.Area));
                 //unitID = ds.UnitID.ToString();
                 UnitName   = ds.UnitName.ToString();
                 LinkMan    = ds.LinkMan.ToString();
                 Phone      = ds.Phone.ToString();
                 Address    = ds.Address.ToString();
                 TaxNumber  = ds.TaxNumber.ToString();
                 ICNumber   = ds.ICNumber.ToString();
                 AdminPwd   = ds.AdminPwd.ToString();
                 Remark     = ds.Remark.ToString();
                 Area       = model.LocationName.ToString();
                 UnitState  = ds.UnitState.ToString();
                 UsbKey     = ds.UsbKey.ToString();
                 AuthToken  = ds.AuthToken.ToString();
                 Crerating  = ds.Crerating.ToString();
                 Categories = ds.Categories.ToString();
                 Range      = ds.Range.ToString();
             }
         }
     }
 }
Пример #4
0
 protected static string value = string.Empty; //数据
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (identity != null)
         {
             #region 绑定企业信息
             string where = String.Empty;
             if (identity.DepartmentId > 0)
             {
                 AutoRepair.Entity.tb_LocationEntity model = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(identity.LocationId);
                 if (model != null)
                 {
                     where = " where area='" + model.LocationName + "'";
                 }
             }
             //绑定企业信息
             IList <AutoRepair.Entity.T_RepairUnitEntity> list = AutoRepair.BLL.T_RepairUnitBLL.GetInstance().GetRepairUnitListByWhere(where);
             if (list != null && list.Count > 0)
             {
                 ddl_Uid.DataSource     = list;
                 ddl_Uid.DataTextField  = "UnitName";
                 ddl_Uid.DataValueField = "UnitID";
                 ddl_Uid.DataBind();
             }
             #endregion
             BindInfor(ddl_Uid.SelectedValue);
         }
     }
 }
Пример #5
0
    private void BindData()
    {
        string where = String.Empty;
        if (identity != null)
        {
            if (identity.DepartmentId > 0)
            {
                AutoRepair.Entity.tb_LocationEntity model = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(identity.LocationId);
                if (model != null)
                {
                    where += " and Address like '%" + model.LocationName + "%'";
                }
            }
        }
        if (!string.IsNullOrEmpty(UnitID))
        {
            where += " and UnitID='" + UnitID + "'";
        }
        if (!string.IsNullOrEmpty(FinishDate))
        {
            where += " " + FinishDate + "";
        }
        else if (!string.IsNullOrEmpty(this.txtUnitID.Text.Trim()))
        {
            where += "and UnitID='" + this.txtUnitID.Text.Trim() + "'";
        }

        //汽车健康档案卡号
        if (!string.IsNullOrEmpty(this.txtCardKey.Text.Trim()))
        {
            where += " and CardKey='" + this.txtCardKey.Text.Trim() + "'";
        }
        //送修人
        if (!string.IsNullOrEmpty(this.txtRepairMan.Text.Trim()))
        {
            where += " and RepairMan='" + this.txtRepairMan.Text.Trim() + "'";
        }
        //车牌号码
        if (!string.IsNullOrEmpty(this.txtPlateNumber.Text.Trim()))
        {
            where += " and PlateNumber='" + this.txtPlateNumber.Text.Trim() + "'";
        }
        int     allCount;
        int     CurrentPage = this.pager1.CurrentPageIndex;
        DataSet ds          = AutoRepair.BLL.T_RepairDocumentBLL.GetInstance().GetT_RepairDocumentList(pager1.PageSize, CurrentPage, " 1=1 " + where, out allCount);

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows != null && ds.Tables[0].Rows.Count > 0)
        {
            rptRepairList.DataSource = ds;
            rptRepairList.DataBind();
            pager1.RecordCount      = allCount;
            pager1.CurrentPageIndex = CurrentPage;
        }
        else
        {
            rptRepairList.DataSource = string.Empty;
            rptRepairList.DataBind();
        }
    }
Пример #6
0
    public void Location()
    {
        if (ddlProvince.SelectedValue != "0")
        {
            AutoRepair.Entity.tb_LocationEntity modelt = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(int.Parse(ddlProvince.SelectedValue));
            if (modelt != null)
            {
                if (ddlProvince.SelectedValue != "0")
                {
                    //市
                    List <AutoRepair.Entity.tb_LocationEntity> list2 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCityListCache(int.Parse(ddlProvince.SelectedValue));
                    ddlCity.DataSource     = list2;
                    ddlCity.DataTextField  = "LocationName";
                    ddlCity.DataValueField = "LocationId";
                    ddlCity.DataBind();
                    ddlCity.SelectedValue = qx.Text;
                    //县
                    List <AutoRepair.Entity.tb_LocationEntity> list3 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCountyListCache(int.Parse(ddlCity.SelectedValue));
                    AutoRepair.Entity.tb_LocationEntity        model = new AutoRepair.Entity.tb_LocationEntity()
                    {
                        LocationName = "--全部--", LocationId = -1
                    };
                    if (list3[0].LocationName != "--全部--")
                    {
                        list3.Insert(0, model);
                    }

                    ddlCounty.DataSource     = list3;
                    ddlCounty.DataTextField  = "LocationName";
                    ddlCounty.DataValueField = "LocationId";
                    ddlCounty.DataBind();
                    ddlCounty.SelectedValue = hid.Text;
                }
            }
        }
        else
        {
            List <AutoRepair.Entity.tb_LocationEntity> list2 = new List <tb_LocationEntity>();
            list2.Add(new AutoRepair.Entity.tb_LocationEntity()
            {
                LocationName = "选择市", LocationId = 0
            });
            List <AutoRepair.Entity.tb_LocationEntity> list3 = new List <tb_LocationEntity>();
            list3.Add(new AutoRepair.Entity.tb_LocationEntity()
            {
                LocationName = "选择县/区", LocationId = 0
            });
            ddlCity.DataSource     = list2;
            ddlCity.DataTextField  = "LocationName";
            ddlCity.DataValueField = "LocationId";
            ddlCity.DataBind();
            ddlCounty.DataSource     = list3;
            ddlCounty.DataTextField  = "LocationName";
            ddlCounty.DataValueField = "LocationId";
            ddlCounty.DataBind();
        }
    }
Пример #7
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string where = String.Empty;
            string locationName = String.Empty;
            if (identity != null)
            {
                if (identity.DepartmentId > 0)
                {
                    AutoRepair.Entity.tb_LocationEntity model = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(identity.LocationId);
                    if (model != null)
                    {
                        locationName = model.LocationName;
                        where        = " where area like '%" + model.LocationName + "%'";
                    }
                }
            }
            DataSet ds = AutoRepair.BLL.T_RepairUnitBLL.GetInstance().GetRepairUnitStatistics(where);
            if (ds != null && ds.Tables.Count > 0 && ds.Tables[0] != null && ds.Tables[0].Rows.Count > 0)
            {
                //绑定数据
                rptTaskList.DataSource = ds;
                rptTaskList.DataBind();

                StringBuilder sb  = new StringBuilder();
                StringBuilder sb2 = new StringBuilder();
                sb.Append("[");
                sb2.Append("[");
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    sb.Append("'" + dr["LocationName"] + "',");
                    sb2.AppendFormat("{0}value:{1},name:'{2}'{3},", "{", dr["Total"], dr["LocationName"], "}");
                }
                string str = sb.ToString().TrimEnd(',');
                str += "]";
                string str2 = sb2.ToString().TrimEnd(',');
                str2    += "]";
                data     = str;
                datalist = str2;
            }
            else
            {
                data     = "['" + locationName + "']";
                datalist = "[{value:0,name:'" + locationName + "'}]";
                rptTaskList.DataSource = string.Empty;
                rptTaskList.DataBind();
            }
        }
    }
Пример #8
0
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            ddlProvince.DataSource     = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetProvinceByCache();
            ddlProvince.DataTextField  = "LocationName";
            ddlProvince.DataValueField = "LocationId";
            ddlProvince.DataBind();

            if (id > 0)
            {
                AutoRepair.Entity.tb_DepartmentEntity model = AutoRepair.BLL.tb_DepartmentBLL.GetInstance().GetAdminSingle(id);
                this.txtjgname.Text    = model.Name;
                this.txtjgaddress.Text = model.Address;
                this.txtconsignee.Text = model.Contacts;
                this.txtmobile.Text    = model.Phone;
                this.txtvuser.Text     = model.UserName;
                AutoRepair.Entity.tb_LocationEntity modelt = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(model.LocationId);
                if (modelt != null)
                {
                    string[] arr = modelt.LocationPath.Split('/');
                    if (arr.Count() > 3)
                    {
                        ddlProvince.SelectedValue = arr[2].ToString();//Items.FindByValue(arr[2].ToString()).Selected = true;
                    }
                    if (ddlProvince.SelectedValue != "0")
                    {
                        //市
                        List <AutoRepair.Entity.tb_LocationEntity> list2 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCityListCache(int.Parse(ddlProvince.SelectedValue));
                        ddlCity.DataSource     = list2;
                        ddlCity.DataTextField  = "LocationName";
                        ddlCity.DataValueField = "LocationId";
                        ddlCity.DataBind();
                        ddlCity.SelectedValue = arr[3].ToString();
                        //县
                        List <AutoRepair.Entity.tb_LocationEntity> list3 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCountyListCache(int.Parse(ddlCity.SelectedValue));
                        ddlCounty.DataSource     = list3;
                        ddlCounty.DataTextField  = "LocationName";
                        ddlCounty.DataValueField = "LocationId";
                        ddlCounty.DataBind();
                    }
                    ddlCounty.SelectedValue = model.LocationId.ToString();
                    qx.Text = model.LocationId.ToString();
                }
                // this.txtpermission.Text = model.PermissionNum;
            }
        }
    }
Пример #9
0
    public void BindData()
    {
        string s = String.Empty;

        if (identity != null)
        {
            if (identity.DepartmentId > 0)
            {
                AutoRepair.Entity.tb_LocationEntity model = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(identity.LocationId);
                if (model != null)
                {
                    s += "and Address like '%" + model.LocationName + "%'";
                }
            }
        }

        if (!string.IsNullOrEmpty(this.txtProductName.Text))
        {
            s += " and UnitName like '%" + this.txtProductName.Text.Trim() + "%'";
        }
        if (!string.IsNullOrEmpty(this.txtBuyer.Text.Trim()))
        {
            s += " and LinkMan = '" + this.txtBuyer.Text.Trim() + "'";
        }

        int allCount;
        int CurrentPage = 0;

        CurrentPage = this.pager1.CurrentPageIndex;
        DataSet ds = AutoRepair.BLL.T_RepairUnitBLL.GetInstance().GetT_RepairUnitData(pager1.PageSize, CurrentPage, " 1=1 " + s, out allCount);

        if (ds != null && ds.Tables.Count > 0 && ds.Tables[0].Rows != null && ds.Tables[0].Rows.Count > 0)
        {
            rptTaskList.DataSource = ds;
            rptTaskList.DataBind();
            pager1.RecordCount      = allCount;
            pager1.CurrentPageIndex = CurrentPage;
        }
        else
        {
            rptTaskList.DataSource = string.Empty;
            rptTaskList.DataBind();
        }
    }
Пример #10
0
 private void BindData()
 {
     if (identity != null)
     {
         if (identity.DepartmentId > 0)
         {
             AutoRepair.Entity.tb_LocationEntity model = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(identity.LocationId);
             if (model != null)
             {
                 IList <tb_DepartmentEntity> ds = AutoRepair.BLL.tb_DepartmentBLL.GetInstance().Gettb_DepartmentByAddress(model.LocationName);
                 if (ds != null && ds.Count > 0)
                 {
                     rptl.DataSource = ds;
                     rptl.DataBind();
                 }
                 else
                 {
                     rptl.DataSource = string.Empty;
                     rptl.DataBind();
                 }
             }
         }
         else
         {
             IList <tb_DepartmentEntity> ds = AutoRepair.BLL.tb_DepartmentBLL.GetInstance().Gettb_DepartmentList();
             if (ds != null && ds.Count > 0)
             {
                 rptl.DataSource = ds;
                 rptl.DataBind();
             }
             else
             {
                 rptl.DataSource = string.Empty;
                 rptl.DataBind();
             }
         }
     }
 }
Пример #11
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if (!IsPostBack)
     {
         if (!IsPostBack)
         {
             //省
             List <AutoRepair.Entity.tb_LocationEntity> list = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetProvinceByCache() as List <AutoRepair.Entity.tb_LocationEntity>;
             ddlProvince.DataSource     = list;
             ddlProvince.DataTextField  = "LocationName";
             ddlProvince.DataValueField = "LocationId";
             ddlProvince.DataBind();
             if (unitID != "")
             {
                 json = "{";
                 AutoRepair.Entity.T_RepairUnitEntity mode = AutoRepair.BLL.T_RepairUnitBLL.GetInstance().GetAdminSingle(unitID);
                 if (mode != null)
                 {
                     AutoRepair.Entity.tb_LocationEntity modelt = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetAdminSingle(int.Parse((mode.Area == "") ? "0" : mode.Area));
                     if (modelt != null)
                     {
                         string[] arr = modelt.LocationPath.Split('/');
                         if (arr.Count() > 3)
                         {
                             ddlProvince.SelectedValue = arr[2].ToString();//Items.FindByValue(arr[2].ToString()).Selected = true;
                         }
                         if (ddlProvince.SelectedValue != "0")
                         {
                             //市
                             List <AutoRepair.Entity.tb_LocationEntity> list2 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCityListCache(int.Parse(ddlProvince.SelectedValue));
                             ddlCity.DataSource     = list2;
                             ddlCity.DataTextField  = "LocationName";
                             ddlCity.DataValueField = "LocationId";
                             ddlCity.DataBind();
                             ddlCity.SelectedValue = arr[3].ToString();
                             //县
                             List <AutoRepair.Entity.tb_LocationEntity> list3 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCountyListCache(int.Parse(ddlCity.SelectedValue));
                             ddlCounty.DataSource     = list3;
                             ddlCounty.DataTextField  = "LocationName";
                             ddlCounty.DataValueField = "LocationId";
                             ddlCounty.DataBind();
                         }
                         ddlCounty.SelectedValue = mode.Area;
                         qx.Text = mode.Area;
                     }
                     json += "\"xukezhenghao\":\"" + mode.UnitID + "\",";
                     json += "\"qiyename\":\"" + mode.UnitName + "\",";
                     json += "\"fuzeren\":\"" + mode.LinkMan + "\",";
                     json += "\"dianhua\":\"" + mode.Phone + "\",";
                     json += "\"quyu\":\"" + mode.Area + "\",";
                     json += "\"dizhi\":\"" + mode.Address + "\",";
                     json += "\"shuihao\":\"" + mode.TaxNumber + "\",";
                     json += "\"zhizhao\":\"" + mode.ICNumber + "\",";
                     json += "\"miyao\":\"" + mode.AuthToken + "\",";
                     json += "\"xinyu\":\"" + mode.Crerating + "\",";
                     json += "\"leibie\":\"" + mode.Categories + "\",";
                     json += "\"fanwei\":\"" + mode.Range + "\",";
                     json += "\"beizhu\":\"" + mode.Remark + "\",";
                 }
                 json  = json.Trim(',');
                 json += "}";
             }
         }
     }
 }
Пример #12
0
    private void BindData()
    {
        if (qx.Text == "-1")
        {
            List <AutoRepair.Entity.tb_LocationEntity> list = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCountyListCache(int.Parse(txt_hid.Text));
            StringBuilder sbs  = new StringBuilder();
            string        area = String.Empty;
            foreach (AutoRepair.Entity.tb_LocationEntity model in list)
            {
                sbs.AppendFormat("{0},", model.LocationId);
            }
            area = sbs.ToString().TrimEnd(',');
            DataSet ds = AutoRepair.BLL.T_RepairDocumentBLL.GetInstance().Get_RepairListByAreaList(area);
            if (ds != null)
            {
                //绑定数据
                rptTaskList.DataSource = ds;
                rptTaskList.DataBind();
            }
            DataSet dss = AutoRepair.BLL.T_RepairDocumentBLL.GetInstance().GetUnitCountRepairByAreaList(area);
            if (dss != null && dss.Tables.Count > 0)
            {
                StringBuilder sb  = new StringBuilder();
                StringBuilder sb2 = new StringBuilder();
                sb.Append("[");
                sb2.Append("[");
                foreach (DataRow dr in dss.Tables[0].Rows)
                {
                    sb.Append("'" + dr["UnitName"] + "',");
                    sb2.AppendFormat("{0}value:{1},name:'{2}'{3},", "{", dr["weixuishu"], dr["UnitName"], "}");
                }
                string str = sb.ToString().TrimEnd(',');
                str += "]";
                string str2 = sb2.ToString().TrimEnd(',');
                str2    += "]";
                data     = str;
                datalist = str2;
            }
        }
        else
        {
            DataSet ds = AutoRepair.BLL.T_RepairDocumentBLL.GetInstance().Get_RepairListByArea(qx.Text);
            if (ds != null)
            {
                //绑定数据
                rptTaskList.DataSource = ds;
                rptTaskList.DataBind();
            }
            DataSet dss = AutoRepair.BLL.T_RepairDocumentBLL.GetInstance().GetUnitCountRepairByArea(qx.Text);
            if (dss != null && dss.Tables.Count > 0)
            {
                StringBuilder sb  = new StringBuilder();
                StringBuilder sb2 = new StringBuilder();
                sb.Append("[");
                sb2.Append("[");
                foreach (DataRow dr in dss.Tables[0].Rows)
                {
                    sb.Append("'" + dr["UnitName"] + "',");
                    sb2.AppendFormat("{0}value:{1},name:'{2}'{3},", "{", dr["weixuishu"], dr["UnitName"], "}");
                }
                string str = sb.ToString().TrimEnd(',');
                str += "]";
                string str2 = sb2.ToString().TrimEnd(',');
                str2    += "]";
                data     = str;
                datalist = str2;
            }
        }
        //市
        List <AutoRepair.Entity.tb_LocationEntity> list2 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCityListCache(int.Parse(ddlProvince.SelectedValue));

        ddlCity.DataSource     = list2;
        ddlCity.DataTextField  = "LocationName";
        ddlCity.DataValueField = "LocationId";
        ddlCity.DataBind();
        ddlCity.SelectedValue = txt_hid.Text;
        //县
        List <AutoRepair.Entity.tb_LocationEntity> list3 = AutoRepair.BLL.tb_LocationBLL.GetInstance().GetCountyListCache(int.Parse(txt_hid.Text));

        AutoRepair.Entity.tb_LocationEntity models = new AutoRepair.Entity.tb_LocationEntity();
        models.LocationName = "--全选--";
        models.LocationId   = -1;
        list3.Insert(0, models);
        ddlCounty.DataSource     = list3;
        ddlCounty.DataTextField  = "LocationName";
        ddlCounty.DataValueField = "LocationId";
        ddlCounty.DataBind();
        ddlCounty.SelectedValue = qx.Text;
    }