コード例 #1
0
 public void CompanyEdit(CompanyInfo InfoCompany)
 {
     try
     {
         SpCompany.CompanyEdit(InfoCompany);
     }
     catch (Exception ex)
     {
         MessageBox.Show("CC2:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #2
0
        public decimal CompanyAddParticularFeilds(CompanyInfo InfoCompany)
        {
            decimal decId = 0;
             try
             {

                 decId = SpCompany.CompanyAddParticularFeilds(InfoCompany);
             }

             catch (Exception ex)
             {
                 MessageBox.Show("CC4:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
             }
             return decId;
        }
コード例 #3
0
        public decimal CompanyAddParticularFeilds(CompanyInfo infoCompany)
        {
            CompanySP spCompany = new CompanySP();
            decimal decId = 0;
            try
            {
                decId = spCompany.CompanyAddParticularFeilds(infoCompany);
            }

            catch (Exception ex)
            {
                MessageBox.Show("CB:2" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
            return decId;
        }
コード例 #4
0
 /// <summary>
 /// Function to get particular values from Company table based on the parameter
 /// </summary>
 /// <param name="companyId"></param>
 /// <returns></returns>
 public CompanyInfo CompanyView(decimal companyId)
 {
     CompanyInfo companyinfo = new CompanyInfo();
     SqlDataReader sdrreader = null;
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("CompanyView", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@companyId", SqlDbType.Decimal);
         sprmparam.Value = companyId;
         sdrreader = sccmd.ExecuteReader();
         while (sdrreader.Read())
         {
             companyinfo.CompanyId = decimal.Parse(sdrreader[0].ToString());
             companyinfo.CompanyName = sdrreader[1].ToString();
             companyinfo.MailingName = sdrreader[2].ToString();
             companyinfo.Address = sdrreader[3].ToString();
             companyinfo.Phone = sdrreader[4].ToString();
             companyinfo.Mobile = sdrreader[5].ToString();
             companyinfo.EmailId = sdrreader[6].ToString();
             companyinfo.Web = sdrreader[7].ToString();
             companyinfo.Country = sdrreader[8].ToString();
             companyinfo.State = sdrreader[9].ToString();
             companyinfo.Pin = sdrreader[10].ToString();
             companyinfo.CurrencyId = decimal.Parse(sdrreader[11].ToString());
             companyinfo.FinancialYearFrom = DateTime.Parse(sdrreader[12].ToString());
             companyinfo.BooksBeginingFrom = DateTime.Parse(sdrreader[13].ToString());
             companyinfo.Tin = sdrreader[14].ToString();
             companyinfo.Cst = sdrreader[15].ToString();
             companyinfo.Pan = sdrreader[16].ToString();
             companyinfo.CurrentDate = DateTime.Parse(sdrreader[17].ToString());
             companyinfo.Logo = (byte[])(sdrreader[18]);
             companyinfo.Extra1 = sdrreader[19].ToString();
             companyinfo.Extra2 = sdrreader[20].ToString();
             companyinfo.ExtraDate = DateTime.Parse(sdrreader[21].ToString());
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sdrreader.Close();
         sqlcon.Close();
     }
     return companyinfo;
 }
コード例 #5
0
 /// <summary>
 /// Function to insert values to Company Table
 /// </summary>
 /// <param name="companyinfo"></param>
 public void CompanyAdd(CompanyInfo companyinfo)
 {
     try
     {
         if (sqlcon.State == ConnectionState.Closed)
         {
             sqlcon.Open();
         }
         SqlCommand sccmd = new SqlCommand("CompanyAdd", sqlcon);
         sccmd.CommandType = CommandType.StoredProcedure;
         SqlParameter sprmparam = new SqlParameter();
         sprmparam = sccmd.Parameters.Add("@companyId", SqlDbType.Decimal);
         sprmparam.Value = companyinfo.CompanyId;
         sprmparam = sccmd.Parameters.Add("@companyName", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.CompanyName;
         sprmparam = sccmd.Parameters.Add("@mailingName", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.MailingName;
         sprmparam = sccmd.Parameters.Add("@address", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Address;
         sprmparam = sccmd.Parameters.Add("@phone", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Phone;
         sprmparam = sccmd.Parameters.Add("@mobile", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Mobile;
         sprmparam = sccmd.Parameters.Add("@emailId", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.EmailId;
         sprmparam = sccmd.Parameters.Add("@web", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Web;
         sprmparam = sccmd.Parameters.Add("@country", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Country;
         sprmparam = sccmd.Parameters.Add("@state", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.State;
         sprmparam = sccmd.Parameters.Add("@pin", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Pin;
         sprmparam = sccmd.Parameters.Add("@currencyId", SqlDbType.Decimal);
         sprmparam.Value = companyinfo.CurrencyId;
         sprmparam = sccmd.Parameters.Add("@financialYearFrom", SqlDbType.DateTime);
         sprmparam.Value = companyinfo.FinancialYearFrom;
         sprmparam = sccmd.Parameters.Add("@booksBeginingFrom", SqlDbType.DateTime);
         sprmparam.Value = companyinfo.BooksBeginingFrom;
         sprmparam = sccmd.Parameters.Add("@tin", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Tin;
         sprmparam = sccmd.Parameters.Add("@cst", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Cst;
         sprmparam = sccmd.Parameters.Add("@pan", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Pan;
         sprmparam = sccmd.Parameters.Add("@currentDate", SqlDbType.DateTime);
         sprmparam.Value = companyinfo.CurrentDate;
         sprmparam = sccmd.Parameters.Add("@logo", SqlDbType.Image);
         sprmparam.Value = companyinfo.Logo;
         sprmparam = sccmd.Parameters.Add("@extra1", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Extra1;
         sprmparam = sccmd.Parameters.Add("@extra2", SqlDbType.VarChar);
         sprmparam.Value = companyinfo.Extra2;
         sprmparam = sccmd.Parameters.Add("@extraDate", SqlDbType.DateTime);
         sprmparam.Value = companyinfo.ExtraDate;
         sccmd.ExecuteNonQuery();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.ToString());
     }
     finally
     {
         sqlcon.Close();
     }
 }
コード例 #6
0
 public CompanyInfo CompanyView(decimal companyId)
 {
     CompanyInfo InfoCompany = new CompanyInfo();
      try
      {
          InfoCompany = SpCompany.CompanyView(companyId);
      }
      catch (Exception ex)
      {
          MessageBox.Show("CC5:" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
      }
      return InfoCompany;
 }
コード例 #7
0
        public void CompanyEdit(CompanyInfo infoCompany)
        {
            CompanySP spCompany = new CompanySP();
            try
            {
                spCompany.CompanyEdit(infoCompany);
            }

            catch (Exception ex)
            {
                MessageBox.Show("CB:3" + ex.Message, "OpenMiracle", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }