Пример #1
0
        public bool AddMItemTaxInfo2(MItemTaxInfo mitemtaxinfo)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@PkSrNo", mitemtaxinfo.PkSrNo);

            cmd.Parameters.AddWithValue("@ItemNo", mitemtaxinfo.ItemNo);

            cmd.Parameters.AddWithValue("@TaxLedgerNo", mitemtaxinfo.TaxLedgerNo);

            cmd.Parameters.AddWithValue("@SalesLedgerNo", mitemtaxinfo.SalesLedgerNo);

            cmd.Parameters.AddWithValue("@FromDate", mitemtaxinfo.FromDate);

            cmd.Parameters.AddWithValue("@CalculationMethod", mitemtaxinfo.CalculationMethod);

            cmd.Parameters.AddWithValue("@Percentage", mitemtaxinfo.Percentage);

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

            cmd.Parameters.AddWithValue("@FKTaxSettingNo", mitemtaxinfo.FKTaxSettingNo);

            cmd.Parameters.AddWithValue("@UserID", mitemtaxinfo.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mitemtaxinfo.UserDate);

            commandcollection.Add(cmd);

            return(true);
        }
Пример #2
0
        public bool DeleteMItemTaxInfo(MItemTaxInfo mitemtaxinfo)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@PkSrNo", mitemtaxinfo.PkSrNo);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                mitemtaxinfo.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }
Пример #3
0
        public bool AddMItemTaxInfo(MItemTaxInfo mitemtaxinfo)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@PkSrNo", mitemtaxinfo.PkSrNo);

            cmd.Parameters.AddWithValue("@ItemNo", mitemtaxinfo.ItemNo);

            cmd.Parameters.AddWithValue("@TaxLedgerNo", mitemtaxinfo.TaxLedgerNo);

            cmd.Parameters.AddWithValue("@SalesLedgerNo", mitemtaxinfo.SalesLedgerNo);

            cmd.Parameters.AddWithValue("@FromDate", mitemtaxinfo.FromDate);

            cmd.Parameters.AddWithValue("@CalculationMethod", mitemtaxinfo.CalculationMethod);

            cmd.Parameters.AddWithValue("@Percentage", mitemtaxinfo.Percentage);

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

            cmd.Parameters.AddWithValue("@FKTaxSettingNo", mitemtaxinfo.FKTaxSettingNo);

            cmd.Parameters.AddWithValue("@UserID", mitemtaxinfo.UserID);

            cmd.Parameters.AddWithValue("@UserDate", mitemtaxinfo.UserDate);

            //cmd.Parameters.AddWithValue("@ModifiedBy", mitemtaxinfo.ModifiedBy);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                mitemtaxinfo.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }
Пример #4
0
        public MItemTaxInfo ModifyMItemTaxInfoByID(long ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql;
            SqlCommand    cmd;

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

            dr = cmd.ExecuteReader(CommandBehavior.CloseConnection);
            if (dr.HasRows)
            {
                MItemTaxInfo MM = new MItemTaxInfo();
                while (dr.Read())
                {
                    MM.PkSrNo = Convert.ToInt32(dr["PkSrNo"]);
                    if (!Convert.IsDBNull(dr["ItemNo"]))
                    {
                        MM.ItemNo = Convert.ToInt64(dr["ItemNo"]);
                    }
                    if (!Convert.IsDBNull(dr["LedgerNo"]))
                    {
                        MM.TaxLedgerNo = Convert.ToInt64(dr["TaxLedgerNo"]);
                    }
                    if (!Convert.IsDBNull(dr["SalesTaxLedgerNo"]))
                    {
                        MM.SalesLedgerNo = Convert.ToInt64(dr["SalesLedgerNo"]);
                    }
                    if (!Convert.IsDBNull(dr["FromDate"]))
                    {
                        MM.FromDate = Convert.ToDateTime(dr["FromDate"]);
                    }
                    if (!Convert.IsDBNull(dr["CalculationMethod"]))
                    {
                        MM.CalculationMethod = Convert.ToString(dr["CalculationMethod"]);
                    }
                    if (!Convert.IsDBNull(dr["Percentage"]))
                    {
                        MM.Percentage = Convert.ToDouble(dr["Percentage"]);
                    }
                    if (!Convert.IsDBNull(dr["CompanyNo"]))
                    {
                        MM.CompanyNo = Convert.ToInt64(dr["CompanyNo"]);
                    }
                    if (!Convert.IsDBNull(dr["UserID"]))
                    {
                        MM.UserID = Convert.ToInt64(dr["UserID"]);
                    }
                    if (!Convert.IsDBNull(dr["UserDate"]))
                    {
                        MM.UserDate = Convert.ToDateTime(dr["UserDate"]);
                    }
                    if (!Convert.IsDBNull(dr["ModifiedBy"]))
                    {
                        MM.ModifiedBy = Convert.ToString(dr["ModifiedBy"]);
                    }
                }
                dr.Close();
                return(MM);
            }
            else
            {
                dr.Close();
            }
            return(new MItemTaxInfo());
        }