Ejemplo n.º 1
0
        private void btnWebModuleDelete_Click(object sender, EventArgs e)
        {
            ListView.SelectedListViewItemCollection item = this.listViewWebModule.SelectedItems;
            DALWebPublishModule dal = new DALWebPublishModule();

            dal.Delete(int.Parse("0" + item[0].Tag));
            Bind_WebPublishModule(" TaskID=" + this.ID + " ");
        }
Ejemplo n.º 2
0
        private void Bind_WebPublishModule(string strWhere)
        {
            this.listViewWebModule.Items.Clear();
            DALWebPublishModule dal = new DALWebPublishModule();
            DataTable           dt  = dal.GetList(strWhere).Tables[0];

            foreach (DataRow dr in dt.Rows)
            {
                ListViewItem li = new ListViewItem(dr["ModuleName"].ToString());
                li.SubItems.Add(dr["ClassID"].ToString());
                li.SubItems.Add(dr["ClassName"].ToString());
                li.Tag = dr["ID"].ToString();
                this.listViewWebModule.Items.Add(li);
            }
        }
Ejemplo n.º 3
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            int    ID                   = Int32.Parse("0" + this.txtID.Text);
            int    TaskID               = this.TaskID;
            string ModuleName           = this.txtWebPublishName.Text;
            string SiteUrl              = this.txtWebPublishUrl.Text;
            int    IsCookiesLogin       = this.chkCookies.Checked ? 1 : 0;
            string CookiesValue         = this.txtWebPublishCookies.Text;
            int    ClassID              = int.Parse(this.txtClassID.Text);
            string ClassName            = this.txtClassName.Text;
            string LoginUserName        = this.txtWebPublishUserName.Text;
            string LoginUserPwd         = this.txtWebPublishPassWord.Text;
            string ModuleNameFile       = (string)this.listBoxPublishModule.SelectedItem;
            string CreateTime           = DateTime.Now.ToString();
            DALWebPublishModule   dal   = new DALWebPublishModule();
            ModelWebPublishModule model = new ModelWebPublishModule();

            model.ID             = ID;
            model.TaskID         = TaskID;
            model.ModuleName     = ModuleName;
            model.SiteUrl        = SiteUrl;
            model.IsCookiesLogin = IsCookiesLogin;
            model.CookiesValue   = CookiesValue;
            model.ClassID        = ClassID;
            model.ClassName      = ClassName;
            model.LoginUserName  = LoginUserName;
            model.LoginUserPwd   = LoginUserPwd;
            model.ModuleNameFile = ModuleNameFile;
            model.CreateTime     = CreateTime;

            if (ID == 0)
            {
                ID = dal.Add(model);
            }
            else if (ID > 0)
            {
                dal.Update(model);
            }
            if (ECEH != null)
            {
                ECEH(ID, "操作成功!");
            }
            this.Hide();
            this.Close();
        }
Ejemplo n.º 4
0
        private void Bind_DataEdit()
        {
            ListView.SelectedListViewItemCollection item = (ListView.SelectedListViewItemCollection)EditItem;
            DALWebPublishModule dal = new DALWebPublishModule();
            int ID = Int32.Parse("0" + item[0].Tag);
            ModelWebPublishModule model = dal.GetModel(ID);

            this.txtID.Text                        = model.ID.ToString();
            this.TaskID                            = int.Parse("0" + model.TaskID.ToString());
            this.txtWebPublishName.Text            = model.ModuleName;
            this.txtWebPublishUrl.Text             = model.SiteUrl;
            this.chkCookies.Checked                = model.IsCookiesLogin.ToString() == "1" ? true : false;
            this.txtWebPublishCookies.Text         = model.CookiesValue;
            this.txtClassID.Text                   = model.ClassID.ToString();
            this.txtClassName.Text                 = model.ClassName;
            this.txtWebPublishUserName.Text        = model.LoginUserName;
            this.txtWebPublishPassWord.Text        = model.LoginUserPwd;
            this.listBoxPublishModule.SelectedItem = model.ModuleNameFile;
        }
Ejemplo n.º 5
0
        private void btnSubmit_Click(object sender, EventArgs e)
        {
            string WebCollectionModule = this.txtWebCollectionModule.Text;

            if (string.IsNullOrEmpty(WebCollectionModule))
            {
                MessageBox.Show("采集模块不能为空!");
                return;
            }

            var     model        = SerializeHelper.DeserializeObject <ModelTask>(WebCollectionModule);
            DALTask dal          = new DALTask();
            int     currentMaxId = dal.GetMaxId();

            model.ID = currentMaxId;
            dal.Add(model);
            foreach (ModelTaskLabel label in model.ListTaskLabel)
            {
                label.TaskID = currentMaxId;
                var d = new DALTaskLabel();
                var m = d.GetMaxID();
                label.ID = m;
                d.Add(label);
            }
            foreach (ModelWebPublishModule label in model.ListModelWebPublishModule)
            {
                label.TaskID = currentMaxId;
                var d = new DALWebPublishModule();
                label.ID = 0;
                d.Add(label);
            }
            MessageBox.Show("导入成功");
            RefreshParentForm?.Invoke(this, new EventArgs());
            this.Hide();
            this.Close();
        }