Ejemplo n.º 1
0
        public bool DeleteMCompany(MCompany mcompany)
        {
            SqlCommand cmd = null;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "DeleteMCompany";

            cmd.Parameters.AddWithValue("@CompanyNo", mcompany.CompanyNo);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                mcompany.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }
Ejemplo n.º 2
0
        public bool AddMCompany(MCompany mcompany)
        {
            SqlCommand cmd = null;

            cmd             = new SqlCommand();
            cmd.CommandType = CommandType.StoredProcedure;
            cmd.CommandText = "AddMCompany";

            cmd.Parameters.AddWithValue("@CompanyNo", mcompany.CompanyNo);

            cmd.Parameters.AddWithValue("@RegistrationNo", mcompany.RegistrationNo);

            cmd.Parameters.AddWithValue("@CompanyUserCode", mcompany.CompanyUserCode);

            cmd.Parameters.AddWithValue("@CompanyName", mcompany.CompanyName);

            cmd.Parameters.AddWithValue("@AddressCode", mcompany.AddressCode);

            cmd.Parameters.AddWithValue("@PhoneNo", mcompany.PhoneNo);

            cmd.Parameters.AddWithValue("@CityCode", mcompany.CityCode);

            cmd.Parameters.AddWithValue("@PinCode", mcompany.PinCode);

            //cmd.Parameters.AddWithValue("@FinancialYear", mcompany.FinancialYear);

            //cmd.Parameters.AddWithValue("@BooksBeginFrom", mcompany.BooksBeginFrom);

            //cmd.Parameters.AddWithValue("@BooksEndOn", mcompany.BooksEndOn);

            cmd.Parameters.AddWithValue("@Config", mcompany.Config);

            cmd.Parameters.AddWithValue("@CSTNo", mcompany.CSTNo);

            cmd.Parameters.AddWithValue("@BSTNo", mcompany.BSTNo);

            cmd.Parameters.AddWithValue("@TinNo", mcompany.TinNo);

            cmd.Parameters.AddWithValue("@IncomeTaxNo", mcompany.IncomeTaxNo);

            cmd.Parameters.AddWithValue("@VatNo", mcompany.VatNo);

            cmd.Parameters.AddWithValue("@CurrencySymbol", mcompany.CurrencySymbol);

            cmd.Parameters.AddWithValue("@MailingName", mcompany.MailingName);

            cmd.Parameters.AddWithValue("@MaintainCode", mcompany.MaintainCode);

            cmd.Parameters.AddWithValue("@BaseCurrencySymbol", mcompany.BaseCurrencySymbol);

            cmd.Parameters.AddWithValue("@FormalName", mcompany.FormalName);

            cmd.Parameters.AddWithValue("@NoOfDecimalPlaces", mcompany.NoOfDecimalPlaces);

            cmd.Parameters.AddWithValue("@SymbolSuffixed", mcompany.SymbolSuffixed);

            cmd.Parameters.AddWithValue("@AmountInMillion", mcompany.AmountInMillion);

            cmd.Parameters.AddWithValue("@SpaceBetweenAmountAndSymbol", mcompany.SpaceBetweenAmountAndSymbol);

            cmd.Parameters.AddWithValue("@UICulture", mcompany.UICulture);

            cmd.Parameters.AddWithValue("@FontName", mcompany.FontName);

            cmd.Parameters.AddWithValue("@FontSize1", mcompany.FontSize1);

            cmd.Parameters.AddWithValue("@FontSize2", mcompany.FontSize2);

            //cmd.Parameters.AddWithValue("@ModifiedBy", mcompany.ModifiedBy);

            cmd.Parameters.AddWithValue("@LogoPath", mcompany.LogoPath);

            cmd.Parameters.AddWithValue("@Narr_Head", mcompany.Narr_Head);

            cmd.Parameters.AddWithValue("@Narr_Foot", mcompany.Narr_Foot);

            cmd.Parameters.AddWithValue("@Narr_Terms", mcompany.Narr_Terms);

            cmd.Parameters.AddWithValue("@CompanyType", mcompany.CompanyType);

            cmd.Parameters.AddWithValue("@LBTNo", mcompany.LBTNo);


            //---GST--//
            cmd.Parameters.AddWithValue("@StateCode", mcompany.StateCode);

            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                mcompany.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }
Ejemplo n.º 3
0
        public MCompany ModifyMCompanyByID(int ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql = null;
            SqlCommand    cmd = null;

            sql            = "Select * from MCompany where CompanyNo =" + ID;
            cmd            = new SqlCommand(sql, Con);
            cmd.Connection = Con;
            Con.Open();
            cmd.CommandType = CommandType.Text;
            SqlDataReader dr = null;

            dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            if (dr.HasRows)
            {
                MCompany MM = new MCompany();
                while (dr.Read())
                {
                    MM.CompanyNo = Convert.ToInt32(dr["CompanyNo"]);
                    if (!(Convert.IsDBNull(dr["RegistrationNo"])))
                    {
                        MM.RegistrationNo = Convert.ToInt64(dr["RegistrationNo"]);
                    }
                    if (!(Convert.IsDBNull(dr["CompanyUserCode"])))
                    {
                        MM.CompanyUserCode = Convert.ToString(dr["CompanyUserCode"]);
                    }
                    if (!(Convert.IsDBNull(dr["CompanyName"])))
                    {
                        MM.CompanyName = Convert.ToString(dr["CompanyName"]);
                    }
                    if (!(Convert.IsDBNull(dr["AddressCode"])))
                    {
                        MM.AddressCode = Convert.ToString(dr["AddressCode"]);
                    }
                    if (!(Convert.IsDBNull(dr["PhoneNo"])))
                    {
                        MM.PhoneNo = Convert.ToString(dr["PhoneNo"]);
                    }
                    if (!(Convert.IsDBNull(dr["CityCode"])))
                    {
                        MM.CityCode = Convert.ToInt64(dr["CityCode"]);
                    }
                    if (!(Convert.IsDBNull(dr["PinCode"])))
                    {
                        MM.PinCode = Convert.ToString(dr["PinCode"]);
                    }
                    if (!(Convert.IsDBNull(dr["FinancialYear"])))
                    {
                        MM.FinancialYear = Convert.ToDateTime(dr["FinancialYear"]);
                    }
                    if (!(Convert.IsDBNull(dr["BooksBeginFrom"])))
                    {
                        MM.BooksBeginFrom = Convert.ToDateTime(dr["BooksBeginFrom"]);
                    }
                    if (!(Convert.IsDBNull(dr["BooksEndOn"])))
                    {
                        MM.BooksEndOn = Convert.ToDateTime(dr["BooksEndOn"]);
                    }
                    if (!(Convert.IsDBNull(dr["Config"])))
                    {
                        MM.Config = Convert.ToString(dr["Config"]);
                    }
                    if (!(Convert.IsDBNull(dr["CSTNo"])))
                    {
                        MM.CSTNo = Convert.ToString(dr["CSTNo"]);
                    }
                    if (!(Convert.IsDBNull(dr["BSTNo"])))
                    {
                        MM.BSTNo = Convert.ToString(dr["BSTNo"]);
                    }
                    if (!(Convert.IsDBNull(dr["TinNo"])))
                    {
                        MM.TinNo = Convert.ToString(dr["TinNo"]);
                    }
                    if (!(Convert.IsDBNull(dr["IncomeTaxNo"])))
                    {
                        MM.IncomeTaxNo = Convert.ToString(dr["IncomeTaxNo"]);
                    }
                    if (!(Convert.IsDBNull(dr["VatNo"])))
                    {
                        MM.VatNo = Convert.ToString(dr["VatNo"]);
                    }
                    if (!(Convert.IsDBNull(dr["CurrencySymbol"])))
                    {
                        MM.CurrencySymbol = Convert.ToString(dr["CurrencySymbol"]);
                    }
                    if (!(Convert.IsDBNull(dr["MailingName"])))
                    {
                        MM.MailingName = Convert.ToString(dr["MailingName"]);
                    }
                    if (!(Convert.IsDBNull(dr["MaintainCode"])))
                    {
                        MM.MaintainCode = Convert.ToInt64(dr["MaintainCode"]);
                    }
                    if (!(Convert.IsDBNull(dr["BaseCurrencySymbol"])))
                    {
                        MM.BaseCurrencySymbol = Convert.ToString(dr["BaseCurrencySymbol"]);
                    }
                    if (!(Convert.IsDBNull(dr["FormalName"])))
                    {
                        MM.FormalName = Convert.ToString(dr["FormalName"]);
                    }
                    if (!(Convert.IsDBNull(dr["NoOfDecimalPlaces"])))
                    {
                        MM.NoOfDecimalPlaces = Convert.ToInt32(dr["NoOfDecimalPlaces"]);
                    }
                    if (!(Convert.IsDBNull(dr["SymbolSuffixed"])))
                    {
                        MM.SymbolSuffixed = Convert.ToInt32(dr["SymbolSuffixed"]);
                    }
                    if (!(Convert.IsDBNull(dr["AmountInMillion"])))
                    {
                        MM.AmountInMillion = Convert.ToInt32(dr["AmountInMillion"]);
                    }
                    if (!(Convert.IsDBNull(dr["SpaceBetweenAmountAndSymbol"])))
                    {
                        MM.SpaceBetweenAmountAndSymbol = Convert.ToInt32(dr["SpaceBetweenAmountAndSymbol"]);
                    }
                    if (!(Convert.IsDBNull(dr["UICulture"])))
                    {
                        MM.UICulture = Convert.ToString(dr["UICulture"]);
                    }
                    if (!(Convert.IsDBNull(dr["FontName"])))
                    {
                        MM.FontName = Convert.ToString(dr["FontName"]);
                    }
                    if (!(Convert.IsDBNull(dr["FontSize1"])))
                    {
                        MM.FontSize1 = Convert.ToInt32(dr["FontSize1"]);
                    }
                    if (!(Convert.IsDBNull(dr["FontSize2"])))
                    {
                        MM.FontSize2 = Convert.ToInt32(dr["FontSize2"]);
                    }
                    if (!(Convert.IsDBNull(dr["ModifiedBy"])))
                    {
                        MM.ModifiedBy = Convert.ToString(dr["ModifiedBy"]);
                    }
                    if (!(Convert.IsDBNull(dr["LogoPath"])))
                    {
                        MM.LogoPath = Convert.ToString(dr["LogoPath"]);
                    }
                    if (!(Convert.IsDBNull(dr["Narr_Head"])))
                    {
                        MM.Narr_Head = Convert.ToString(dr["Narr_Head"]);
                    }
                    if (!(Convert.IsDBNull(dr["Narr_Foot"])))
                    {
                        MM.Narr_Foot = Convert.ToString(dr["Narr_Foot"]);
                    }
                    if (!(Convert.IsDBNull(dr["Narr_Terms"])))
                    {
                        MM.Narr_Terms = Convert.ToString(dr["Narr_Terms"]);
                    }
                    if (!(Convert.IsDBNull(dr["CompanyType"])))
                    {
                        MM.CompanyType = Convert.ToInt32(dr["CompanyType"]);
                    }
                    if (!(Convert.IsDBNull(dr["LBTNo"])))
                    {
                        MM.LBTNo = Convert.ToString(dr["LBTNo"]);
                    }
                    if (!(Convert.IsDBNull(dr["StateCode"])))
                    {
                        MM.StateCode = Convert.ToInt32(dr["StateCode"]);
                    }
                }
                dr.Close();
                return(MM);
            }
            else
            {
                dr.Close();
            }
            return(new MCompany());
        }