Пример #1
0
        private void btn_CreateResXml_Click(object sender, EventArgs e)
        {
            string projectName = this.txt_ProjectName.Text;
            ResolveResXml.Model.Country country = this.cmb_Country.SelectedItem as Country;
            if (country != null)
            {
                List<ResolveResXml.Model.res_project> list = rpBll.GetModelList(" project_name='" + projectName + "' and project_CountryCode='" + country.CountryCode+ "'");
                if (list.Count == 0)
                {
                    ResolveResXml.Model.res_project res_project = new ResolveResXml.Model.res_project();
                    res_project.id = rpBll.GetMaxId();
                    res_project.project_Name = projectName;
                    res_project.project_CountryCode = country.CountryCode;
                    res_project.res_XMLs = new List<res_XML>();
                    bool addresult= rpBll.Add(res_project);
                    project = res_project;
                    this.DialogResult = DialogResult.OK;
                }
                else
                {
                    project = list[0];
                }

            }
        }
Пример #2
0
 /// <summary>
 /// 获得数据列表
 /// </summary>
 public List<ResolveResXml.Model.res_project> DataTableToList(DataTable dt)
 {
     List<ResolveResXml.Model.res_project> modelList = new List<ResolveResXml.Model.res_project>();
     int rowsCount = dt.Rows.Count;
     if (rowsCount > 0)
     {
         ResolveResXml.Model.res_project model;
         for (int n = 0; n < rowsCount; n++)
         {
             model = new ResolveResXml.Model.res_project();
             if (dt.Rows[n]["id"] != null && dt.Rows[n]["id"].ToString() != "")
             {
                 model.id = int.Parse(dt.Rows[n]["id"].ToString());
             }
             if (dt.Rows[n]["project_Name"] != null && dt.Rows[n]["project_Name"].ToString() != "")
             {
                 model.project_Name = dt.Rows[n]["project_Name"].ToString();
             }
             if (dt.Rows[n]["project_CountryCode"] != null && dt.Rows[n]["project_CountryCode"].ToString() != "")
             {
                 model.project_CountryCode = dt.Rows[n]["project_CountryCode"].ToString();
             }
             modelList.Add(model);
         }
     }
     return modelList;
 }
Пример #3
0
        private void 新建资源文件ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CreateResXml createRes = new CreateResXml();

            if (createRes.ShowDialog()==DialogResult.OK)
            {
                project = createRes.project;
                res_project resproject = resprojectBLL.GetModelList("id=" + project.id)[0];
            }
        }