示例#1
0
        public void GetDelegationDetail(long Delegateid)
        {
            iUserCreationClient userClient = new iUserCreationClient();
            CustomProfile       profile    = CustomProfile.GetProfile();

            try
            {
                DataSet   ds;
                DataTable dt;
                //ds = productClient.GetBOMDetailById(BOMDetailId, profile.DBConnection._constr);
                ds = userClient.getUserDelegateDetail(Delegateid, profile.DBConnection._constr);
                dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    long deptId = long.Parse(dt.Rows[0]["DeptID"].ToString());
                    BindDepartment(UserID, UserType);
                    ddlDepartment.SelectedIndex = ddlDepartment.Items.IndexOf(ddlDepartment.Items.FindByValue(dt.Rows[0]["DeptID"].ToString()));
                    getDelegateToList(deptId);
                    if (ddlUOM.Items.Count >= 1)
                    {
                        ddlUOM.SelectedIndex = 0;
                    }
                    ddlUOM.SelectedIndex      = ddlUOM.Items.IndexOf(ddlUOM.Items.FindByValue(dt.Rows[0]["DeligateTo"].ToString()));
                    ddlUOM.SelectedItem.Value = dt.Rows[0]["DeligateTo"].ToString();
                    //ddlUOM.SelectedItem.Text = dt.Rows[0]["Name"].ToString();

                    hdndegateId.Value = Delegateid.ToString();

                    txtPrincipalPrice.Text     = dt.Rows[0]["Remark"].ToString();
                    UC_Date1.Date              = Convert.ToDateTime(dt.Rows[0]["FromDate"].ToString());
                    UC_Date2.Date              = Convert.ToDateTime(dt.Rows[0]["ToDate"].ToString());
                    hdndeligateeditstate.Value = "Edit";
                    hdnnewDelegateid.Value     = dt.Rows[0]["ID"].ToString();
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Access Delegation", "GetDelegationDetail");
            }
            finally
            {
                userClient.Close();
            }
        }