Example #1
0
        public bool DeleteMDutiesTaxesInfo(MDutiesTaxesInfo mdutiestaxesinfo)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@PkSrNo", mdutiestaxesinfo.PkSrNo);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                mdutiestaxesinfo.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }
Example #2
0
        public bool AddMDutiesTaxesInfo(MDutiesTaxesInfo mdutiestaxesinfo)
        {
            SqlCommand cmd;

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

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

            cmd.Parameters.AddWithValue("@LedgerNo", mdutiestaxesinfo.LedgerNo);

            cmd.Parameters.AddWithValue("@TaxOnLedgerNo", mdutiestaxesinfo.TaxOnLedgerNo);

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

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

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

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

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

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

            //cmd.Parameters.AddWithValue("@ModifiedBy", mdutiestaxesinfo.ModifiedBy);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                mdutiestaxesinfo.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }
Example #3
0
        public MDutiesTaxesInfo ModifyMDutiesTaxesInfoByID(long ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql;
            SqlCommand    cmd;

            sql            = "Select * from MDutiesTaxesInfo 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)
            {
                MDutiesTaxesInfo MM = new MDutiesTaxesInfo();
                while (dr.Read())
                {
                    MM.PkSrNo = Convert.ToInt32(dr["PkSrNo"]);
                    if (!Convert.IsDBNull(dr["LedgerNo"]))
                    {
                        MM.LedgerNo = Convert.ToInt64(dr["LedgerNo"]);
                    }
                    if (!Convert.IsDBNull(dr["TaxOnLedgerNo"]))
                    {
                        MM.TaxOnLedgerNo = Convert.ToInt64(dr["TaxOnLedgerNo"]);
                    }
                    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.ToInt64(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 MDutiesTaxesInfo());
        }