示例#1
0
        public static List <contact> Getdelegate(object objReq)
        {
            iUserCreationClient userClient = new iUserCreationClient();
            CustomProfile       profile    = CustomProfile.GetProfile();
            DataSet             ds         = new DataSet();
            DataTable           dt         = new DataTable();
            List <contact>      LocList    = new List <contact>();

            try
            {
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objReq;
                //ds = ReceivableClient.GetProdLocations(ProdCode.Trim());
                long ddlDepartment = long.Parse(dictionary["ddlDepartment"].ToString());
                long UsrId         = long.Parse(profile.Personal.UserID.ToString());
                ds = userClient.getDelegateToList(ddlDepartment, UsrId, profile.DBConnection._constr);

                dt = ds.Tables[0];


                contact Loc = new contact();
                Loc.Name = "--Select--";
                Loc.Id   = "0";
                LocList.Add(Loc);
                Loc = new contact();

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        Loc.Id   = dt.Rows[i]["ID"].ToString();
                        Loc.Name = dt.Rows[i]["Name"].ToString();
                        LocList.Add(Loc);
                        Loc = new contact();
                    }
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, "Access Delegation", "Getdelegate");
            }
            finally
            {
                userClient.Close();
            }
            return(LocList);
        }
示例#2
0
        //protected void grdaccessdele_Select(object sender, Obout.Grid.GridRecordEventArgs e)
        //{
        //    try
        //    {
        //        Hashtable selectedrec = (Hashtable)grdaccessdele.SelectedRecords[0];
        //        hdndegateId.Value = selectedrec["ID"].ToString();

        //        hdnnewDelegateid.Value = selectedrec["ID"].ToString();
        //        hdndeligateeditstate.Value = "Edit";
        //        GetDelegationDetail(long.Parse(hdndegateId.Value));
        //        //string editsession = "Edit";

        //        Session["hdnedit"] = "Edit";
        //        Session.Add("hdnnewDelegateid", hdnnewDelegateid.Value);
        //    }
        //    catch (Exception ex)
        //    {
        //        Login.Profile.ErrorHandling(ex, this, "Access Delegation", "BindAccessDelgrid");
        //    }
        //    finally {}
        //}

        //protected void imgBtnEditbom_OnClick(object sender, ImageClickEventArgs e)
        //{
        //    ImageButton imgbtn = (ImageButton)sender;
        //    hdnnewDelegateid.Value = imgbtn.ToolTip.ToString();
        //    hdndegateId.Value = imgbtn.ToolTip.ToString();
        //    hdndeligateeditstate.Value = "Edit";
        //    GetDelegationDetail(long.Parse(hdndegateId.Value));
        //    //string editsession = "Edit";

        //    Session["hdnedit"] = "Edit";
        //    Session.Add("hdnnewDelegateid", hdnnewDelegateid.Value);
        //}

        public void getDelegateToList(long DeptId)
        {
            CustomProfile       profile    = CustomProfile.GetProfile();
            iUserCreationClient userClient = new iUserCreationClient();
            long    UserID = long.Parse(profile.Personal.UserID.ToString());
            DataSet ds;

            ds = userClient.getDelegateToList(DeptId, UserID, profile.DBConnection._constr);
            // ds = userClient.getDelegateToListMultipleDept(hdnSelectedLocation.Value, profile.DBConnection._constr);
            ddlUOM.DataSource     = ds;
            ddlUOM.DataTextField  = "Name";
            ddlUOM.DataValueField = "ID";
            ddlUOM.DataBind();
            ListItem lst = new ListItem {
                Text = "-Select-", Value = "0"
            };

            ddlUOM.Items.Insert(0, lst);
        }