示例#1
0
 public SpParamClass(SpParamResultDetail details)
 {
     InitializeComponent();
     _detail              = details;
     this.rtxtParam.Text  = _detail.Param;
     this.rtxtJson.Text   = _detail.Json;
     this.rtxtResult.Text = _detail.Result;
     this.rtxtRepo.Text   = _detail.RepoMethod ?? _detail.Repo;
 }
示例#2
0
        private void btnGo_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(txtNameSpace.Text))
            {
                MessageBox.Show("Prove Value for Name space ");
                return;
            }

            List <SPlist> lst  = new List <SPlist>();
            CodeGenerator _gen = new CodeGenerator();

            for (int rows = 0; rows < dataGridView1.Rows.Count; rows++)
            {
                SPlist obj = new SPlist();
                obj.Spname     = dataGridView1.Rows[rows].Cells["spname"].Value?.ToString();
                obj.ClassName  = dataGridView1.Rows[rows].Cells["Classname"].Value?.ToString();
                obj.MethodName = dataGridView1.Rows[rows].Cells["MethodName"].Value?.ToString();
                obj.IsNonQuery = Convert.ToBoolean(dataGridView1.Rows[rows].Cells["IsNonQuery"].Value);
                obj.IsSingle   = Convert.ToBoolean(dataGridView1.Rows[rows].Cells["IsSingle"].Value);
                if (!string.IsNullOrEmpty(obj.Spname))
                {
                    lst.Add(obj);
                }
            }
            SpParamResultDetail m = _gen.GenerateModel(lst, Home.Constr, txtNameSpace.Text);

            m.Consts = _gen.GenerateConsts(lst);

            if (checkBox1.Checked)
            {
                if (!string.IsNullOrEmpty(textBox2.Text) && !string.IsNullOrEmpty(textBox2.Text))
                {
                    m.Repo = _gen.GenerateRepo(lst, textBox2.Text, textBox3.Text);
                }

                else
                {
                    MessageBox.Show("Please provide Value for Repo Namesapce and Repo class");
                }
            }

            SpParamClass objparam = new SpParamClass(m);

            objparam.ShowDialog();
        }