Example #1
0
        //檔案上傳

        protected void DdDept_SelectedIndexChanged(object sender, EventArgs e)
        {
            DDgid.Items.Clear();
            SmoothEnterprise.Database.DataSet ds = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
            ds.Open(" select *  from dggroup where comid='" + DdDept.SelectedValue + "'");
            while (!ds.EOF)
            {
                DDgid.Items.Add(new ListItem(ds["name"].ToString(), ds["id"].ToString()));
                ds.MoveNext();
            }
        }
Example #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            //this.tabtitle_Account.Attributes["tabtitle"] = base.GetLocalResourceObject("tabtitle_Account").ToString();
            //this.tabtitle_Information.Attributes["tabtitle"] = base.GetLocalResourceObject("tabtitle_Information").ToString();


            this.FIELD_photo.Attributes.Add("onchange", "value==''?" + this.PREVIEW_photo.ClientID + ".src='/lib/img/img-noimage.gif':" + this.PREVIEW_photo.ClientID + ".src=value;");
            DataSet set = new DataSet(DataSetType.OpenRead);

            if (!base.IsPostBack)
            {
                this.FIELD_utype.Value = UType.SmoothEnterprise.ToString();
            }
            set.Open("select * from dgrole ");
            this.FIELD_role.Items.Clear();
            for (int i = 0; i < set.Rows.Count; i++)
            {
                this.FIELD_role.Items.Add(set.Rows[i]["name"].ToString(), set.Rows[i]["id"].ToString(), set.Rows[i]["isdefault"].ToString() == "Y");
            }
            this.FIELD_utype_SelectedIndexChanged(sender, e);
            this.FIELD_pwd.Attributes.Add("onChange", this.FIELD_pwd_confirm.ClientID + ".value='';");

            if (!this.IsPostBack)
            {
                SmoothEnterprise.Database.DataSet ds = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
                string whereis = "";
                string comid   = "";
                ds.Open("select comid from dguser where id='" + this.CurrentUser.ID + "'");
                if (ds["comid"].ToString() != "")
                {
                    comid = ds["comid"].ToString().ToUpper().Trim();
                }
                ds.Close();

                if (comid != "MAT")
                {
                    whereis = " where comid='" + comid + "'";
                    DdDept.SelectedValue = comid;
                    DdDept.Enabled       = false;
                }



                ds.Open(" select *  from dggroup  " + whereis);
                while (!ds.EOF)
                {
                    DDgid.Items.Add(new ListItem(ds["name"].ToString(), ds["id"].ToString()));

                    ds.MoveNext();
                }
            }
        }
Example #3
0
        private void CreateXML(string requid)
        {
            DateTime currentDate  = DateTime.Now;
            long     elapsedTicks = currentDate.Ticks;


            SmoothEnterprise.Database.DataSet ds  = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
            SmoothEnterprise.Database.DataSet rs1 = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
            rs1.Open("select *  from dguser where id='" + requid + "'");
            string filename;
            int    DTotal = 0;

            while (!rs1.EOF)
            {
                XmlDocument xdoc = new XmlDocument();
                xdoc.AppendChild(xdoc.CreateXmlDeclaration("1.0", "UTF-8", "yes"));
                // 建立根節點物件並加入 XmlDocument 中 (第 0 層)
                XmlElement rootElement = xdoc.CreateElement("NewDataSet");
                xdoc.AppendChild(rootElement);

                XmlElement eleChild1 = xdoc.CreateElement("NewDataSet");

                /*
                 *
                 *            ,utype,,,,
                 * ,,,,,,effectdate,expiredate,dsn,gid
                 * ,ucategory,userpath,authcode,sid,optname1,optvalue1,optsyscontrol1
                 * ,optname2,optvalue2,optsyscontrol2,optname3,optvalue3,optsyscontrol3,inituid
                 * ,initdate,modifydate,modifyuid,comid,empid,levid,erpid*/
                XmlElement eleGrandChilds = xdoc.CreateElement("FileType");
                eleGrandChilds.InnerText = "ADD";
                rootElement.AppendChild(eleGrandChilds);

                XmlElement eleGrandChild1 = xdoc.CreateElement("id");
                eleGrandChild1.InnerText = rs1["id"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild1);

                XmlElement eleGrandChild2 = xdoc.CreateElement("utype");
                eleGrandChild2.InnerText = rs1["utype"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild2);

                XmlElement eleGrandChild3 = xdoc.CreateElement("logonid");
                eleGrandChild3.InnerText = rs1["logonid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild3);

                XmlElement eleGrandChild4 = xdoc.CreateElement("name");
                eleGrandChild4.InnerText = rs1["name"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild4);

                XmlElement eleGrandChild5 = xdoc.CreateElement("userdomain");
                eleGrandChild5.InnerText = rs1["userdomain"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild5);


                XmlElement eleGrandChild6 = xdoc.CreateElement("pwd");
                eleGrandChild6.InnerText = rs1["pwd"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild6);


                XmlElement eleGrandChild7 = xdoc.CreateElement("pwdhintid");
                eleGrandChild7.InnerText = rs1["pwdhintid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild7);

                XmlElement eleGrandChild8 = xdoc.CreateElement("pwdhint");
                eleGrandChild8.InnerText = rs1["pwdhint"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild8);

                XmlElement eleGrandChild9 = xdoc.CreateElement("pwdanswer");
                eleGrandChild9.InnerText = rs1["pwdanswer"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild9);

                XmlElement eleGrandChild10 = xdoc.CreateElement("email");
                eleGrandChild10.InnerText = rs1["email"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild10);

                XmlElement eleGrandChild11 = xdoc.CreateElement("remark");
                eleGrandChild11.InnerText = rs1["remark"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild11);

                XmlElement eleGrandChild12 = xdoc.CreateElement("ustatus");
                eleGrandChild12.InnerText = rs1["ustatus"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild12);



                XmlElement eleGrandChild13 = xdoc.CreateElement("effectdate");
                eleGrandChild13.InnerText = rs1["effectdate"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild13);

                XmlElement eleGrandChild14 = xdoc.CreateElement("expiredate");
                eleGrandChild14.InnerText = rs1["expiredate"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild14);

                XmlElement eleGrandChild15 = xdoc.CreateElement("dsn");
                eleGrandChild15.InnerText = rs1["dsn"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild15);

                XmlElement eleGrandChild16 = xdoc.CreateElement("gid");
                eleGrandChild16.InnerText = rs1["gid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild16);

                XmlElement eleGrandChild17 = xdoc.CreateElement("ucategory");
                eleGrandChild17.InnerText = rs1["ucategory"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild17);

                XmlElement eleGrandChild18 = xdoc.CreateElement("userpath");
                eleGrandChild18.InnerText = rs1["userpath"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild18);

                /*
                 *               ,utype,,,,
                 * ,,,,,,,,,
                 * ,,,,,,,
                 * ,optname2,optvalue2,optsyscontrol2,optname3,optvalue3,optsyscontrol3,inituid
                 * ,initdate,modifydate,modifyuid,comid,empid,levid,erpid*/


                XmlElement eleGrandChild19 = xdoc.CreateElement("authcode");
                eleGrandChild19.InnerText = rs1["authcode"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild19);

                XmlElement eleGrandChild20 = xdoc.CreateElement("sid");
                eleGrandChild20.InnerText = rs1["sid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild20);

                XmlElement eleGrandChild21 = xdoc.CreateElement("optname1");
                eleGrandChild21.InnerText = rs1["optname1"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild21);

                XmlElement eleGrandChild22 = xdoc.CreateElement("optvalue1");
                eleGrandChild22.InnerText = rs1["optvalue1"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild22);

                XmlElement eleGrandChild23 = xdoc.CreateElement("optsyscontrol1");
                eleGrandChild23.InnerText = rs1["optsyscontrol1"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild23);

                XmlElement eleGrandChild231 = xdoc.CreateElement("comid");
                eleGrandChild231.InnerText = rs1["comid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild231);


                XmlElement eleGrandChild24 = xdoc.CreateElement("empid");
                eleGrandChild24.InnerText = rs1["empid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild24);


                XmlElement eleGrandChild25 = xdoc.CreateElement("levid");
                eleGrandChild25.InnerText = rs1["levid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild25);


                XmlElement eleGrandChild26 = xdoc.CreateElement("erpid");
                eleGrandChild26.InnerText = rs1["erpid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild26);
                //lsit  使用者有那些群

                ds.Open("select rid,uid,modifyuid  from dgroleuser where uid='" + requid + "'");
                //先暫時產生一筆
                while (!ds.EOF)
                {
                    XmlElement eleGrandChild27 = xdoc.CreateElement("rid");
                    eleGrandChild27.InnerText = ds["rid"].ToString().Trim();
                    rootElement.AppendChild(eleGrandChild27);

                    XmlElement eleGrandChild28 = xdoc.CreateElement("ruid");
                    eleGrandChild28.InnerText = ds["uid"].ToString().Trim();
                    rootElement.AppendChild(eleGrandChild28);


                    XmlElement eleGrandChild29 = xdoc.CreateElement("rmodifyuid");
                    eleGrandChild29.InnerText = ds["modifyuid"].ToString().Trim();
                    rootElement.AppendChild(eleGrandChild29);



                    //DTotal++;
                    ds.MoveNext();
                }
                ds.Close();


                //   XmlElement eleGrandChild28 = xdoc.CreateElement("DTotal");
                //   eleGrandChild28.InnerText = DTotal.ToString();
                //   rootElement.AppendChild(eleGrandChild28);



                filename = rs1["comid"].ToString().Trim() + "dguser" + elapsedTicks.ToString();//rs1["empid"].ToString();

                // 將建立的 XML 節點儲存為檔案

                xdoc.Save(@"C:\\Admin\\" + filename);
                xdoc.Clone();


                Upload("C:\\Admin\\" + filename, "ftp://" + ftpip + "//" + filename, "mis", "666666");
                rs1.MoveNext();
            }
            rs1.Close();
        }
Example #4
0
        //建立XML 檔
        //輸入的參數為 link id

        private void CreateXML(string requid)
        {
            DateTime currentDate  = DateTime.Now;
            long     elapsedTicks = currentDate.Ticks;

            SmoothEnterprise.Database.DataSet ds  = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
            SmoothEnterprise.Database.DataSet rs1 = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
            rs1.Open("select *  from dguser where id='" + requid + "'");
            string filename;
            int    DTotal = 0;

            while (!rs1.EOF)
            {
                XmlDocument xdoc = new XmlDocument();
                xdoc.AppendChild(xdoc.CreateXmlDeclaration("1.0", "UTF-8", "yes"));
                // 建立根節點物件並加入 XmlDocument 中 (第 0 層)
                XmlElement rootElement = xdoc.CreateElement("NewDataSet");
                xdoc.AppendChild(rootElement);

                XmlElement eleChild1 = xdoc.CreateElement("NewDataSet");


                XmlElement eleGrandChilds = xdoc.CreateElement("FileType");
                eleGrandChilds.InnerText = "Update";
                rootElement.AppendChild(eleGrandChilds);

                XmlElement eleGrandChild1 = xdoc.CreateElement("id");
                eleGrandChild1.InnerText = rs1["id"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild1);

                XmlElement eleGrandChild2 = xdoc.CreateElement("utype");
                if (LocComid.SelectedValue != "NA")
                {
                    eleGrandChild2.InnerText = "64CA1E7D-B15F-43CB-A33A-D29DB9020892";
                }
                else
                {
                    eleGrandChild2.InnerText = rs1["utype"].ToString().Trim();
                }
                rootElement.AppendChild(eleGrandChild2);

                XmlElement eleGrandChild3 = xdoc.CreateElement("logonid");
                eleGrandChild3.InnerText = rs1["logonid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild3);

                XmlElement eleGrandChild4 = xdoc.CreateElement("name");
                eleGrandChild4.InnerText = rs1["name"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild4);

                XmlElement eleGrandChild5 = xdoc.CreateElement("userdomain");
                eleGrandChild5.InnerText = rs1["userdomain"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild5);


                XmlElement eleGrandChild6 = xdoc.CreateElement("pwd");
                if (LocComid.SelectedValue != "NA")
                {
                    eleGrandChild6.InnerText = rs1["pwd"].ToString().Trim();
                }
                else
                {
                    eleGrandChild6.InnerText = "";
                }
                rootElement.AppendChild(eleGrandChild6);


                XmlElement eleGrandChild7 = xdoc.CreateElement("pwdhintid");
                eleGrandChild7.InnerText = rs1["pwdhintid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild7);

                XmlElement eleGrandChild8 = xdoc.CreateElement("pwdhint");
                eleGrandChild8.InnerText = rs1["pwdhint"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild8);

                XmlElement eleGrandChild9 = xdoc.CreateElement("pwdanswer");
                eleGrandChild9.InnerText = rs1["pwdanswer"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild9);

                XmlElement eleGrandChild10 = xdoc.CreateElement("email");
                eleGrandChild10.InnerText = rs1["email"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild10);

                XmlElement eleGrandChild11 = xdoc.CreateElement("remark");
                eleGrandChild11.InnerText = rs1["remark"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild11);

                XmlElement eleGrandChild12 = xdoc.CreateElement("ustatus");
                if (LocComid.SelectedValue != "NA")
                {
                    eleGrandChild12.InnerText = "76CBA823-E891-45D3-8B6C-4724E6C69D5B";
                }
                else
                {
                    eleGrandChild12.InnerText = rs1["ustatus"].ToString().Trim();
                }


                rootElement.AppendChild(eleGrandChild12);



                XmlElement eleGrandChild13 = xdoc.CreateElement("effectdate");
                eleGrandChild13.InnerText = rs1["effectdate"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild13);

                XmlElement eleGrandChild14 = xdoc.CreateElement("expiredate");
                eleGrandChild14.InnerText = rs1["expiredate"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild14);

                XmlElement eleGrandChild15 = xdoc.CreateElement("dsn");
                eleGrandChild15.InnerText = rs1["dsn"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild15);

                XmlElement eleGrandChild16 = xdoc.CreateElement("gid");
                if (LocComid.SelectedValue != "NA")
                {
                    eleGrandChild16.InnerText = "";//因為子廠可能不會有這個人的群組
                }
                else
                {
                    eleGrandChild16.InnerText = rs1["gid"].ToString().Trim();
                }


                rootElement.AppendChild(eleGrandChild16);

                XmlElement eleGrandChild17 = xdoc.CreateElement("ucategory");
                eleGrandChild17.InnerText = rs1["ucategory"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild17);

                XmlElement eleGrandChild18 = xdoc.CreateElement("userpath");
                eleGrandChild18.InnerText = rs1["userpath"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild18);

                /*
                 *               ,utype,,,,
                 * ,,,,,,,,,
                 * ,,,,,,,
                 * ,optname2,optvalue2,optsyscontrol2,optname3,optvalue3,optsyscontrol3,inituid
                 * ,initdate,modifydate,modifyuid,comid,empid,levid,erpid*/


                XmlElement eleGrandChild19 = xdoc.CreateElement("authcode");
                eleGrandChild19.InnerText = rs1["authcode"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild19);

                XmlElement eleGrandChild20 = xdoc.CreateElement("sid");
                eleGrandChild20.InnerText = rs1["sid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild20);

                XmlElement eleGrandChild21 = xdoc.CreateElement("optname1");
                eleGrandChild21.InnerText = rs1["optname1"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild21);

                XmlElement eleGrandChild22 = xdoc.CreateElement("optvalue1");
                eleGrandChild22.InnerText = rs1["optvalue1"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild22);

                XmlElement eleGrandChild23 = xdoc.CreateElement("optsyscontrol1");
                eleGrandChild23.InnerText = rs1["optsyscontrol1"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild23);

                XmlElement eleGrandChild231 = xdoc.CreateElement("comid");
                eleGrandChild231.InnerText = rs1["comid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild231);


                XmlElement eleGrandChild24 = xdoc.CreateElement("empid");
                eleGrandChild24.InnerText = rs1["empid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild24);


                XmlElement eleGrandChild25 = xdoc.CreateElement("levid");
                eleGrandChild25.InnerText = rs1["levid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild25);


                XmlElement eleGrandChild26 = xdoc.CreateElement("erpid");
                eleGrandChild26.InnerText = rs1["erpid"].ToString().Trim();
                rootElement.AppendChild(eleGrandChild26);
                //lsit  使用者有那些群組

                ds.Open("select rid,uid,modifyuid  from dgroleuser where uid='" + requid + "'");
                //先暫時產生一筆
                if (!ds.EOF)
                {
                    XmlElement eleGrandChild27 = xdoc.CreateElement("rid");
                    eleGrandChild27.InnerText = "6D25693F-6B5D-4A5F-8716-D641A335B925"; // ds["rid"].ToString().Trim();
                    rootElement.AppendChild(eleGrandChild27);

                    XmlElement eleGrandChild28 = xdoc.CreateElement("ruid");
                    eleGrandChild28.InnerText = ds["uid"].ToString().Trim();
                    rootElement.AppendChild(eleGrandChild28);


                    XmlElement eleGrandChild29 = xdoc.CreateElement("rmodifyuid");
                    eleGrandChild29.InnerText = ds["modifyuid"].ToString().Trim();
                    rootElement.AppendChild(eleGrandChild29);



                    //DTotal++;
                    //ds.MoveNext();
                }
                ds.Close();


                //   XmlElement eleGrandChild28 = xdoc.CreateElement("DTotal");
                //   eleGrandChild28.InnerText = DTotal.ToString();
                //   rootElement.AppendChild(eleGrandChild28);

                if (LocComid.SelectedValue != "NA")
                {
                    filename = LocComid.SelectedValue + "dguser" + elapsedTicks.ToString();  // rs1["empid"].ToString();
                }
                else
                {
                    filename = rs1["comid"].ToString().Trim() + "dguser" + elapsedTicks.ToString();  // rs1["empid"].ToString();
                }



                // 將建立的 XML 節點儲存為檔案

                xdoc.Save(@"C:\\Admin\\" + filename);
                xdoc.Clone();


                Upload("C:\\Admin\\" + filename, "ftp://" + ftpip + "//" + filename, username, password);
                rs1.MoveNext();
            }
            rs1.Close();
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // this.tabtitle_Account.Attributes["tabtitle"] = base.GetLocalResourceObject("tabtitle_Account").ToString();
            // this.tabtitle_Information.Attributes["tabtitle"] = base.GetLocalResourceObject("tabtitle_Information").ToString();
            this.FIELD_photo.Attributes.Add("onchange", "value==''?" + this.PREVIEW_photo.ClientID + ".src='/lib/img/img-noimage.gif':" + this.PREVIEW_photo.ClientID + ".src=value;");
            DataSet set = new DataSet(DataSetType.OpenRead);

            try
            {
                set.Open("select A.*,B.uid from dgrole A LEFT OUTER JOIN dgroleuser B ON A.id=B.rid and B.uid='" + base.Request.QueryString["id"] + "' ");
                this.FIELD_role.Items.Clear();
                for (int i = 0; i < set.Rows.Count; i++)
                {
                    this.FIELD_role.Items.Add(set.Rows[i]["name"].ToString(), set.Rows[i]["id"].ToString(), set.Rows[i]["uid"].ToString() != "");
                }
                if (!base.IsPostBack)
                {
                    set.Open("select * from dguser where id='" + base.Request.QueryString["id"] + "'");
                    if (!set.EOF)
                    {
                        this.FIELD_utype.Value          = set["utype"].ToString();
                        this.FIELD_logonid.Text         = set["logonid"].ToString();
                        this.FIELD_name.Text            = set["name"].ToString();
                        this.FIELD_name1.Text           = set["name1"].ToString();
                        this.PREVIEW_photo.Src          = "UserImage.aspx?id=" + set["id"].ToString() + "&photo=1";
                        this.FIELD_pwd.Text             = set["pwd"].ToString();
                        this.FIELD_opwd.Text            = set["pwd"].ToString();
                        this.FIELD_pwd_confirm.Text     = set["pwd"].ToString();
                        this.FIELD_email.Text           = set["email"].ToString();
                        this.FIELD_gender.SelectedIndex = this.FIELD_gender.Items.IndexOf(this.FIELD_gender.Items.FindByValue(set["gender"].ToString()));
                        this.FIELD_remark.Text          = set["remark"].ToString();
                        this.FIELD_ucategory.Value      = set["ucategory"].ToString();
                        this.FIELD_ustatus.Value        = set["ustatus"].ToString();
                        this.FIELD_userdomain.Text      = set["userdomain"].ToString();
                        if (set["effectdate"].ToString() != "")
                        {
                            this.FIELD_effectdate.Text = DateTime.Parse(set["effectdate"].ToString()).ToShortDateString();
                        }
                        if (set["expiredate"].ToString() != "")
                        {
                            this.FIELD_expiredate.Text = DateTime.Parse(set["expiredate"].ToString()).ToShortDateString();
                        }
                        // this.FIELD_gid.Value = set["gid"].ToString();


                        SmoothEnterprise.Database.DataSet ds = new SmoothEnterprise.Database.DataSet(SmoothEnterprise.Database.DataSetType.OpenRead);
                        string whereis = "";
                        string comid   = "";
                        ds.Open("select comid from dguser where id='" + this.CurrentUser.ID + "'");
                        if (ds["comid"].ToString() != "")
                        {
                            comid = ds["comid"].ToString().ToUpper().Trim();
                        }
                        ds.Close();

                        if (comid != "MAT")
                        {
                            whereis = " where comid='" + comid + "'";
                            DdDept.SelectedValue = comid;
                            DdDept.Enabled       = false;
                            LocComid.Enabled     = false;
                        }



                        ds.Open(" select *  from dggroup  " + whereis);
                        while (!ds.EOF)
                        {
                            DDgid.Items.Add(new ListItem(ds["name"].ToString(), ds["id"].ToString()));

                            ds.MoveNext();
                        }

                        ds.Close();



                        DDgid.SelectedValue  = set["gid"].ToString();
                        DdDept.SelectedValue = set["comid"].ToString().Trim();
                        empid.Text           = set["empid"].ToString();
                    }
                    else
                    {
                        base.Response.Redirect("User.aspx");
                    }
                }
            }
            catch
            {
                base.Response.Redirect("User.aspx");
            }
            this.FIELD_utype_SelectedIndexChanged(sender, e);
            this.FIELD_pwd.Attributes.Add("onChange", this.FIELD_pwd_confirm.ClientID + ".value='';");
        }