Beispiel #1
0
        public static string[] GetItemMethod(string prefixText, int count)
        {
            //string sElement = (string)HttpContext.Current.Session["Element"];
            WorkFlow      objWorkFlow = new WorkFlow();
            DataTable     dt          = objWorkFlow.GetItem();
            List <string> lst         = new List <string>();

            foreach (DataRow dr in dt.Rows)
            {
                string item = dr["t_item"].ToString();
                lst.Add(item);
            }
            return(lst.ToArray());
        }
Beispiel #2
0
        private void GetItem()
        {
            WorkFlow objWorkFlow = new WorkFlow();

            // WorkFlow objWorkFlow = new WorkFlow();
            string[] Project = txtProject.Text.Split('-');
            objWorkFlow.Project = Project[0];
            string[] Element = txtElement.Text.Split('-');
            objWorkFlow.Element = Element[0];
            DataTable dt = objWorkFlow.GetItemforSelectedproj_Element();

            if (dt.Rows.Count > 0 && dt.Rows[0]["t_item"].ToString() != "")
            {
                ddlItem.Enabled        = true;
                ddlItem.DataSource     = dt;
                ddlItem.DataValueField = "t_item";
                ddlItem.DataTextField  = "t_item";
                ddlItem.DataBind();
                ddlItem.Items.Insert(0, "Select");
            }
            else
            {
                DataTable dtall = objWorkFlow.GetItem();
                if (dtall.Rows.Count > 0 && dtall.Rows[0]["t_item"].ToString() != "")
                {
                    ddlItem.Enabled        = true;
                    ddlItem.DataSource     = dtall;
                    ddlItem.DataValueField = "t_item";
                    ddlItem.DataTextField  = "t_item";
                    ddlItem.DataBind();
                    ddlItem.Items.Insert(0, "Select");
                }
                else
                {
                    ddlItem.Enabled = false;
                }
            }
        }