Exemple #1
0
    public void PYsearch(string py, string store)
    {
        if (py.Trim() == "")
        {
            return;
        }
        switch (store.Trim())
        {
        case "placeStore":
            var place = from pl in dc.Place
                        where pl.Maindeptid == SessionBox.GetUserSession().DeptNumber &&
                        (dc.F_PINYIN(pl.Placename).ToLower().Contains(py.ToLower()) || pl.Placename.Contains(py.Trim()))
                        select new
            {
                placID   = pl.Placeid,
                placName = pl.Placename
            };
            placeStore.DataSource = place;
            placeStore.DataBind();
            break;

        case "PCpersonStore":
            var q = from p in dc.Person
                    where p.Maindeptid == SessionBox.GetUserSession().DeptNumber &&
                    (dc.F_PINYIN(p.Name).ToLower().Contains(py.ToLower()) || p.Name.Contains(py.Trim()))
                    select new
            {
                p.Personnumber,
                p.Name
            };
            PCpersonStore.DataSource = q.Distinct();
            PCpersonStore.DataBind();
            break;
        }
    }
    private void pcPersonLoad()
    {
        var person = (from pl in dc.Vgetpl
                      where pl.Moduletag == "HiddenDanage_HDprocess" && pl.Operatortag == "YH_fcfk" && pl.Unitid == SessionBox.GetUserSession().DeptNumber &&
                      pl.Personnumber == SessionBox.GetUserSession().PersonNumber
                      select new
        {
            pl.Personnumber,
            pl.Name,
            pl.Deptname
        }).Distinct();

        PCpersonStore.DataSource = person;
        PCpersonStore.DataBind();
        if (person.Where(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber).Count() > 0)
        {
            cbbPerson.SelectedItem.Value = SessionBox.GetUserSession().PersonNumber;
            var per = person.Where(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber);
            //tfPerson.Text = per.First().Name;
            //hdnPerson.SetValue(SessionBox.GetUserSession().PersonNumber);
            SelectedStore.DataSource = per;
            SelectedStore.DataBind();
            //string js=string.Format("PersonSelector.add({0},{1});", "GridPanel3", "[new Ext.data.Record({Personnumber:'" + per.Personnumber + "',Name:'" + per.Name + "',Deptname:'" + per.Deptname + "'})]");
            //Ext.DoScript(js);
        }
    }
Exemple #3
0
    private void pcPersonLoad()
    {
        var person = (from pl in dc.Vgetpl
                      where pl.Moduletag == "YSNewProcess_YHProcess" && pl.Operatortag == "YH_fcfk" && pl.Unitid == SessionBox.GetUserSession().DeptNumber &&
                      pl.Personnumber == SessionBox.GetUserSession().PersonNumber
                      select new
        {
            pl.Personnumber,
            pl.Name,
            pl.Deptname
        }).Distinct();

        PCpersonStore.DataSource = person;
        PCpersonStore.DataBind();
        cbbPerson.SelectedItem.Value = SessionBox.GetUserSession().PersonNumber;
    }
Exemple #4
0
    private void pcPersonLoad()
    {
        var person = from pl in dc.Vgetpl
                     where pl.Moduletag == "HiddenDanage_HDprocess" && pl.Operatortag == "YH_fcfk" && pl.Unitid == SessionBox.GetUserSession().DeptNumber
                     select new
        {
            pl.Personnumber,
            pl.Name
        };

        PCpersonStore.DataSource = person;
        PCpersonStore.DataBind();
        if (person.Where(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber).Count() > 0)
        {
            cbbPCperson.SelectedItem.Value = SessionBox.GetUserSession().PersonNumber;
        }
    }
Exemple #5
0
    private void GetPersonName(int Yhid)
    {
        var per = from ym in dc.NyhinputMore
                  from p in dc.Person
                  from d in dc.Department
                  where ym.Personid == p.Personnumber && p.Areadeptid == d.Deptnumber && ym.Yhputinid == Yhid
                  select new
        {
            p.Personnumber,
            p.Name,
            d.Deptname
        };

        SelectedStore.DataSource = per;
        SelectedStore.DataBind();
        if (per.Count() > 0)
        {
            string strPer  = "";
            string strName = "";
            foreach (var r in per)
            {
                strPer  += r.Personnumber + ",";
                strName += r.Name + ",";
            }
            var person = from p in dc.Person
                         where p.Personnumber == SessionBox.GetUserSession().PersonNumber
                         select new
            {
                Personnumber = strPer.Substring(0, strPer.Length - 1),
                Name         = strName.Substring(0, strName.Length - 1)
            };
            PCpersonStore.DataSource = person;
            PCpersonStore.DataBind();
            cbbPerson.SelectedIndex = 0;
            //tfPerson.Text = strName.Substring(0, strName.Length - 1);
            //hdnPerson.SetValue(strPer.Substring(0, strPer.Length - 1));
        }
        else
        {
            cbbPerson.Items.Clear();
            //tfPerson.Text = "";
            //hdnPerson.SetValue("");
        }
    }
Exemple #6
0
    protected void SubmitData(object sender, StoreSubmitDataEventArgs e)
    {
        //string json = e.Json;
        XmlNode     xml      = e.Xml;
        XmlNode     rxml     = xml.SelectSingleNode("records");
        XmlNodeList uRecords = rxml.SelectNodes("record");

        if (uRecords.Count > 0)
        {
            string strPer  = "";
            string strName = "";
            int    i       = 0;
            foreach (XmlNode record in uRecords)
            {
                if (record != null)
                {
                    strPer  += record.SelectSingleNode("Personnumber").InnerText.Trim() + ",";
                    strName += record.SelectSingleNode("Name").InnerText.Trim() + ",";
                    i++;
                }
            }
            var per = from p in dc.Person
                      where p.Personnumber == SessionBox.GetUserSession().PersonNumber
                      select new
            {
                Personnumber = strPer.Substring(0, strPer.Length - 1),
                Name         = strName.Substring(0, strName.Length - 1)
            };
            PCpersonStore.DataSource = per;
            PCpersonStore.DataBind();
            cbbPerson.SelectedIndex = 0;
            //tfPerson.Text = strName.Substring(0, strName.Length - 1);
            //hdnPerson.SetValue(strPer.Substring(0, strPer.Length - 1));
        }
        else
        {
            cbbPerson.Items.Clear();
            //tfPerson.Text = "";
            //hdnPerson.SetValue("");
        }
    }
Exemple #7
0
    public void PYsearch(string py, string store)
    {
        if (py.Trim() == "")
        {
            return;
        }
        switch (store.Trim())
        {
        case "deptStore":
            if (PublicCode.BugCreate(SessionBox.GetUserSession().DeptNumber))
            {
                string areadept = dc.Person.First(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber).Areadeptid;
                var    dept     = from d in dc.Department
                                  where d.Deptnumber.Substring(0, 4) == SessionBox.GetUserSession().DeptNumber.Substring(0, 4) &&
                                  d.Deptnumber != areadept && d.Fatherid != areadept &&
                                  (dc.F_PINYIN(d.Deptname).ToLower().Contains(py.ToLower()) || d.Deptname.Contains(py.Trim()))
                                  select new
                {
                    deptID   = d.Deptnumber,
                    deptName = d.Deptname
                };
                deptStore.DataSource = dept.Distinct();
                deptStore.DataBind();
            }
            else
            {
                var dept = from d in dc.Department
                           where d.Deptnumber.Substring(0, 4) == SessionBox.GetUserSession().DeptNumber.Substring(0, 4) &&
                           (d.Deptnumber.Substring(7) == "00" || d.Deptlevel == "正科级") && d.Deptstatus == "1" &&
                           (dc.F_PINYIN(d.Deptname).ToLower().Contains(py.ToLower()) || d.Deptname.Contains(py.Trim()))
                           select new
                {
                    deptID   = d.Deptnumber,
                    deptName = d.Deptname
                };
                deptStore.DataSource = dept.Distinct();
                deptStore.DataBind();
            }
            break;

        case "placeStore":
            if (PublicCode.BugCreate(SessionBox.GetUserSession().DeptNumber))
            {
                decimal areaid = (from p in dc.Person
                                  from d in dc.Department
                                  from a in dc.Placeareas
                                  where p.Personnumber == SessionBox.GetUserSession().PersonNumber &&
                                  p.Areadeptid == d.Deptnumber && d.Deptname.Replace(" ", "") == a.Pareasname
                                  select a).First().Pareasid;
                var place = from pl in dc.Place
                            where pl.Maindeptid == SessionBox.GetUserSession().DeptNumber &&
                            pl.Pareasid != areaid && pl.Placestatus == 1 &&
                            (dc.F_PINYIN(pl.Placename).ToLower().Contains(py.ToLower()) || pl.Placename.Contains(py.Trim()))
                            select new
                {
                    placID   = pl.Placeid,
                    placName = pl.Placename
                };
                placeStore.DataSource = place;
                placeStore.DataBind();
            }
            else
            {
                var place = from pl in dc.Place
                            where pl.Maindeptid == SessionBox.GetUserSession().DeptNumber&& pl.Placestatus == 1 &&
                            (dc.F_PINYIN(pl.Placename).ToLower().Contains(py.ToLower()) || pl.Placename.Contains(py.Trim()))
                            select new
                {
                    placID   = pl.Placeid,
                    placName = pl.Placename
                };
                placeStore.DataSource = place;
                placeStore.DataBind();
            }
            break;

        case "yhStore":    //修改多列显示
            var hazard = from yh in dc.Getyhandhazusing
                         where yh.Deptnumber == SessionBox.GetUserSession().DeptNumber &&
                         (yh.Conpyfirst.ToLower().Contains(py.ToLower()) || yh.Yhcontent.Contains(py.Trim()) || yh.Yhnumber.ToLower().Contains(py.ToLower()))
                         select new
            {
                yhNumber  = yh.Yhid,
                yhContent = yh.Yhcontent,
                Gzrwname  = yh.Levelname,
                Gxname    = yh.Typename
            };
            yhStore.DataSource = hazard;
            yhStore.DataBind();
            break;

        case "PCpersonStore":
            if (cbbJctype.SelectedItem.Value == "2")
            {
                //局端排查人
                var person = from p in dc.Person
                             from d in dc.Department
                             where p.Areadeptid == d.Deptnumber && p.Visualfield == 3 && p.Personstatus == 1 &&
                             (dc.F_PINYIN(p.Name).ToLower().Contains(py.ToLower()) || p.Name.Contains(py.Trim()))
                             select new
                {
                    p.Personnumber,
                    p.Name,
                    d.Deptname
                };
                PCpersonStore.DataSource = person;
                PCpersonStore.DataBind();
            }
            else
            {
                var person = from pl in dc.Vgetpl
                             from p in dc.Person
                             where pl.Moduletag == "HiddenDanage_HDprocess" && pl.Operatortag == "YH_fcfk" && pl.Unitid == SessionBox.GetUserSession().DeptNumber &&
                             (dc.F_PINYIN(pl.Name).ToLower().Contains(py.ToLower()) || pl.Name.Contains(py.Trim())) &&
                             pl.Personnumber == p.Personnumber && p.Personstatus == 1
                             select new
                {
                    pl.Personnumber,
                    pl.Name
                };
                PCpersonStore.DataSource = person.Distinct();
                PCpersonStore.DataBind();
            }
            break;

        case "WorkTaskStore":
            var gzrw = dc.Worktasks.Where(
                p => p.Professionalid == decimal.Parse(cbbSbsdy.SelectedItem.Value) &&
                dc.F_PINYIN(p.Worktask).ToLower().Contains(py.ToLower())
                );
            WorkTaskStore.DataSource = gzrw;
            WorkTaskStore.DataBind();
            break;
        }
    }
    public void PYsearch(string py, string store)
    {
        if (py.Trim() == "")
        {
            return;
        }
        switch (store.Trim())
        {
        case "deptStore":
            var dept = from d in dc.Department
                       where d.Deptnumber.Substring(0, 4) == SessionBox.GetUserSession().DeptNumber.Substring(0, 4) &&
                       d.Deptnumber.Substring(7) == "00" &&
                       (dc.F_PINYIN(d.Deptname).ToLower().Contains(py.ToLower()) || d.Deptname.Contains(py.Trim()))
                       select new
            {
                deptID   = d.Deptnumber,
                deptName = d.Deptname
            };
            deptStore.DataSource = dept;
            deptStore.DataBind();
            break;

        case "placeStore":
            var place = from pl in dc.Place
                        where pl.Maindeptid == SessionBox.GetUserSession().DeptNumber &&
                        (dc.F_PINYIN(pl.Placename).ToLower().Contains(py.ToLower()) || pl.Placename.Contains(py.Trim()))
                        select new
            {
                placID   = pl.Placeid,
                placName = pl.Placename
            };
            placeStore.DataSource = place;
            placeStore.DataBind();
            break;

        case "yhStore":    //修改多列显示
            //var hazard = from hd in dc.Gethazardusing
            //             from ore in dc.HazardsOre
            //         where hd.HNumber==ore.HNumber && hd.Deptnumber == SessionBox.GetUserSession().DeptNumber
            //         && (ore.HFPinyin.ToLower().Contains(py.ToLower()) || ore.HBm.Contains(py.Trim()))
            //         select new
            //         {
            //             yhNumber = hd.HNumber,
            //             yhContent = hd.HBm,
            //             hd.Gzrwname
            //         };
            var hazard = from ha in dc.Hazards
                         from ore in dc.HazardsOre
                         from p in dc.Process
                         from w in dc.Worktasks
                         where ha.HNumber == ore.HNumber && ha.Processid == p.Processid && p.Worktaskid == w.Worktaskid &&
                         ore.Deptnumber == SessionBox.GetUserSession().DeptNumber&& ore.HBjw == "引用" &&     // && ore.YhSwBjw=="隐患"
                         (ore.HFPinyin.ToLower().Contains(py.ToLower()) || ore.HBm.Contains(py.Trim()))
                         select new
            {
                yhNumber  = ha.HNumber,
                yhContent = ore.HBm,
                Gzrwname  = w.Worktask,
                Gxname    = p.Name
            };
            yhStore.DataSource = hazard;
            yhStore.DataBind();
            break;

        case "PCpersonStore":
            var person = from pl in dc.Vgetpl
                         where pl.Moduletag == "HiddenDanage_HDprocess" && pl.Operatortag == "YH_fcfk" && pl.Unitid == SessionBox.GetUserSession().DeptNumber &&
                         (dc.F_PINYIN(pl.Name).ToLower().Contains(py.ToLower()) || pl.Name.Contains(py.Trim()))
                         select new
            {
                pl.Personnumber,
                pl.Name
            };
            PCpersonStore.DataSource = person;
            PCpersonStore.DataBind();
            break;

        case "WorkTaskStore":
            var gzrw = dc.Worktasks.Where(
                p => p.Professionalid == decimal.Parse(cbbSbsdy.SelectedItem.Value) &&
                dc.F_PINYIN(p.Worktask).ToLower().Contains(py.ToLower())
                );
            WorkTaskStore.DataSource = gzrw;
            WorkTaskStore.DataBind();
            break;
        }
    }
Exemple #9
0
    public void PYsearch(string py, string store)
    {
        if (py.Trim() == "")
        {
            return;
        }
        switch (store.Trim())
        {
        case "personStore":
            if (PublicCode.BugCreate(SessionBox.GetUserSession().DeptNumber))
            {
                string areadept = dc.Person.First(p => p.Personnumber == SessionBox.GetUserSession().PersonNumber).Areadeptid;
                var    person   = from r in dc.Person
                                  from d in dc.Department
                                  where r.Deptid == d.Deptnumber && r.Maindeptid == SessionBox.GetUserSession().DeptNumber &&
                                  r.Areadeptid != areadept && r.Personstatus == 1 &&
                                  (r.Pinyin.ToLower().Contains(py.ToLower()) || r.Lightnumber.ToLower().Contains(py.ToLower()) || r.Name.Contains(py.Trim()))
                                  select new
                {
                    pernID          = r.Personid,
                    pernName        = r.Name,
                    pernLightNumber = r.Lightnumber,
                    persNnmber      = r.Personnumber,
                    DeptName        = d.Deptname
                };
                personStore.DataSource = person;
                personStore.DataBind();
            }
            else
            {
                var person = from r in dc.Person
                             from d in dc.Department
                             where r.Deptid == d.Deptnumber && r.Maindeptid == SessionBox.GetUserSession().DeptNumber&& r.Personstatus == 1 &&
                             (r.Pinyin.ToLower().Contains(py.ToLower()) || r.Lightnumber.ToLower().Contains(py.ToLower()) || r.Name.Contains(py.Trim()))
                             select new
                {
                    pernID          = r.Personid,
                    pernName        = r.Name,
                    pernLightNumber = r.Lightnumber,
                    persNnmber      = r.Personnumber,
                    DeptName        = d.Deptname
                };
                personStore.DataSource = person;
                personStore.DataBind();
            }
            break;

        case "placeStore":
            if (PublicCode.BugCreate(SessionBox.GetUserSession().DeptNumber))
            {
                decimal areaid = (from p in dc.Person
                                  from d in dc.Department
                                  from a in dc.Placeareas
                                  where p.Personnumber == SessionBox.GetUserSession().PersonNumber &&
                                  p.Areadeptid == d.Deptnumber && d.Deptname.Replace(" ", "") == a.Pareasname
                                  select a).First().Pareasid;
                var place = from pl in dc.Place
                            where pl.Maindeptid == SessionBox.GetUserSession().DeptNumber &&
                            pl.Pareasid != areaid &&
                            (dc.F_PINYIN(pl.Placename).ToLower().Contains(py.ToLower()) || pl.Placename.Contains(py.Trim()))
                            select new
                {
                    placID   = pl.Placeid,
                    placName = pl.Placename
                };
                placeStore.DataSource = place;
                placeStore.DataBind();
            }
            else
            {
                var place = from pl in dc.Place
                            where pl.Maindeptid == SessionBox.GetUserSession().DeptNumber&& pl.Placestatus == 1 &&
                            (dc.F_PINYIN(pl.Placename).ToLower().Contains(py.ToLower()) || pl.Placename.Contains(py.Trim()))
                            select new
                {
                    placID   = pl.Placeid,
                    placName = pl.Placename
                };
                placeStore.DataSource = place;
                placeStore.DataBind();
            }
            break;

        case "yhStore":
            var hazard = from yh in dc.Getswandhazusing
                         where yh.Deptnumber == SessionBox.GetUserSession().DeptNumber &&
                         (yh.Conpyfirst.ToLower().Contains(py.ToLower()) || yh.Swcontent.Contains(py.Trim()) || yh.Swnumber.ToLower().Contains(py.ToLower()))
                         select new
            {
                yhNumber  = yh.Swid,
                yhContent = yh.Swcontent,
                Gzrwname  = yh.Levelname,
                Gxname    = yh.Typename
            };
            yhStore.DataSource = hazard;
            yhStore.DataBind();
            break;

        case "PCpersonStore":
            var person1 = from pl in dc.Vgetpl
                          from p in dc.Person
                          where pl.Moduletag == "HiddenDanage_HDprocess" && pl.Operatortag == "YH_fcfk" && pl.Unitid == SessionBox.GetUserSession().DeptNumber &&
                          (dc.F_PINYIN(pl.Name).ToLower().Contains(py.ToLower()) || pl.Name.Contains(py.Trim())) &&
                          pl.Personnumber == p.Personnumber && p.Personstatus == 1
                          select new
            {
                pl.Personnumber,
                pl.Name
            };
            PCpersonStore.DataSource = person1.Distinct();
            PCpersonStore.DataBind();
            break;

        case "WorkTaskStore":
            var gzrw = dc.Worktasks.Where(
                p => p.Professionalid == decimal.Parse(cbbSbsdy.SelectedItem.Value) &&
                dc.F_PINYIN(p.Worktask).ToLower().Contains(py.ToLower())
                );
            WorkTaskStore.DataSource = gzrw;
            WorkTaskStore.DataBind();
            break;
        }
    }