Ejemplo n.º 1
0
        public bool AddMLedgerGroup(MLedgerGroup MLedgerGroup)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@LedgerGroupNo", MLedgerGroup.LedgerGroupNo);

            cmd.Parameters.AddWithValue("@LedgerName", MLedgerGroup.LedgerName);

            cmd.Parameters.AddWithValue("@LedgerLangName", MLedgerGroup.LedgerLangName);

            cmd.Parameters.AddWithValue("@GroupNo", MLedgerGroup.GroupNo);

            cmd.Parameters.AddWithValue("@IsActive", MLedgerGroup.IsActive);

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

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

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

            SqlParameter outParameter = new SqlParameter();

            outParameter.ParameterName = "@ReturnID";
            outParameter.Direction     = ParameterDirection.Output;
            outParameter.DbType        = DbType.Int32;
            cmd.Parameters.Add(outParameter);
            commandcollection.Add(cmd);
            return(true);
        }
Ejemplo n.º 2
0
        public MLedgerGroup ModifyMLedgerGroupByID(long ID)
        {
            SqlConnection Con = new SqlConnection(CommonFunctions.ConStr);
            string        sql;
            SqlCommand    cmd;

            sql            = "Select * from MLedgerGroup where LedgerGroupNo =" + 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)
            {
                MLedgerGroup MM = new MLedgerGroup();
                while (dr.Read())
                {
                    MM.LedgerGroupNo = Convert.ToInt32(dr["LedgerGroupNo"]);
                    if (!Convert.IsDBNull(dr["LedgerName"]))
                    {
                        MM.LedgerName = Convert.ToString(dr["LedgerName"]);
                    }
                    if (!Convert.IsDBNull(dr["LedgerLangName"]))
                    {
                        MM.LedgerLangName = Convert.ToString(dr["LedgerLangName"]);
                    }
                    if (!Convert.IsDBNull(dr["GroupNo"]))
                    {
                        MM.GroupNo = Convert.ToInt64(dr["GroupNo"]);
                    }
                    if (!Convert.IsDBNull(dr["IsActive"]))
                    {
                        MM.IsActive = Convert.ToBoolean(dr["IsActive"]);
                    }
                    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["CompanyNo"]))
                    {
                        MM.CompanyNo = Convert.ToInt64(dr["CompanyNo"]);
                    }
                }
                dr.Close();
                return(MM);
            }
            else
            {
                dr.Close();
            }
            return(new MLedgerGroup());
        }
Ejemplo n.º 3
0
        public bool DeleteMLedgerGroup(MLedgerGroup MLedgerGroup)
        {
            SqlCommand cmd;

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

            cmd.Parameters.AddWithValue("@LedgerGroupNo", MLedgerGroup.LedgerGroupNo);
            if (ObjTrans.ExecuteNonQuery(cmd, CommonFunctions.ConStr) == true)
            {
                return(true);
            }
            else
            {
                MLedgerGroup.msg = ObjTrans.ErrorMessage;
                return(false);
            }
        }